From: Felix Morgner Date: Thu, 23 Jan 2014 15:03:10 +0000 (+0100) Subject: changed default behaviour for clock_gettime() X-Git-Url: http://git.code-monkey.de/?a=commitdiff_plain;h=4104c875c929e8c071b4436003c43d81f9e8e896;hp=a0f585591388e8245bd14f4d37ef7b667f036672;p=umurmur.git changed default behaviour for clock_gettime() CMake now checks first for clock_gettime() in librt, so we can make use of its capabilities when available. --- diff --git a/CMakeLists.txt b/CMakeLists.txt index 7c5809e..6e81c3c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -36,18 +36,18 @@ else(SSL MATCHES "openssl") endif(POLARSSL_FOUND) endif(SSL MATCHES "openssl") -check_function_exists(clock_gettime HAVE_CLOCK_GETTIME) +check_library_exists(rt clock_gettime "time.h" HAVE_CLOCK_GETTIME_RT) -if(NOT HAVE_CLOCK_GETTIME) - check_library_exists(rt clock_gettime "time.h" HAVE_CLOCK_GETTIME_RT) - if(NOT HAVE_CLOCK_GETTIME_RT) +if(NOT HAVE_CLOCK_GETTIME_RT) + check_function_exists(clock_gettime HAVE_CLOCK_GETTIME) + if(NOT HAVE_CLOCK_GETTIME) check_library_exists(c clock_get_time "mach/time.h" HAVE_CLOCK_GET_TIME) if(NOT HAVE_CLOCK_GET_TIME) message(FATAL_ERROR "Didn't find clock_gettime() or clock_get_time!") endif() - else() - set(LIBRT rt) endif() +else() + set(LIBRT rt) endif() set(SOURCE "")