From 862cd768b7fd81bcbe13fd49109932309e107856 Mon Sep 17 00:00:00 2001 From: Brent Cook Date: Fri, 23 Mar 2018 13:52:12 -0500 Subject: fix clock_gettime check in cmake --- CMakeLists.txt | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 37ef9c9..03c87a4 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -283,11 +283,14 @@ endif() if(WIN32) set(OPENSSL_LIBS ${OPENSSL_LIBS} ws2_32) endif() -check_library_exists(rt clock_gettime "time.h" HAVE_CLOCK_GETTIME) -if (HAVE_CLOCK_GETTIME) + +check_function_exists(clock_gettime HAVE_CLOCK_GETTIME) +if(HAVE_CLOCK_GETTIME) add_definitions(-DHAVE_CLOCK_GETTIME) endif() + if(CMAKE_SYSTEM_NAME MATCHES "Linux") + check_library_exists(rt clock_gettime "time.h" HAVE_CLOCK_GETTIME) if (HAVE_CLOCK_GETTIME) set(OPENSSL_LIBS ${OPENSSL_LIBS} rt) endif() -- cgit v1.2.3-55-g6feb