From 640a07690826d4bbd87398949091b94b32e35c7a Mon Sep 17 00:00:00 2001 From: Mathias Preiner Date: Thu, 15 Apr 2021 14:45:54 -0700 Subject: Build support library from base and context. (#6368) This PR creates a support library from the utilities in base and context, which will be required in the parser as soon as we move the symbol table/manager to the parser. Note: I decided to always build static libraries from base and context (and optionally enable -fPIC for shared builds) since I'm not sure if we want to have these libraries installed separately. Right now these are considered as cvc5 internal utilities that can be used in all cvc5 libraries, but not outside. --- src/base/CMakeLists.txt | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) (limited to 'src/base') diff --git a/src/base/CMakeLists.txt b/src/base/CMakeLists.txt index 4b3e41ff9..684660f78 100644 --- a/src/base/CMakeLists.txt +++ b/src/base/CMakeLists.txt @@ -23,7 +23,7 @@ add_custom_target(gen-gitinfo #-----------------------------------------------------------------------------# -libcvc4_add_sources( +set(LIBBASE_SOURCES check.cpp check.h configuration.cpp @@ -36,9 +36,12 @@ libcvc4_add_sources( modal_exception.h output.cpp output.h + ${CMAKE_CURRENT_BINARY_DIR}/git_versioninfo.cpp +) +set_source_files_properties( + ${CMAKE_CURRENT_BINARY_DIR}/git_versioninfo.cpp + PROPERTIES GENERATED TRUE ) - -libcvc4_add_sources(GENERATED git_versioninfo.cpp) #-----------------------------------------------------------------------------# # Generate code for debug/trace tags @@ -75,3 +78,9 @@ set_source_files_properties( ${CMAKE_CURRENT_BINARY_DIR}/Trace_tags.h PROPERTIES GENERATED TRUE ) + +add_library(cvc4base STATIC ${LIBBASE_SOURCES}) +if(ENABLE_SHARED) + set_target_properties(cvc4base PROPERTIES POSITION_INDEPENDENT_CODE ON) +endif() +target_compile_definitions(cvc4base PRIVATE -D__BUILDING_CVC4LIB) -- cgit v1.2.3