summaryrefslogtreecommitdiff
path: root/cmake/ConfigureCVC4.cmake
diff options
context:
space:
mode:
authorMathias Preiner <mathias.preiner@gmail.com>2018-09-18 17:20:25 -0700
committerMathias Preiner <mathias.preiner@gmail.com>2018-09-22 16:30:59 -0700
commited8d326cbdec820d347d8b4b5ee7b23c3367d169 (patch)
treef5cb0da35a74e1e1155849e97fc6c644072c054b /cmake/ConfigureCVC4.cmake
parent4a96ecb64741a78b6e138c75fcd7155058658849 (diff)
cmake: Add support for cross-compiling for Windows.
Diffstat (limited to 'cmake/ConfigureCVC4.cmake')
-rw-r--r--cmake/ConfigureCVC4.cmake13
1 files changed, 12 insertions, 1 deletions
diff --git a/cmake/ConfigureCVC4.cmake b/cmake/ConfigureCVC4.cmake
index 18061c778..f60e9043e 100644
--- a/cmake/ConfigureCVC4.cmake
+++ b/cmake/ConfigureCVC4.cmake
@@ -43,7 +43,18 @@ endif()
check_include_file(unistd.h HAVE_UNISTD_H)
check_include_file_cxx(ext/stdio_filebuf.h HAVE_EXT_STDIO_FILEBUF_H)
-check_symbol_exists(clock_gettime "time.h" HAVE_CLOCK_GETTIME)
+# For Windows builds check if clock_gettime is available via -lpthread
+# (pthread_time.h).
+if(CVC4_WINDOWS_BUILD)
+ set(CMAKE_REQUIRED_FLAGS -pthread)
+ check_symbol_exists(clock_gettime "time.h" HAVE_CLOCK_GETTIME)
+ unset(CMAKE_REQUIRED_FLAGS)
+ if(HAVE_CLOCK_GETTIME)
+ add_c_cxx_flag(-pthread)
+ endif()
+else()
+ check_symbol_exists(clock_gettime "time.h" HAVE_CLOCK_GETTIME)
+endif()
check_symbol_exists(ffs "strings.h" HAVE_FFS)
check_symbol_exists(optreset "getopt.h" HAVE_DECL_OPTRESET)
check_symbol_exists(sigaltstack "signal.h" HAVE_SIGALTSTACK)
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback