Skip to content

Commit b59cc16

Browse files
committed
Fix cmake build for cadical
1 parent cc157aa commit b59cc16

File tree

2 files changed

+11
-8
lines changed

2 files changed

+11
-8
lines changed

scripts/cadical_CMakeLists.txt

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,16 @@
11
file(GLOB sources "src/*.cpp" "src/*.hpp" "src/*.h")
22
# Remove "app" sources from list
3-
list(REMOVE_ITEM sources "src/cadical.cpp" "src/mobical.cpp")
3+
list(REMOVE_ITEM sources
4+
"${CMAKE_CURRENT_SOURCE_DIR}/src/cadical.cpp"
5+
"${CMAKE_CURRENT_SOURCE_DIR}/src/mobical.cpp"
6+
)
7+
48
add_library(cadical ${sources})
59

10+
# Pass -DNBUILD to disable including the version information, which is not
11+
# needed since cbmc doesn't run the cadical binary
12+
target_compile_options(cadical PUBLIC -DNBUILD)
13+
614
set_target_properties(
715
cadical
816
PROPERTIES

src/solvers/CMakeLists.txt

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -117,17 +117,12 @@ foreach(SOLVER ${sat_impl})
117117
URL_MD5 b44874501a175106424f4bd5de29aa59
118118
)
119119

120+
add_subdirectory(${cadical_SOURCE_DIR} ${cadical_BINARY_DIR})
121+
120122
target_compile_definitions(solvers PUBLIC
121123
SATCHECK_CADICAL HAVE_CADICAL
122124
)
123125

124-
add_library(cadical STATIC IMPORTED)
125-
126-
set_target_properties(
127-
cadical
128-
PROPERTIES IMPORTED_LOCATION ${cadical_SOURCE_DIR}/build/libcadical.a
129-
)
130-
131126
target_include_directories(solvers
132127
PUBLIC
133128
${cadical_SOURCE_DIR}/src

0 commit comments

Comments
 (0)