Files
qt6-migration-pipeline/patch_core_json.sh
T
torstenandCopilot d6500157f1 Fix RTI detection: only call FIND_PACKAGE if manual config failed
- 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
2026-08-31 23:03:01 +02:00

29 lines
1013 B
Bash
Executable File

#!/bin/bash
# Post-Build Patch für generierte core_json.cpp
# Fixt Qt6/C++17 Inkompatibilitäten in ngl_codegen Output
set -e
CORE_JSON_FILE="/repo/build/Lts/DDS/Core/core_json.cpp"
if [ ! -f "$CORE_JSON_FILE" ]; then
echo "ERROR: $CORE_JSON_FILE nicht gefunden!"
exit 1
fi
echo "Patching core_json.cpp für Qt6/C++17 Kompatibilität..."
# Fix 1: .underlying() für normale enums entfernen
# ngl_codegen generiert: static_cast<int>(element.field.underlying())
# core.xml hat normale enums, also: static_cast<int>(element.field)
sed -i 's/\.underlying())/)/g' "$CORE_JSON_FILE"
echo " - .underlying() Aufrufe entfernt"
# Fix 2: Enum Typ-Namen korrigieren (_def::type → direkter Typname)
sed -i 's/Core::RunningState_def::type/Core::RunningState/g' "$CORE_JSON_FILE"
sed -i 's/Core::PortType_def::type/Core::PortType/g' "$CORE_JSON_FILE"
sed -i 's/Core::ReplayType_def::type/Core::ReplayType/g' "$CORE_JSON_FILE"
echo " - Enum Typ-Namen korrigiert"
echo "✓ core_json.cpp erfolgreich gepatcht"