summaryrefslogtreecommitdiff
path: root/cmake
diff options
context:
space:
mode:
authormakaimann <makaim@stanford.edu>2019-04-15 17:17:29 -0700
committerAndres Noetzli <andres.noetzli@gmail.com>2019-04-15 17:17:29 -0700
commit3df27eab5e9da3bab7853c02bdea6a250623d2a5 (patch)
tree0eb6e80e55ed8e67772b719a32ff7185fcf68aa1 /cmake
parent8db8b76f4ee98e3166ee8bb2e1bad77380060edc (diff)
Check for rt library in configuration -- support for glibc<2.17 (#2854)
This is a minor fix for systems with glibc version < 2.17. In that case, we need to link with `-lrt` according to the clock_gettime man page.
Diffstat (limited to 'cmake')
-rw-r--r--cmake/ConfigureCVC4.cmake6
1 files changed, 6 insertions, 0 deletions
diff --git a/cmake/ConfigureCVC4.cmake b/cmake/ConfigureCVC4.cmake
index 84575d610..67c1f414d 100644
--- a/cmake/ConfigureCVC4.cmake
+++ b/cmake/ConfigureCVC4.cmake
@@ -2,6 +2,7 @@ include(CheckCXXSourceCompiles)
include(CheckIncludeFile)
include(CheckIncludeFileCXX)
include(CheckSymbolExists)
+include(CheckLibraryExists)
# Check whether "long" and "int64_t" are distinct types w.r.t. overloading.
# Even if they have the same size, they can be distinct, and some platforms
@@ -54,6 +55,11 @@ if(CVC4_WINDOWS_BUILD)
endif()
else()
check_symbol_exists(clock_gettime "time.h" HAVE_CLOCK_GETTIME)
+ if(NOT HAVE_CLOCK_GETTIME)
+ unset(HAVE_CLOCK_GETTIME CACHE)
+ check_library_exists(rt clock_gettime "time.h" HAVE_CLOCK_GETTIME)
+ find_library(RT_LIBRARIES NAMES rt)
+ endif()
endif()
check_symbol_exists(ffs "strings.h" HAVE_FFS)
check_symbol_exists(optreset "getopt.h" HAVE_DECL_OPTRESET)
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback