[tools][eclipse] Sync assembler include paths - #11762
Open
wdfk-prog wants to merge 1 commit into
Open
Conversation
|
👋 感谢您对 RT-Thread 的贡献!Thank you for your contribution to RT-Thread! 为确保代码符合 RT-Thread 的编码规范,请在你的仓库中执行以下步骤运行代码格式化工作流(如果格式化CI运行失败)。 🛠 操作步骤 | Steps
完成后,提交将自动更新至 如有问题欢迎联系我们,再次感谢您的贡献!💐 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
拉取/合并请求描述:(PR description)
[
为什么提交这份PR (why to submit this PR)
Eclipse/STM32CubeIDE 工程生成器目前只将 SCons
project['CPPPATH']同步到 C/C++ Compiler 的 include paths,没有同步到 Assembler 的 include paths。对于需要通过 C 预处理器处理的汇编源文件(
.S),这会造成 SCons 原生构建与生成后的 Eclipse/CDT 工程之间存在配置差异。例如 Cortex-M4 的
libcpu/arm/cortex-m4/context_gcc.S包含:#include <rtconfig.h>SCons 构建时 BSP 根目录已经通过
CPPPATH提供给汇编器,因此可以正常找到rtconfig.h;但通过scons --target=eclipse生成 STM32CubeIDE/Eclipse 工程后,相同 include paths 只存在于 Compiler 配置中,Assembler 配置缺失,可能导致:本 PR 使生成后的 Assembler 与 Compiler 使用同一组由 SCons
project['CPPPATH']派生的 include paths,保持 SCons 与 Eclipse/CDT 工程生成结果一致。你的解决方案是什么 (what is your solution)
在
tools/targets/eclipse.py的HandleToolOption()中:增加对 Eclipse/CDT Assembler include path option 的收集:
assembler.include.pathsassembler.option.includepaths复用当前由
project['CPPPATH']生成的 include path 列表,同时更新 Compiler 和 Assembler include paths。保留现有的 reset/update 行为:
reset=True时按原有逻辑清理已有配置;reset=False时只清理由 RT-Thread 工程生成器管理的路径;本次修改仅涉及
tools/targets/eclipse.py,最终 diff 为+5/-2,不改变 SCons 原生构建行为。本地验证结果:
python3 -m py_compile tools/targets/eclipse.py:通过。scons --target=eclipse:通过。rtconfig.h。libcpu/arm/cortex-m4/context_gcc.S可正确解析<rtconfig.h>。scons --target=eclipse后生成结果保持一致,验证生成过程幂等。未在本环境中执行完整 STM32CubeIDE IDE 内构建。
请提供验证的bsp和config (provide the config and bsp)
BSP:
rtt_5axisrtt_6axis.config:
.configchange is required for the Eclipse generator fix.action:
]
当前拉取/合并请求的状态 Intent for your PR
必须选择一项 Choose one (Mandatory):
代码质量 Code Quality:
我在这个拉取/合并请求中已经考虑了 As part of this pull request, I've considered the following:
#if 0代码,不包含已经被注释了的代码 All redundant code is removed and cleaned up