Complete M7.2 PostgreSQL adapter and migration bootstrap

This commit is contained in:
dingo
2026-09-28 07:55:18 -04:00
parent 0b9ed18503
commit 60bb492123
24 changed files with 784 additions and 4 deletions
+18
View File
@@ -23,6 +23,7 @@ option(EVO_WARNINGS_AS_ERRORS "Treat owned-code warnings as errors" ON)
option(EVO_ENABLE_TIDY "Run clang-tidy during compilation" OFF)
option(EVO_BUILD_FUZZER "Build the Clang libFuzzer snapshot target" OFF)
option(EVO_BUILD_ECS_EXPERIMENT "Build the isolated EnTT comparison (explicit preparation required)" OFF)
option(EVO_BUILD_POSTGRES "Build the isolated Linux PostgreSQL persistence adapter" OFF)
set(EVO_SANITIZER "none" CACHE STRING "none, address (ASan/UBSan), or thread")
set_property(CACHE EVO_SANITIZER PROPERTY STRINGS none address thread)
include(cmake/ProjectOptions.cmake)
@@ -71,6 +72,23 @@ target_link_libraries(evo-sim PRIVATE evo::simulation evo::processes)
evo_owned_target(evo-sim)
include(CTest)
if(EVO_BUILD_POSTGRES)
if(NOT CMAKE_SYSTEM_NAME STREQUAL "Linux")
message(FATAL_ERROR "The initial PostgreSQL adapter is qualified on Linux only")
endif()
find_package(PostgreSQL 18.6 EXACT REQUIRED)
add_library(evo_postgres STATIC src/persistence/postgres.cpp)
add_library(evo::postgres ALIAS evo_postgres)
target_include_directories(evo_postgres PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}/include")
target_link_libraries(evo_postgres PRIVATE PostgreSQL::PostgreSQL)
evo_owned_target(evo_postgres)
if(BUILD_TESTING)
add_executable(evo-postgres-tests tests/postgres_tests.cpp)
target_link_libraries(evo-postgres-tests PRIVATE evo::postgres)
evo_owned_target(evo-postgres-tests)
# Intentionally not an ordinary CTest: tools/ci/postgres-check.sh owns its private DB.
endif()
endif()
if(BUILD_TESTING)
add_executable(evo-environmental-qualification tests/environmental_qualification.cpp)
target_link_libraries(evo-environmental-qualification PRIVATE evo::processes)