Fix pthreads on non-MinGW Windows builds
- Use C11 standard `timespec_get` instead of `clock_gettime` - Remove the unused `thread_sleep` function
This commit is contained in:
@@ -104,4 +104,11 @@ if(MSVC_TOOLSET_VERSION GREATER_EQUAL 142 AND ARCH STREQUAL "arm64")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# HACK: MinGW does not have `timespec_get`
|
||||
include(CheckSymbolExists)
|
||||
check_symbol_exists(timespec_get time.h HAS_TIMESPEC_GET)
|
||||
if(HAS_TIMESPEC_GET)
|
||||
add_compile_definitions(HAS_TIMESPEC_GET)
|
||||
endif()
|
||||
|
||||
add_subdirectory(src)
|
||||
|
||||
Reference in New Issue
Block a user