Guards pdm_translation stub copy against codegen race

This commit is contained in:
berrux-dev committed 2026-09-18 17:45:16 +02:00
1 parent a318dbb64a
commit 619c7683d4
1 file changed
+12 -5
@@ -28,11 +28,18 @@ CONFIGURE_FILE(
)
# Copy pdm_translation.h to build directory
CONFIGURE_FILE(
${CMAKE_CURRENT_SOURCE_DIR}/../../../include/ProjectDataManagement/pdm_translation.h
${CMAKE_CURRENT_BINARY_DIR}/pdm_translation.h
COPYONLY
)
# Only when BUILD_GRANTLEE=OFF (stub header). With BUILD_GRANTLEE=ON the
# codegen writes the real pdm_translation.h to the same build-dir path
# (see "Generating ... pdm_translation.h" in CODEGEN_IDL_SVC); copying the
# stub here would overwrite the generated file on every cmake re-configure
# and break incremental builds. Same guard pattern as pdm_enums.hpp below.
IF(NOT BUILD_GRANTLEE)
CONFIGURE_FILE(
${CMAKE_CURRENT_SOURCE_DIR}/../../../include/ProjectDataManagement/pdm_translation.h
${CMAKE_CURRENT_BINARY_DIR}/pdm_translation.h
COPYONLY
)
ENDIF()
# Copy pdm_enums.hpp to build directory (when BUILD_RTI=OFF)
IF(NOT BUILD_RTI)