From d63c5413831a00ef2ebf0200bd30c74a691b8c89 Mon Sep 17 00:00:00 2001 From: Stephen L Arnold Date: Sun, 23 Jul 2023 11:24:58 -0700 Subject: [PATCH] fix timespec redefinition errors on windows * win pthreads module tries to define timespec if HAVE_STRUCT_TIMESPEC is not defined except msys/mingw already defines it Signed-off-by: Stephen L Arnold --- CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 9b6b02e57a..3ea3a439a9 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -168,16 +168,16 @@ elseif(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC") "_MBCS" "_SCL_SECURE_NO_WARNINGS" "_CRT_SECURE_NO_WARNINGS" - "HAVE_STRUCT_TIMESPEC" "_XKEYCHECK_H" ) endif() if(WIN32) if(MINGW OR MSYS) - add_definitions(-DWIN32 -D__MINGW32__) + add_definitions(-DWIN32 -D__MINGW32__ -DHAVE_STRUCT_TIMESPEC) endif() target_compile_definitions(abc_interface INTERFACE + $<$:HAVE_STRUCT_TIMESPEC> $<$:ABC_DLL=ABC_DLLEXPORT> $<$>:WIN32_NO_DLL> $<$>:ABC_NO_DYNAMIC_LINKING>