From 03c2724cef26fa20862634e25e3adc476d049db4 Mon Sep 17 00:00:00 2001 From: Mathias Preiner Date: Thu, 15 Apr 2021 23:55:25 -0700 Subject: [PATCH] cmake: Build object libraries for base and context. (#6374) cmake complains that the static base and context libraries are not exported as install targets. Since we do not want to install these libraries we'll build object libraries instead. --- src/CMakeLists.txt | 12 ++---------- src/base/CMakeLists.txt | 2 +- src/context/CMakeLists.txt | 2 +- 3 files changed, 4 insertions(+), 12 deletions(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index e060ae43f..81105e817 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -1091,26 +1091,18 @@ endif() add_subdirectory(theory) add_subdirectory(util) -#-----------------------------------------------------------------------------# -# Build support library from base and context that can be used in the main -# library as well as the parser library. - -add_library(cvc4support INTERFACE) -target_link_libraries(cvc4support INTERFACE cvc4base) -target_link_libraries(cvc4support INTERFACE cvc4context) - #-----------------------------------------------------------------------------# # All sources for libcvc4 are now collected in LIBCVC4_SRCS and (if generated) # LIBCVC4_GEN_SRCS (via libcvc4_add_sources). We can now build libcvc4. set_source_files_properties(${LIBCVC4_GEN_SRCS} PROPERTIES GENERATED TRUE) -add_library(cvc4 ${LIBCVC4_SRCS} ${LIBCVC4_GEN_SRCS}) +add_library(cvc4 ${LIBCVC4_SRCS} ${LIBCVC4_GEN_SRCS} + $ $) target_include_directories(cvc4 PUBLIC $ $ ) -target_link_libraries(cvc4 PRIVATE cvc4support) include(GenerateExportHeader) generate_export_header(cvc4) diff --git a/src/base/CMakeLists.txt b/src/base/CMakeLists.txt index 684660f78..5da1216d0 100644 --- a/src/base/CMakeLists.txt +++ b/src/base/CMakeLists.txt @@ -79,7 +79,7 @@ set_source_files_properties( PROPERTIES GENERATED TRUE ) -add_library(cvc4base STATIC ${LIBBASE_SOURCES}) +add_library(cvc4base OBJECT ${LIBBASE_SOURCES}) if(ENABLE_SHARED) set_target_properties(cvc4base PROPERTIES POSITION_INDEPENDENT_CODE ON) endif() diff --git a/src/context/CMakeLists.txt b/src/context/CMakeLists.txt index 8800f1a23..fb1d25111 100644 --- a/src/context/CMakeLists.txt +++ b/src/context/CMakeLists.txt @@ -34,7 +34,7 @@ set(LIBCONTEXT_SOURCES context_mm.h ) -add_library(cvc4context STATIC ${LIBCONTEXT_SOURCES}) +add_library(cvc4context OBJECT ${LIBCONTEXT_SOURCES}) if(ENABLE_SHARED) set_target_properties(cvc4context PROPERTIES POSITION_INDEPENDENT_CODE ON) endif() -- 2.30.2