From: Aina Niemetz Date: Sat, 11 Aug 2018 00:57:15 +0000 (-0700) Subject: cmake: Generate trace and debug tags X-Git-Tag: cvc5-1.0.0~4621 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=0151fba9d31cf4cb71bfbf472295a5668bdb9013;p=cvc5.git cmake: Generate trace and debug tags --- diff --git a/CMakeLists.txt b/CMakeLists.txt index 187f06949..87b281fe1 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -145,6 +145,7 @@ configure_file( #-----------------------------------------------------------------------------# +add_subdirectory(src/base) add_subdirectory(src/expr) add_subdirectory(src/options) add_subdirectory(src/theory) diff --git a/src/base/CMakeLists.txt b/src/base/CMakeLists.txt index e69de29bb..cf4e554cc 100644 --- a/src/base/CMakeLists.txt +++ b/src/base/CMakeLists.txt @@ -0,0 +1,72 @@ +set(mktags_script ${CMAKE_CURRENT_LIST_DIR}/mktags) +set(mktagheaders_script ${CMAKE_CURRENT_LIST_DIR}/mktagheaders) +file(GLOB_RECURSE source_files ${PROJECT_SOURCE_DIR}/src/*.cpp ${PROJECT_SOURCE_DIR}/src/*.cc ${PROJECT_SOURCE_DIR}/src/*.h ${PROJECT_SOURCE_DIR}/src/*.g) +string(REPLACE ";" " " source_files_list "${source_files}") + +add_custom_target( + debug_tags_tmp + COMMAND + ${mktags_script} + "Debug" + ${source_files_list} + > ${CMAKE_CURRENT_BINARY_DIR}/Debug_tags.tmp + DEPENDS mktags +) + +add_custom_target( + trace_tags_tmp + COMMAND + ${mktags_script} + "Trace" + ${source_files_list} + > ${CMAKE_CURRENT_BINARY_DIR}/Trace_tags.tmp + DEPENDS mktags +) + +add_custom_target( + debug_tags + COMMAND + diff -q + ${CMAKE_CURRENT_BINARY_DIR}/Debug_tags.tmp + ${CMAKE_CURRENT_BINARY_DIR}/Debug_tags + &> /dev/null + || mv + ${CMAKE_CURRENT_BINARY_DIR}/Debug_tags.tmp + ${CMAKE_CURRENT_BINARY_DIR}/Debug_tags + || true + DEPENDS debug_tags_tmp +) + +add_custom_target( + trace_tags + COMMAND + diff -q + ${CMAKE_CURRENT_BINARY_DIR}/Trace_tags.tmp + ${CMAKE_CURRENT_BINARY_DIR}/Trace_tags + &> /dev/null + || mv + ${CMAKE_CURRENT_BINARY_DIR}/Trace_tags.tmp + ${CMAKE_CURRENT_BINARY_DIR}/Trace_tags + || true + DEPENDS trace_tags_tmp +) + +add_custom_target( + debug_tags.h + COMMAND + ${mktagheaders_script} + "Debug_tags" + ${CMAKE_CURRENT_BINARY_DIR}/Debug_tags + > ${CMAKE_CURRENT_BINARY_DIR}/Debug_tags.h + DEPENDS debug_tags +) + +add_custom_target( + trace_tags.h + COMMAND + ${mktagheaders_script} + "Trace_tags" + ${CMAKE_CURRENT_BINARY_DIR}/Trace_tags + > ${CMAKE_CURRENT_BINARY_DIR}/Trace_tags.h + DEPENDS trace_tags +)