From 58e91c4304888d6979489aabd748fdb5126f1143 Mon Sep 17 00:00:00 2001 From: Erik Boasson Date: Fri, 18 Jan 2019 14:18:44 +0100 Subject: [PATCH] Use different variable for second attempt at finding clock_gettime This change allowed building on an ancient RH machine without breaking modern ones. --- src/os/CMakeLists.txt | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) 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()