Skip to content

Commit

Permalink
changed default behaviour for clock_gettime()
Browse files Browse the repository at this point in the history
CMake now checks first for clock_gettime() in librt, so
we can make use of its capabilities when available.
  • Loading branch information
fmorgner committed Jan 23, 2014
1 parent a0f5855 commit 4104c87
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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 "")
Expand Down

0 comments on commit 4104c87

Please sign in to comment.