说明:集中 LinuxCNC 源码清单与 wasm/native probe 的路径解析,补强 manifest、shim、source-link 检查,并保持 LinuxCNC 源码后端对齐验证流程可复用。 验证:./test-native.sh;./test-linuxcnc-source-link.sh;./test-all-native.sh;wasm source/probe 相关脚本。
46 lines
1.4 KiB
Bash
Executable File
46 lines
1.4 KiB
Bash
Executable File
#!/usr/bin/env bash
|
|
set -euo pipefail
|
|
|
|
cd "$(dirname "$0")"
|
|
|
|
linuxcnc_root=${LINUXCNC_ROOT:-../linuxcnc}
|
|
cxx=${CXX:-g++}
|
|
build_dir=$(mktemp -d "${TMPDIR:-/tmp}/cnc_sim_native.XXXXXX")
|
|
|
|
if [[ ! -d "$linuxcnc_root" ]]; then
|
|
echo "missing LinuxCNC root: $linuxcnc_root" >&2
|
|
exit 1
|
|
fi
|
|
|
|
trap 'rm -rf "$build_dir"' EXIT
|
|
var_file="$build_dir/rs274ngc-api.var"
|
|
cp "$linuxcnc_root/tests/halui/jogging/sim.var" "$var_file"
|
|
|
|
project_source_list="$build_dir/linuxcnc_rs274_api_project_sources.txt"
|
|
./list-linuxcnc-rs274-api-project-sources.sh > "$project_source_list"
|
|
mapfile -t project_sources < "$project_source_list"
|
|
|
|
"$cxx" -std=c++17 \
|
|
-DCNC_SIM_ENABLE_LINUXCNC_RS274_BACKEND \
|
|
$(python3.13-config --includes 2>/dev/null || python3-config --includes) \
|
|
-I core/include \
|
|
-I core/src \
|
|
-I "$linuxcnc_root/src" \
|
|
-I "$linuxcnc_root/src/emc" \
|
|
-I "$linuxcnc_root/src/emc/nml_intf" \
|
|
-I "$linuxcnc_root/src/emc/rs274ngc" \
|
|
-I "$linuxcnc_root/src/emc/motion" \
|
|
-I "$linuxcnc_root/include" \
|
|
"${project_sources[@]}" \
|
|
core/tests/cnc_sim_api_linuxcnc_rs274_smoke.cpp \
|
|
-L "$linuxcnc_root/lib" \
|
|
-Wl,-rpath,"$linuxcnc_root/lib" \
|
|
-lrs274 \
|
|
-ltooldata \
|
|
-lpython3.13 \
|
|
-o "$build_dir/cnc_sim_api_linuxcnc_rs274_smoke"
|
|
|
|
CNC_SIM_RS274_VAR="$var_file" "$build_dir/cnc_sim_api_linuxcnc_rs274_smoke"
|
|
|
|
echo "linuxcnc rs274 API backend smoke passed"
|