diff options
author | Mathias Preiner <mathias.preiner@gmail.com> | 2018-09-21 16:27:26 -0700 |
---|---|---|
committer | Mathias Preiner <mathias.preiner@gmail.com> | 2018-09-22 16:30:59 -0700 |
commit | b2a89b4488d6665ba23c7cb3108ad4cb8c35f4dc (patch) | |
tree | 82b356597e1ac7626aacd1a0596cbd9b6882976c /cmake | |
parent | 3b433d829ccfc0d91cb98f368a8896f5ccad1671 (diff) |
cmake: Build fully static binaries with option --static.
Diffstat (limited to 'cmake')
-rw-r--r-- | cmake/FindABC.cmake | 3 | ||||
-rw-r--r-- | cmake/FindANTLR.cmake | 3 | ||||
-rw-r--r-- | cmake/FindCLN.cmake | 3 | ||||
-rw-r--r-- | cmake/FindCaDiCaL.cmake | 3 | ||||
-rw-r--r-- | cmake/FindCryptoMiniSat.cmake | 3 | ||||
-rw-r--r-- | cmake/FindGLPK.cmake | 3 | ||||
-rw-r--r-- | cmake/FindGMP.cmake | 3 | ||||
-rw-r--r-- | cmake/FindLFSC.cmake | 3 | ||||
-rw-r--r-- | cmake/FindReadline.cmake | 40 | ||||
-rw-r--r-- | cmake/Helpers.cmake | 15 |
10 files changed, 61 insertions, 18 deletions
diff --git a/cmake/FindABC.cmake b/cmake/FindABC.cmake index 0a9cea950..c44019739 100644 --- a/cmake/FindABC.cmake +++ b/cmake/FindABC.cmake @@ -36,3 +36,6 @@ find_package_handle_standard_args(ABC ABC_INCLUDE_DIR ABC_LIBRARIES ABC_ARCH_FLAGS) mark_as_advanced(ABC_INCLUDE_DIR ABC_LIBRARIES ABC_ARCH_FLAGS) +if(ABC_LIBRARIES) + message(STATUS "Found ABC libs: ${ABC_LIBRARIES}") +endif() diff --git a/cmake/FindANTLR.cmake b/cmake/FindANTLR.cmake index 135668006..5f574247b 100644 --- a/cmake/FindANTLR.cmake +++ b/cmake/FindANTLR.cmake @@ -48,3 +48,6 @@ find_package_handle_standard_args( mark_as_advanced(ANTLR_BINARY ANTLR_INCLUDE_DIR ANTLR_LIBRARIES HAVE_ANTLR3_FILE_STREAM_NEW) +if(ANTLR_LIBRARIES) + message(STATUS "Found ANTLR libs: ${ANTLR_LIBRARIES}") +endif() diff --git a/cmake/FindCLN.cmake b/cmake/FindCLN.cmake index 2cb33eb7e..7b2e6f0f4 100644 --- a/cmake/FindCLN.cmake +++ b/cmake/FindCLN.cmake @@ -25,3 +25,6 @@ if(CLN_INCLUDE_DIR) VERSION_VAR CLN_VERSION) mark_as_advanced(CLN_INCLUDE_DIR CLN_LIBRARIES) endif() +if(CLN_LIBRARIES) + message(STATUS "Found CLN libs: ${CLN_LIBRARIES}") +endif() diff --git a/cmake/FindCaDiCaL.cmake b/cmake/FindCaDiCaL.cmake index 2976bb2bb..bd7de319a 100644 --- a/cmake/FindCaDiCaL.cmake +++ b/cmake/FindCaDiCaL.cmake @@ -32,3 +32,6 @@ find_package_handle_standard_args(CaDiCaL CaDiCaL_INCLUDE_DIR CaDiCaL_LIBRARIES) mark_as_advanced(CaDiCaL_INCLUDE_DIR CaDiCaL_LIBRARIES) +if(CaDiCaL_LIBRARIES) + message(STATUS "Found CaDiCaL libs: ${CaDiCaL_LIBRARIES}") +endif() diff --git a/cmake/FindCryptoMiniSat.cmake b/cmake/FindCryptoMiniSat.cmake index aecd92226..7806b242d 100644 --- a/cmake/FindCryptoMiniSat.cmake +++ b/cmake/FindCryptoMiniSat.cmake @@ -32,3 +32,6 @@ find_package_handle_standard_args(CryptoMiniSat CryptoMiniSat_INCLUDE_DIR CryptoMiniSat_LIBRARIES) mark_as_advanced(CryptoMiniSat_INCLUDE_DIR CryptoMiniSat_LIBRARIES) +if(CryptoMiniSat_LIBRARIES) + message(STATUS "Found CryptoMiniSat libs: ${CryptoMiniSat_LIBRARIES}") +endif() diff --git a/cmake/FindGLPK.cmake b/cmake/FindGLPK.cmake index e2b07faff..1587ca821 100644 --- a/cmake/FindGLPK.cmake +++ b/cmake/FindGLPK.cmake @@ -44,3 +44,6 @@ find_package_handle_standard_args(GLPK GLPK_INCLUDE_DIR GLPK_LIBRARIES) mark_as_advanced(GLPK_INCLUDE_DIR GLPK_LIBRARIES) +if(GLPK_LIBRARIES) + message(STATUS "Found GLPK libs: ${GLPK_LIBRARIES}") +endif() diff --git a/cmake/FindGMP.cmake b/cmake/FindGMP.cmake index a835e2d5e..8125a583b 100644 --- a/cmake/FindGMP.cmake +++ b/cmake/FindGMP.cmake @@ -30,3 +30,6 @@ include(FindPackageHandleStandardArgs) find_package_handle_standard_args(GMP DEFAULT_MSG GMP_INCLUDE_DIR GMP_LIBRARIES) mark_as_advanced(GMP_INCLUDE_DIR GMP_LIBRARIES) +if(GMP_LIBRARIES) + message(STATUS "Found GMP libs: ${GMP_LIBRARIES}") +endif() diff --git a/cmake/FindLFSC.cmake b/cmake/FindLFSC.cmake index 2e3118669..7a666839b 100644 --- a/cmake/FindLFSC.cmake +++ b/cmake/FindLFSC.cmake @@ -32,3 +32,6 @@ find_package_handle_standard_args(LFSC LFSC_INCLUDE_DIR LFSC_LIBRARIES) mark_as_advanced(LFSC_INCLUDE_DIR LFSC_LIBRARIES) +if(LFSC_LIBRARIES) + message(STATUS "Found LFSC libs: ${LFSC_LIBRARIES}") +endif() diff --git a/cmake/FindReadline.cmake b/cmake/FindReadline.cmake index 16dd72236..edac03027 100644 --- a/cmake/FindReadline.cmake +++ b/cmake/FindReadline.cmake @@ -8,12 +8,43 @@ find_path(Readline_INCLUDE_DIR NAMES readline/readline.h) find_library(Readline_LIBRARIES NAMES readline) -# Check which standard of readline is installed on the system. -# https://github.com/CVC4/CVC4/issues/702 +# Try to compile and link a simple program against readline. 'libs' can be +# used to specify additional required libraries. +function(try_compile_readline libs _result) + set(CMAKE_REQUIRED_QUIET TRUE) + set(CMAKE_REQUIRED_LIBRARIES ${Readline_LIBRARIES} ${libs}) + check_cxx_source_compiles( + " + #include <stdio.h> + #include <readline/readline.h> + int main() { readline(\"\"); return 0; } + " + ${_result} + ) + set(${_result} ${${_result}} PARENT_SCOPE) +endfunction() + if(Readline_INCLUDE_DIR) + # We only need to figure out readline's additional libraries dependencies if + # we compile static. + # Note: It might be the case that we need to check for more/other libraries + # depending on what the installed version of readline is linked against + # (e.g., termcap, ncurses, ...). + find_library(TINFO_LIBRARY tinfo) + try_compile_readline(${TINFO_LIBRARY} OK) + if(OK) + list(APPEND Readline_LIBRARIES ${TINFO_LIBRARY}) + else() + message(FATAL_ERROR + "Could not link against readline. " + "Check CMakeError.log for more details") + endif() + + # Check which standard of readline is installed on the system. + # https://github.com/CVC4/CVC4/issues/702 include(CheckCXXSourceCompiles) set(CMAKE_REQUIRED_QUIET TRUE) - set(CMAKE_REQUIRED_LIBRARIES readline) + set(CMAKE_REQUIRED_LIBRARIES ${Readline_LIBRARIES}) check_cxx_source_compiles( "#include <stdio.h> #include <readline/readline.h> @@ -33,3 +64,6 @@ mark_as_advanced( Readline_LIBRARIES Readline_COMPENTRY_FUNC_RETURNS_CHARPTR ) +if(Readline_LIBRARIES) + message(STATUS "Found Readline libs: ${Readline_LIBRARIES}") +endif() diff --git a/cmake/Helpers.cmake b/cmake/Helpers.cmake index ec7216452..692e32900 100644 --- a/cmake/Helpers.cmake +++ b/cmake/Helpers.cmake @@ -120,21 +120,6 @@ macro(print_config str var) endmacro() -#-----------------------------------------------------------------------------# -# libcvc4 helper macros - -# Collect all libraries that must be linked against libcvc4. These will be -# actually linked in src/CMakeLists.txt with target_link_libaries(...). -macro(libcvc4_link_libraries library) - set(LIBCVC4_LIBRARIES ${LIBCVC4_LIBRARIES} ${library}) -endmacro() - -# Collect all include directories that are required for libcvc4. These will be -# actually included in src/CMakeLists.txt with target_include_directories(...). -macro(libcvc4_include_directories dirs) - set(LIBCVC4_INCLUDES ${LIBCVC4_INCLUDES} ${dirs}) -endmacro() - # Collect all source files that are required to build libcvc4 in LIBCVC4_SRCS # or LIBCVC4_GEN_SRCS. If GENERATED is the first argument the sources are # added to LIBCVC4_GEN_SRCS. All sources are prepended with the absolute |