Use different variable for second attempt at finding clock_gettime

This change allowed building on an ancient RH machine without breaking modern ones.
This commit is contained in:
Erik Boasson 2019-01-18 14:18:44 +01:00
parent cef4a51810
commit 58e91c4304

View file

@ -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()