Skip to content

Commit

Permalink
Refactor CMake configuration to enable library build and testing, upd…
Browse files Browse the repository at this point in the history
…ating executable and library definitions
  • Loading branch information
riccardodebenedictis committed Dec 31, 2024
1 parent c76ffae commit 77b2817
Showing 1 changed file with 8 additions and 9 deletions.
17 changes: 8 additions & 9 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,11 @@ message(STATUS "Heuristic type: ${HEURISTIC_TYPE}")

add_subdirectory(extern/riddle)

add_executable(oRatioLib test/main.cpp)
# add_library(oRatioLib src/solver.cpp)
# target_compile_features(oRatioLib PUBLIC cxx_std_17)
# add_dependencies(oRatioLib RiDDLe)
# target_link_libraries(oRatioLib PUBLIC RiDDLe)
# target_include_directories(oRatioLib PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>)
add_library(oRatioLib src/solver.cpp)
target_compile_features(oRatioLib PUBLIC cxx_std_17)
add_dependencies(oRatioLib RiDDLe)
target_link_libraries(oRatioLib PUBLIC RiDDLe)
target_include_directories(oRatioLib PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>)

if(${CONSTRAINT_REASONER_TYPE} STREQUAL "Z3")
include(FetchContent)
Expand Down Expand Up @@ -73,9 +72,9 @@ if(BUILD_LISTENERS)
target_compile_definitions(oRatioLib PUBLIC BUILD_LISTENERS)
endif()

# if(BUILD_TESTING)
# add_subdirectory(tests)
# endif()
if(BUILD_TESTING)
add_subdirectory(tests)
endif()

if(MSVC)
target_compile_options(oRatioLib PRIVATE /W4)
Expand Down

0 comments on commit 77b2817

Please sign in to comment.