This commit is contained in:
khodowany
2026-10-04 21:15:21 -05:00
parent c6b4ba1b43
commit 2759337d16
33 changed files with 10510 additions and 137 deletions
+14 -7
View File
@@ -8,25 +8,32 @@ set(CMAKE_CXX_STANDARD 23)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)
find_package(modulus CONFIG REQUIRED COMPONENTS boost_json openssl)
find_package(modulus CONFIG REQUIRED COMPONENTS boost_json openssl sqlite)
find_package(ligo CONFIG REQUIRED)
find_package(noto CONFIG REQUIRED)
find_package(Threads REQUIRED)
add_library(fpol_core src/domain.cpp src/store.cpp)
target_link_libraries(fpol_core PUBLIC modulus::modulus modulus::boost_json noto::noto Threads::Threads)
add_executable(fpol_admin src/admin.cpp)
target_link_libraries(fpol_admin PRIVATE fpol_core)
add_executable(fpol_server src/main.cpp src/server.cpp)
target_link_libraries(fpol_server PRIVATE modulus::modulus ligo::ligo Threads::Threads)
target_compile_options(fpol_server PRIVATE $<$<CXX_COMPILER_ID:GNU,Clang>:-Wall;-Wextra;-Wpedantic>)
target_link_libraries(fpol_server PRIVATE fpol_core ligo::ligo)
foreach(target fpol_core fpol_admin fpol_server)
target_compile_options(${target} PRIVATE $<$<CXX_COMPILER_ID:GNU,Clang>:-Wall;-Wextra;-Wpedantic>)
endforeach()
if(BUILD_TESTING)
find_package(Python3 REQUIRED COMPONENTS Interpreter)
add_test(NAME product_fpol
COMMAND ${Python3_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/tests/test_server.py $<TARGET_FILE:fpol_server>
COMMAND ${Python3_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/tests/test_all.py $<TARGET_FILE:fpol_admin> $<TARGET_FILE:fpol_server>
)
set_tests_properties(product_fpol PROPERTIES TIMEOUT 60)
set_tests_properties(product_fpol PROPERTIES TIMEOUT 180)
add_custom_target(check
COMMAND ${CMAKE_CTEST_COMMAND} --test-dir ${CMAKE_BINARY_DIR} -R ^product_fpol$ --output-on-failure
DEPENDS fpol_server
DEPENDS fpol_admin fpol_server
USES_TERMINAL
)
endif()
install(TARGETS fpol_server RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
install(TARGETS fpol_server fpol_admin RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})