From 1ca4a5cc3697d5df15ed18c07531b349625866f8 Mon Sep 17 00:00:00 2001 From: Mathias Preiner Date: Fri, 17 Aug 2018 18:11:26 -0700 Subject: [PATCH] cmake: Add portfolio support. --- CMakeLists.txt | 12 +++++++++++ src/main/CMakeLists.txt | 48 +++++++++++++++++++++++------------------ 2 files changed, 39 insertions(+), 21 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 204e10169..8e5957768 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -138,6 +138,7 @@ cvc4_option(ENABLE_DEBUG_SYMBOLS "Enable debug symbols") cvc4_option(ENABLE_DUMPING "Enable dumpin") cvc4_option(ENABLE_MUZZLE "Enable silencing CVC4; supress ALL non-result output") cvc4_option(ENABLE_OPTIMIZED "Enable optimization") +cvc4_option(ENABLE_PORTFOLIO "Enable portfolio support") cvc4_option(ENABLE_PROOFS "Enable proof support") cvc4_option(ENABLE_REPLAY "Enable the replay feature") cvc4_option(ENABLE_STATISTICS "Enable statistics") @@ -259,6 +260,17 @@ if(ENABLE_MUZZLE) add_definitions(-DCVC4_MUZZLE) endif() +if(ENABLE_PORTFOLIO) + find_package(Boost REQUIRED COMPONENTS thread) + set(USE_CLN OFF) + set(THREADS_PREFER_PTHREAD_FLAG ON) + find_package(Threads REQUIRED) + if(THREADS_HAVE_PTHREAD_ARG) + add_c_cxx_flag(-pthread) + endif() + add_definitions(-DCVC4_PORTFOLIO) +endif() + if(ENABLE_PROFILING) add_definitions(-DCVC4_PROFILING) add_check_c_cxx_flag("-pg") diff --git a/src/main/CMakeLists.txt b/src/main/CMakeLists.txt index 9d69abbcd..23f16ccb7 100644 --- a/src/main/CMakeLists.txt +++ b/src/main/CMakeLists.txt @@ -14,32 +14,38 @@ if(USE_READLINE) target_link_libraries(main ${Readline_LIBRARIES}) target_include_directories(main PRIVATE ${Readline_INCLUDE_DIR}) endif() +add_dependencies(main token-headers) -set(cvc4main_src_files - main.cpp -) - -add_executable(cvc4-main ${cvc4main_src_files}) -target_compile_definitions(cvc4-main PRIVATE -D__BUILDING_CVC4DRIVER) -set_target_properties(cvc4-main +add_executable(cvc4-bin main.cpp) +target_compile_definitions(cvc4-bin PRIVATE -D__BUILDING_CVC4DRIVER) +set_target_properties(cvc4-bin PROPERTIES OUTPUT_NAME cvc4 RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin) -target_link_libraries(cvc4-main main) -add_dependencies(cvc4-main token-headers) +target_link_libraries(cvc4-bin main) -#set(pcvc4_src_files -# main.cpp -# portfolio.cpp -# portfolio.h -# portfolio_util.cpp -# portfolio_util.h -# command_executor.cpp -# command_executor_portfolio.cpp -# command_executor.h -# command_executor_portfolio.h -# driver_unified.cpp -#) +if(ENABLE_PORTFOLIO) + set(pcvc4_src_files + main.cpp + portfolio.cpp + portfolio.h + portfolio_util.cpp + portfolio_util.h + command_executor_portfolio.cpp + command_executor_portfolio.h + ) + + add_executable(pcvc4-bin ${pcvc4_src_files}) + target_compile_definitions(pcvc4-bin PRIVATE -D__BUILDING_CVC4DRIVER) + set_target_properties(pcvc4-bin + PROPERTIES + OUTPUT_NAME pcvc4 + RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin) + target_link_libraries(pcvc4-bin main) + add_dependencies(pcvc4-bin token-headers) + target_link_libraries(pcvc4-bin ${Boost_LIBRARIES}) + target_include_directories(pcvc4-bin PRIVATE ${Boost_INCLUDE_DIRS}) +endif() add_custom_command( OUTPUT cvc_tokens.h -- 2.30.2