Fix generated files in build, so they don't have to exist when the build starts.
Some checks failed
Dropshell Test / Build_and_Test (push) Has been cancelled

This commit is contained in:
j842 2025-05-19 11:24:42 +12:00
parent 7c1b51a93c
commit 625de98890
2 changed files with 15 additions and 0 deletions

View File

@ -48,6 +48,19 @@ add_custom_target(run_createagent ALL
add_executable(dropshell ${SOURCES}) add_executable(dropshell ${SOURCES})
add_dependencies(dropshell run_createagent) add_dependencies(dropshell run_createagent)
# Mark the generated files as GENERATED so CMake knows they'll be created during build
set_source_files_properties(
${CMAKE_CURRENT_SOURCE_DIR}/src/autogen/_agent-remote.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/autogen/_agent-local.cpp
PROPERTIES GENERATED TRUE
)
# Explicitly add the generated agent files, as they might not be in the source directory when globbed at the start.
target_sources(dropshell PRIVATE
${CMAKE_CURRENT_SOURCE_DIR}/src/autogen/_agent-remote.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/autogen/_agent-local.cpp
)
# Set include directories # Set include directories
# build dir goes first so that we can use the generated version.hpp # build dir goes first so that we can use the generated version.hpp
target_include_directories(dropshell PRIVATE target_include_directories(dropshell PRIVATE

View File

@ -14,5 +14,7 @@ if ! command -v dehydrate &> /dev/null; then
curl -fsSL https://gitea.jde.nz/public/dehydrate/releases/download/latest/install.sh | bash curl -fsSL https://gitea.jde.nz/public/dehydrate/releases/download/latest/install.sh | bash
fi fi
mkdir -p "${SCRIPT_DIR}/src/autogen"
dehydrate "${SCRIPT_DIR}/agent-remote" "${SCRIPT_DIR}/src/autogen" dehydrate "${SCRIPT_DIR}/agent-remote" "${SCRIPT_DIR}/src/autogen"
dehydrate "${SCRIPT_DIR}/agent-local" "${SCRIPT_DIR}/src/autogen" dehydrate "${SCRIPT_DIR}/agent-local" "${SCRIPT_DIR}/src/autogen"