Skip to content

Commit d63c541

Browse files
committed
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 <[email protected]>
1 parent eef36ac commit d63c541

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -168,16 +168,16 @@ elseif(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
168168
"_MBCS"
169169
"_SCL_SECURE_NO_WARNINGS"
170170
"_CRT_SECURE_NO_WARNINGS"
171-
"HAVE_STRUCT_TIMESPEC"
172171
"_XKEYCHECK_H"
173172
)
174173
endif()
175174
if(WIN32)
176175
if(MINGW OR MSYS)
177-
add_definitions(-DWIN32 -D__MINGW32__)
176+
add_definitions(-DWIN32 -D__MINGW32__ -DHAVE_STRUCT_TIMESPEC)
178177
endif()
179178
target_compile_definitions(abc_interface
180179
INTERFACE
180+
$<$<BOOL:${ABC_USE_NO_PTHREADS}>:HAVE_STRUCT_TIMESPEC>
181181
$<$<BOOL:${BUILD_SHARED_LIBS}>:ABC_DLL=ABC_DLLEXPORT>
182182
$<$<NOT:$<BOOL:${BUILD_SHARED_LIBS}>>:WIN32_NO_DLL>
183183
$<$<NOT:$<BOOL:${BUILD_SHARED_LIBS}>>:ABC_NO_DYNAMIC_LINKING>

0 commit comments

Comments
 (0)