Files
wasm-simulator/list-cmake-set-plus-append-sources.sh
cnc b40914747d 满庭芳·源流归一
结论:LinuxCNC rs274ngc 源码移植边界继续收拢。已将 rs274ngc 头文件纳入 manifest 跟踪,core 编译组仍只包含可编译源文件;启用 CNC_SIM_ENABLE_LINUXCNC_RS274_BACKEND 时 API 默认使用 LinuxCNC rs274 后端;M428/M429/M430 与 5axis/TRT/TDR/RTCP 相关路径继续保持来自 LinuxCNC 源码或 remap 配置的薄桥接。

验证:./test-linuxcnc-source-syntax.sh;./test-linuxcnc-api-native.sh;./test-native.sh;./test-linuxcnc-source-link.sh。
2026-05-28 18:00:53 +08:00

46 lines
1.1 KiB
Bash
Executable File

#!/usr/bin/env bash
set -euo pipefail
cd "$(dirname "$0")"
if [[ "$#" -lt 2 || "$#" -gt 3 ]]; then
echo "usage: $0 <set-name> <append-name> [relative-prefix]" >&2
exit 1
fi
set_name=$1
append_name=$2
relative_prefix=${3:-}
awk -v set_name="$set_name" -v append_name="$append_name" -v relative_prefix="$relative_prefix" '
$0 ~ "^[[:space:]]*set\\(" set_name "([[:space:]]|$)" {
in_set = 1
next
}
in_set && /^[[:space:]]*\)/ {
in_set = 0
next
}
$0 ~ "^[[:space:]]*list\\(APPEND " append_name "([[:space:]]|$)" {
in_append = 1
next
}
in_append && /^[[:space:]]*\)/ {
in_append = 0
next
}
in_set || in_append {
line = $0
sub(/^[[:space:]]*/, "", line)
sub(/[[:space:]]*$/, "", line)
if (line == "") {
next
}
sub(/^\$\{CMAKE_CURRENT_SOURCE_DIR\}\//, "core/", line)
if (line !~ /^core\// && relative_prefix != "") {
line = relative_prefix line
}
print line
}
' core/CMakeLists.txt