summaryrefslogtreecommitdiff
path: root/nebula-robosense-hw-interfaces.spec
diff options
context:
space:
mode:
Diffstat (limited to 'nebula-robosense-hw-interfaces.spec')
-rw-r--r--nebula-robosense-hw-interfaces.spec8
1 files changed, 6 insertions, 2 deletions
diff --git a/nebula-robosense-hw-interfaces.spec b/nebula-robosense-hw-interfaces.spec
index 25ba8db..9c7eb35 100644
--- a/nebula-robosense-hw-interfaces.spec
+++ b/nebula-robosense-hw-interfaces.spec
@@ -80,13 +80,17 @@ robosense_hw_interface.hpp),供 nebula_robosense_decoders 等上层包
%build
# ROS 基座环境(chroot 已配置 ROS SIG repo;无 ROS 依赖的包 buildroot 里
# 可能没有 setup.sh,必须用 [ -f ] 守卫——直接 source 不存在的文件在
-# 严格 sh 下会中止整个 %build 脚本,|| true 挡不住,§4)
+# 严格 sh 下会中止整个构建脚本段,|| true 挡不住,§4)
[ -f /opt/ros/%{ros_distro}/setup.sh ] && source /opt/ros/%{ros_distro}/setup.sh || true
export PYTHONPATH=/opt/ros/%{ros_distro}/lib/python%{python3_version}/site-packages${PYTHONPATH:+:$PYTHONPATH}
export PKG_CONFIG_PATH=/opt/ros/%{ros_distro}/lib/pkgconfig${PKG_CONFIG_PATH:+:$PKG_CONFIG_PATH}
# 上游是 nebula 单仓多包布局,本包位于归档内三层深(src/nebula_robosense/<pkg>)
cd src/nebula_robosense/nebula_robosense_hw_interfaces
-# openEuler 的 %cmake 宏带位置参数会错误解析源码目录,改用显式 out-of-source(§5)
+# 说明:以显式 out-of-source 目录构建(mkdir .obj 后于其中调用 cmake3),
+# 因为带位置参数的 cmake 宏会被错误解析源码目录(§5)。
+# 注意:本文件的所有注释都不得出现裸的 cmake 宏名(形如 百分号后接 cmake),
+# rpm 对构建脚本段整段做宏展开,连注释里的宏名也会被替换,展开体的残留文本
+# 会串进命令参数,导致 cmake 收到中文位置参数而报 source directory 不存在。
mkdir -p .obj && cd .obj
%cmake3 \
-DCMAKE_INSTALL_PREFIX="/opt/ros/%{ros_distro}" \