summaryrefslogtreecommitdiff
path: root/cmake
diff options
context:
space:
mode:
authorAndrew V. Jones <andrewvaughanj@gmail.com>2021-08-16 06:31:23 +0100
committerGitHub <noreply@github.com>2021-08-16 05:31:23 +0000
commitba2acc2d22b7718b102bfa7c2a699be5a4d87296 (patch)
tree65475fa2f42935e80f579f65aee6ccb68e577649 /cmake
parentbb0b36445b37c5b7fd22f4b12e590ade4646589e (diff)
Add check for static libraries when compiling CryptoMiniSat #7010 (#7014)
This commit adds a check for CryptoMiniSat's static dependencies when configuring CryptoMiniSat. It changes a build-time failure into a configure-time failure. `find_library` in CMake > 3.18 supports `REQUIRED`; as `cvc5` targets 3.10, I've implemented a check for what `find_library` returns. Signed-off-by: Andrew V. Jones <andrewvaughanj@gmail.com>
Diffstat (limited to 'cmake')
-rw-r--r--cmake/FindCryptoMiniSat.cmake14
1 files changed, 14 insertions, 0 deletions
diff --git a/cmake/FindCryptoMiniSat.cmake b/cmake/FindCryptoMiniSat.cmake
index 5b543aedc..fb4ca2069 100644
--- a/cmake/FindCryptoMiniSat.cmake
+++ b/cmake/FindCryptoMiniSat.cmake
@@ -42,6 +42,20 @@ if(NOT CryptoMiniSat_FOUND_SYSTEM)
check_auto_download("CryptoMiniSat" "--no-cryptominisat")
endif()
+ # Check for static libraries required by CryptoMiniSat
+ set(CMS_STATIC_LIBS "c;m;dl;pthread")
+ foreach(static_lib ${CMS_STATIC_LIBS})
+
+ # We can't use 'REQUIRED' here, as it needs a too-recent CMake
+ find_library(lib${static_lib}_static lib${static_lib}.a)
+
+ # Check if the static library has been found
+ if(NOT lib${static_lib}_static)
+ message(FATAL_ERROR "static lib${static_lib} not found")
+ endif()
+
+ endforeach()
+
include(ExternalProject)
ExternalProject_Add(
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback