Skip to content

Commit

Permalink
fix timespec redefinition errors on windows
Browse files Browse the repository at this point in the history
* 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 <sarnold@vctlabs.com>
  • Loading branch information
sarnold committed Jul 23, 2023
1 parent eef36ac commit d63c541
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
$<$<BOOL:${ABC_USE_NO_PTHREADS}>:HAVE_STRUCT_TIMESPEC>
$<$<BOOL:${BUILD_SHARED_LIBS}>:ABC_DLL=ABC_DLLEXPORT>
$<$<NOT:$<BOOL:${BUILD_SHARED_LIBS}>>:WIN32_NO_DLL>
$<$<NOT:$<BOOL:${BUILD_SHARED_LIBS}>>:ABC_NO_DYNAMIC_LINKING>
Expand Down

0 comments on commit d63c541

Please sign in to comment.