summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/platform/posix/CMakeLists.txt7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/platform/posix/CMakeLists.txt b/src/platform/posix/CMakeLists.txt
index 857c340a..2212c8c8 100644
--- a/src/platform/posix/CMakeLists.txt
+++ b/src/platform/posix/CMakeLists.txt
@@ -29,7 +29,12 @@ if (NNG_PLATFORM_POSIX)
nng_check_func(getrandom NNG_HAVE_GETRANDOM)
nng_check_func(arc4random_buf NNG_HAVE_ARC4RANDOM)
- nng_check_lib(rt clock_gettime NNG_HAVE_CLOCK_GETTIME)
+ nng_check_func(clock_gettime NNG_HAVE_CLOCK_GETTIME_LIBC)
+ if (NNG_HAVE_CLOCK_GETTIME_LIBC)
+ nng_defines_if(NNG_HAVE_CLOCK_GETTIME_LIBC NNG_HAVE_CLOCK_GETTIME)
+ else()
+ nng_check_lib(rt clock_gettime NNG_HAVE_CLOCK_GETTIME)
+ endif()
nng_check_lib(pthread sem_wait NNG_HAVE_SEMAPHORE_PTHREAD)
nng_check_lib(pthread pthread_atfork NNG_HAVE_PTHREAD_ATFORK_PTHREAD)
nng_check_lib(pthread pthread_set_name_np NNG_HAVE_PTHREAD_SET_NAME_NP)