docs: Update 7 files
All checks were successful
Build-Test-Publish / build (linux/amd64) (push) Successful in 39s
Build-Test-Publish / build (linux/arm64) (push) Successful in 3m35s

This commit is contained in:
j
2025-12-30 10:23:08 +13:00
parent c31f08269b
commit 80450aadcc
7 changed files with 54 additions and 20 deletions

View File

@@ -46,28 +46,45 @@ set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_CURRENT_SOURCE_DIR}/cmake)
file(GLOB_RECURSE SOURCES "src/*.cpp")
file(GLOB_RECURSE HEADERS "src/*.hpp")
# Add custom target to run cmake_prebuild.sh at the start of the build process
add_custom_target(run_prebuild_script ALL
# Define the generated output files
set(AGENT_REMOTE_CPP ${CMAKE_CURRENT_SOURCE_DIR}/src/autogen/_agent-remote.cpp)
set(AGENT_LOCAL_CPP ${CMAKE_CURRENT_SOURCE_DIR}/src/autogen/_agent-local.cpp)
# Get list of input files that trigger regeneration
file(GLOB AGENT_REMOTE_FILES "${CMAKE_CURRENT_SOURCE_DIR}/agent-remote/*")
file(GLOB AGENT_LOCAL_FILES "${CMAKE_CURRENT_SOURCE_DIR}/agent-local/*")
# Custom command with proper dependency tracking
# Runs cmake_prebuild.sh only when input files change or outputs are missing
add_custom_command(
OUTPUT ${AGENT_REMOTE_CPP} ${AGENT_LOCAL_CPP}
COMMAND ${CMAKE_COMMAND} -E echo "Running cmake_prebuild.sh..."
COMMAND ${CMAKE_COMMAND} -E env bash ${CMAKE_CURRENT_SOURCE_DIR}/cmake_prebuild.sh
COMMAND bash ${CMAKE_CURRENT_SOURCE_DIR}/cmake_prebuild.sh
DEPENDS
${AGENT_REMOTE_FILES}
${AGENT_LOCAL_FILES}
${CMAKE_CURRENT_SOURCE_DIR}/cmake_prebuild.sh
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
COMMENT "Generating agent source files from agent-remote/ and agent-local/"
)
# Custom target for manual invocation (e.g., "ninja run_prebuild_script")
add_custom_target(run_prebuild_script DEPENDS ${AGENT_REMOTE_CPP} ${AGENT_LOCAL_CPP})
# Add executable
add_executable(dropshell ${SOURCES})
add_dependencies(dropshell run_prebuild_script)
# 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
${AGENT_REMOTE_CPP}
${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.
# Explicitly add the generated agent files
target_sources(dropshell PRIVATE
${CMAKE_CURRENT_SOURCE_DIR}/src/autogen/_agent-remote.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/autogen/_agent-local.cpp
${AGENT_REMOTE_CPP}
${AGENT_LOCAL_CPP}
)
# Set include directories