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
Some checks failed
Dropshell Test / Build_and_Test (push) Has been cancelled
This commit is contained in:
parent
7c1b51a93c
commit
625de98890
@ -48,6 +48,19 @@ add_custom_target(run_createagent ALL
|
||||
add_executable(dropshell ${SOURCES})
|
||||
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
|
||||
# build dir goes first so that we can use the generated version.hpp
|
||||
target_include_directories(dropshell PRIVATE
|
||||
|
@ -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
|
||||
fi
|
||||
|
||||
mkdir -p "${SCRIPT_DIR}/src/autogen"
|
||||
|
||||
dehydrate "${SCRIPT_DIR}/agent-remote" "${SCRIPT_DIR}/src/autogen"
|
||||
dehydrate "${SCRIPT_DIR}/agent-local" "${SCRIPT_DIR}/src/autogen"
|
||||
|
Loading…
x
Reference in New Issue
Block a user