Skip to content

Commit

Permalink
Use nanosleep if available (#209)
Browse files Browse the repository at this point in the history
  • Loading branch information
at-wat committed Apr 24, 2024
1 parent 3925394 commit ab69cc8
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ include(CheckFunctionExists)
check_function_exists(longjmp HAVE_LONGJMP)
check_function_exists(siglongjmp HAVE_SIGLONGJMP)
check_function_exists(clock_nanosleep HAVE_CLOCK_NANOSLEEP)
check_function_exists(nanosleep HAVE_NANOSLEEP)

configure_file(${CMAKE_CURRENT_SOURCE_DIR}/cmake/config.h.cmake
${CMAKE_CURRENT_BINARY_DIR}/include/config.h
Expand Down Expand Up @@ -120,6 +121,9 @@ if(CMAKE_VERSION VERSION_LESS "3.12")
if(HAVE_CLOCK_NANOSLEEP)
add_definitions(-DHAVE_CLOCK_NANOSLEEP)
endif()
if(HAVE_NANOSLEEP)
add_definitions(-DHAVE_NANOSLEEP)
endif()
if(HAVE_SSM)
add_definitions(-DHAVE_SSM)
endif()
Expand All @@ -133,6 +137,9 @@ else()
if(HAVE_CLOCK_NANOSLEEP)
add_compile_definitions(HAVE_CLOCK_NANOSLEEP)
endif()
if(HAVE_NANOSLEEP)
add_compile_definitions(HAVE_NANOSLEEP)
endif()
if(HAVE_SSM)
add_compile_definitions(HAVE_SSM)
endif()
Expand Down

0 comments on commit ab69cc8

Please sign in to comment.