From 6b370211944a4520876798e4072597092a1a6236 Mon Sep 17 00:00:00 2001 From: Mathias Preiner Date: Wed, 24 Nov 2021 11:29:11 -0800 Subject: [PATCH] cmake: Add option --[no]-static-binary. (#7695) Allows to disable linking against static system libraries explicitly. --- CMakeLists.txt | 7 +++++++ configure.sh | 7 +++++++ src/main/CMakeLists.txt | 2 +- 3 files changed, 15 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index f7ff3bac3..9e70f4c3d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -126,6 +126,10 @@ option(BUILD_BINDINGS_JAVA "Build Java bindings based on new C++ API ") # Api documentation option(BUILD_DOCS "Build Api documentation") +# Link against static system libraries +cvc5_option(STATIC_BINARY "Link against static system libraries \ +(enabled by default for static builds)") + #-----------------------------------------------------------------------------# # Internal cmake variables @@ -443,6 +447,9 @@ if(BUILD_SHARED_LIBS) set(CVC5_STATIC_BUILD OFF) else() set(CVC5_STATIC_BUILD ON) + if(NOT CMAKE_SYSTEM_NAME STREQUAL "Darwin") + cvc5_set_option(STATIC_BINARY ON) + endif() endif() #-----------------------------------------------------------------------------# diff --git a/configure.sh b/configure.sh index 970df2e61..18808f3c6 100755 --- a/configure.sh +++ b/configure.sh @@ -31,6 +31,7 @@ General options; Features: The following flags enable optional features (disable with --no-