summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndres Noetzli <andres.noetzli@gmail.com>2019-01-15 19:14:06 -0800
committerGitHub <noreply@github.com>2019-01-15 19:14:06 -0800
commit3018455b424fc61e140be665a813cb6a8fac6320 (patch)
tree183d16696fec6bcadc06823f0cdd1f61fb49fa76
parent4a38be3b9ac133655602a989f1136cd24ed89bc6 (diff)
CMake: Fix search for static libraries (#2798)
When configuring CVC4 with `--static`, we change `CMAKE_FIND_LIBRARY_SUFFIXES` to prefer static libraries (`*.a`) over shared ones. However, instead of prepending `.a` to the list of `CMAKE_FIND_LIBRARY_SUFFIXES`, we created a single element with `.a` and the previous list. Output of `message("${CMAKE_FIND_LIBRARY_SUFFIXES}")` before the change: ``` .a .tbd;.dylib;.so;.a ``` After the change: ``` .a;.tbd;.dylib;.so;.a ``` On macOS, both the static and the shared library of GMP are available (when installed via homebrew) and before the change, CMake would pick the shared library when compiling with `--static --no-static-binary`. This commit fixes that issue.
-rw-r--r--CMakeLists.txt2
1 files changed, 1 insertions, 1 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 33e06840e..9af357790 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -225,7 +225,7 @@ if(ENABLE_SHARED)
message(WARNING "Disabling static binary since shared build is enabled.")
endif()
else()
- set(CMAKE_FIND_LIBRARY_SUFFIXES ".a ${CMAKE_FIND_LIBRARY_SUFFIXES}")
+ set(CMAKE_FIND_LIBRARY_SUFFIXES .a ${CMAKE_FIND_LIBRARY_SUFFIXES})
set(BUILD_SHARED_LIBS OFF)
# This is required to force find_package(Boost) to use static libraries.
set(Boost_USE_STATIC_LIBS ON)
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback