Skip to content

Commit

Permalink
Add BUILD_TOOLS option for building only libraries required by boolec…
Browse files Browse the repository at this point in the history
…tor. (#19)

Signed-off-by: William D. Jones <[email protected]>
  • Loading branch information
cr1901 authored Mar 6, 2024
1 parent 037f1fa commit 14065fa
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 19 deletions.
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ include(GNUInstallDirs)

option(ASAN "Compile with ASAN support" OFF)
option(BUILD_BTOR2AIGER "Build btor2aiger binary" OFF)
option(BUILD_TOOLS "Build btorsim, catbtor, btorsplit binaries" OFF)
option(CHECK "Enable assertions for optimized builds" OFF)
option(BUILD_SHARED_LIBS "Build as shared library" ON)

Expand Down
40 changes: 21 additions & 19 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,23 +10,28 @@ install(
PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
)

add_executable(btorsim
btorsim/btorsimam.cpp
btorsim/btorsimstate.cpp
btorsim/btorsimvcd.cpp
btorsim/btorsimhelpers.cpp
btorsim/btorsim.cpp
btorsim/btorsimbv.c
btorsim/btorsimrng.c
)
target_include_directories(btorsim PRIVATE .)
target_link_libraries(btorsim btor2parser)
target_compile_options(btorsim PRIVATE -Wall -Wfatal-errors)
install(TARGETS btorsim DESTINATION ${CMAKE_INSTALL_BINDIR})
if (BUILD_TOOLS)
add_executable(btorsim
btorsim/btorsimam.cpp
btorsim/btorsimstate.cpp
btorsim/btorsimvcd.cpp
btorsim/btorsimhelpers.cpp
btorsim/btorsim.cpp
btorsim/btorsimbv.c
btorsim/btorsimrng.c
)
target_include_directories(btorsim PRIVATE .)
target_link_libraries(btorsim btor2parser)
target_compile_options(btorsim PRIVATE -Wall -Wfatal-errors)
install(TARGETS btorsim DESTINATION ${CMAKE_INSTALL_BINDIR})

add_executable(catbtor catbtor.c)
target_link_libraries(catbtor btor2parser)
install(TARGETS catbtor DESTINATION ${CMAKE_INSTALL_BINDIR})
add_executable(catbtor catbtor.c)
target_link_libraries(catbtor btor2parser)
install(TARGETS catbtor DESTINATION ${CMAKE_INSTALL_BINDIR})

add_executable(btorsplit btorsplit.cpp)
install(TARGETS btorsplit DESTINATION ${CMAKE_INSTALL_BINDIR})
endif()

if(BUILD_BTOR2AIGER)
add_executable(btor2aiger
Expand All @@ -38,6 +43,3 @@ if(BUILD_BTOR2AIGER)
target_link_libraries(btor2aiger btor2parser Boolector::boolector)
install(TARGETS btor2aiger DESTINATION ${CMAKE_INSTALL_BINDIR})
endif()

add_executable(btorsplit btorsplit.cpp)
install(TARGETS btorsplit DESTINATION ${CMAKE_INSTALL_BINDIR})

0 comments on commit 14065fa

Please sign in to comment.