diff options
author | Brent Cook <busterb@gmail.com> | 2018-03-23 13:52:12 -0500 |
---|---|---|
committer | Brent Cook <busterb@gmail.com> | 2018-03-23 13:52:12 -0500 |
commit | 862cd768b7fd81bcbe13fd49109932309e107856 (patch) | |
tree | 6b6af86cac294be9be2537eae9d7248748dc6257 | |
parent | 6b513a1c78b8a8c4c48b9ef476628728974f3171 (diff) | |
download | portable-862cd768b7fd81bcbe13fd49109932309e107856.tar.gz portable-862cd768b7fd81bcbe13fd49109932309e107856.tar.bz2 portable-862cd768b7fd81bcbe13fd49109932309e107856.zip |
fix clock_gettime check in cmake
-rw-r--r-- | CMakeLists.txt | 7 |
1 files 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() | |||
283 | if(WIN32) | 283 | if(WIN32) |
284 | set(OPENSSL_LIBS ${OPENSSL_LIBS} ws2_32) | 284 | set(OPENSSL_LIBS ${OPENSSL_LIBS} ws2_32) |
285 | endif() | 285 | endif() |
286 | check_library_exists(rt clock_gettime "time.h" HAVE_CLOCK_GETTIME) | 286 | |
287 | if (HAVE_CLOCK_GETTIME) | 287 | check_function_exists(clock_gettime HAVE_CLOCK_GETTIME) |
288 | if(HAVE_CLOCK_GETTIME) | ||
288 | add_definitions(-DHAVE_CLOCK_GETTIME) | 289 | add_definitions(-DHAVE_CLOCK_GETTIME) |
289 | endif() | 290 | endif() |
291 | |||
290 | if(CMAKE_SYSTEM_NAME MATCHES "Linux") | 292 | if(CMAKE_SYSTEM_NAME MATCHES "Linux") |
293 | check_library_exists(rt clock_gettime "time.h" HAVE_CLOCK_GETTIME) | ||
291 | if (HAVE_CLOCK_GETTIME) | 294 | if (HAVE_CLOCK_GETTIME) |
292 | set(OPENSSL_LIBS ${OPENSSL_LIBS} rt) | 295 | set(OPENSSL_LIBS ${OPENSSL_LIBS} rt) |
293 | endif() | 296 | endif() |