diff --git a/src/os/CMakeLists.txt b/src/os/CMakeLists.txt index cb64db5..1eecf48 100644 --- a/src/os/CMakeLists.txt +++ b/src/os/CMakeLists.txt @@ -78,8 +78,9 @@ elseif(UNIX) check_library_exists(c clock_gettime "" HAVE_CLOCK_GETTIME) if(NOT HAVE_CLOCK_GETTIME) # Before glibc 2.17, clock_gettime was in librt. - check_library_exists(rt clock_gettime "time.h" HAVE_CLOCK_GETTIME) - if(HAVE_CLOCK_GETTIME) + check_library_exists(rt clock_gettime "time.h" HAVE_CLOCK_GETTIME_RT) + if(HAVE_CLOCK_GETTIME_RT) + set(HAVE_CLOCK_GETTIME "${HAVE_CLOCK_GETTIME_RT}") target_link_libraries(OSAPI INTERFACE rt) endif() endif()