fix clock_gettime check in cmake

This commit is contained in:
Brent Cook 2018-03-23 13:52:12 -05:00
parent 6b513a1c78
commit 862cd768b7

View File

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