- Wrap FIND_PACKAGE(RTI) in IF(NOT TARGET RTI::nddsc) condition - Prevents placeholder targets from overwriting manually configured RTI:: targets - Manual configuration creates RTI:: targets when BUILD_RTI=ON and RTI found - FIND_PACKAGE only called as fallback when manual config doesn't create targets Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Entire-Checkpoint: 01M1CT3XSQXCX9RQR6WM9DG3GH
37 lines
1.1 KiB
Bash
Executable File
37 lines
1.1 KiB
Bash
Executable File
#!/bin/bash
|
|
# patch_core_dtc_h.sh - Post-Build Patch für core_dtc.h
|
|
# Fügt fehlenden Include und using-Declarationen hinzu
|
|
|
|
set -e
|
|
|
|
CORE_DTC_H="/repo/build/Lts/DDS/Core/core_dtc.h"
|
|
|
|
if [ ! -f "$CORE_DTC_H" ]; then
|
|
echo "ERROR: $CORE_DTC_H not found!"
|
|
exit 1
|
|
fi
|
|
|
|
echo "Patching $CORE_DTC_H..."
|
|
|
|
# Prüfen ob bereits gepatcht
|
|
if grep -q "// PATCHED BY patch_core_dtc_h.sh" "$CORE_DTC_H"; then
|
|
echo "File already patched, skipping..."
|
|
exit 0
|
|
fi
|
|
|
|
# 1. Include für core_dtc_types.h nach core.hpp hinzufügen
|
|
sed -i '/#include "core.hpp"/a #include "core_dtc_types.h" // PATCHED BY patch_core_dtc_h.sh' "$CORE_DTC_H"
|
|
|
|
# 2. Using-Declarationen im Core Namespace hinzufügen (nach namespace Core { )
|
|
# Wir fügen nach "namespace Core {" einen Block mit using-Declarationen ein
|
|
sed -i '/^namespace Core {/a\
|
|
// PATCHED BY patch_core_dtc_h.sh - DTC type aliases\
|
|
using DTC::CurrentRunningState;\
|
|
using DTC::LockedEntity;\
|
|
using DTC::PartitionTime;\
|
|
using DTC::RelativePositionAbsoluteTime;\
|
|
using DTC::RelativePositionRelativeTime;\
|
|
using DTC::ReplayPartition;\
|
|
' "$CORE_DTC_H"
|
|
|
|
echo "Patching complete!" |