RT-Thread / RT-Thread/rt-thread
[Bug] RTT Studio不支持DefineGroup中LOCAL_CCFLAGS等编译选项
Open
Nobody has claimed this yet.
- Dominant language
- C
- Stars
- 12.2k
- Forks
- 5.4k
- Avg merge
- 4d 12h
- Merged PRs (30d)
- 40
Description
RT-Thread Version
5.1.0
Hardware Type/Architectures
HC32
Develop Toolchain
RT-Thread Studio
Describe the bug
在SConscript中作如下定义
group = DefineGroup('rtk-unmanaged-switch', src, depend = ['PKG_USING_RTK_UNMANAGED_SWITCH'], CPPPATH = path, LOCAL_CCFLAGS = ' -DSPI_OPERATION')
Return('group')
RTT Studio生成的对应subdir.mk中,编译对应的obj文件时,没有看到-DSPI_OPERATION
applications/<省略>/%.o: ../applications/<省略>/%.c
arm-none-eabi-gcc -mcpu=cortex-m4 -mthumb -mfloat-abi=hard -mfpu=fpv4-sp-d16 -O0 -ffunction-sections -fdata-sections -Wall -g -gdwarf-2 -DDEBUG <省略> -std=gnu11 -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@)" -c -o "$@" "$<"
期望有该定义。
使用scons编译,是有-DSPI_OPERATION定义的,如下。
arm-none-eabi-gcc -o build\applications\<省略>.o -c -mcpu=cortex-m4 -mthumb -mfpu=fpv4-sp-d16 -mfloat-abi=hard -ffunction-sections -fdata-sections -Dgcc -O0 -gdwarf-2 -g -DSPI_OPERATION -DHC32F4A0 -D__DEBUG -D__RTTHREAD__ -DRT_USING_NEWLIBC -DRT_USING_LIBC -D_POSIX_C_SOURCE=1 -DUSE_DDL_DRIVER <省略>.c
如果RTT Studio自带的编译不支持,那使用RTT Studio编程和配置+使用env进行编译这样的组合开发方式推荐吗?
Other additional context
No response
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the SConscript DefineGroup example and the generated applications//subdir.mk command shown in the report. Compare the RTT Studio-generated compile flags with the corresponding scons command, focusing on LOCAL_CCFLAGS. Done means the generated Studio build includes -DSPI_OPERATION for the affected object files.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- c
- Domain
- build-system, embedded-iot
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 28/100