file(GLOB sources "src/*.cpp" "src/*.hpp" "src/*.h")
# Remove "app" sources from list
list(REMOVE_ITEM sources
    "${CMAKE_CURRENT_SOURCE_DIR}/src/cadical.cpp"
    "${CMAKE_CURRENT_SOURCE_DIR}/src/mobical.cpp"
)

add_library(cadical ${sources})

# Pass -DNBUILD to disable including the version information, which is not
# needed since cbmc doesn't run the cadical binary
target_compile_options(cadical PRIVATE -DNBUILD -DNFLEXIBLE -DNDEBUG)

set_target_properties(
    cadical
    PROPERTIES
    CXX_STANDARD 17
    CXX_STANDARD_REQUIRED true
    CXX_EXTENSIONS OFF
    XCODE_ATTRIBUTE_CODE_SIGN_IDENTITY "Developer ID Application: Daniel Kroening"
)

target_include_directories(cadical
    PUBLIC
    ${CMAKE_CURRENT_SOURCE_DIR}/src
)

target_link_libraries(cadical util)
