Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[update] change ccflags to cflags #5411

Merged
merged 1 commit into from
Jan 20, 2022
Merged

Conversation

liukangcc
Copy link
Member

@liukangcc liukangcc commented Dec 22, 2021

拉取/合并请求描述:(PR description)

[
这段方括号里的内容是您必须填写并替换掉的,否则PR不可能被合并。方括号外面的内容不需要修改,但请仔细阅读。
The content in this square bracket must be filled in and replaced, otherwise, PR can not be merged. The contents outside square brackets need not be changed, but please read them carefully.

请在这里填写您的PR描述,可以包括以下之一的内容:为什么提交这份PR;解决的问题是什么,你的解决方案是什么;
Please fill in your PR description here, which can include one of the following items: why to submit this PR; what is the problem solved and what is your solution;

并确认并列出已经在什么情况或板卡上进行了测试。
And confirm in which case or board has been tested.
]

以下的内容不应该在提交PR时的message修改,修改下述message,PR会被直接关闭。请在提交PR后,浏览器查看PR并对以下检查项逐项check,没问题后逐条在页面上打钩。
The following content must not be changed in the submitted PR message. Otherwise, the PR will be closed immediately. After submitted PR, please use a web browser to visit PR, and check items one by one, and ticked them if no problem.

当前拉取/合并请求的状态 Intent for your PR

必须选择一项 Choose one (Mandatory):

  • 本拉取/合并请求是一个草稿版本 This PR is for a code-review and is intended to get feedback
  • 本拉取/合并请求是一个成熟版本 This PR is mature, and ready to be integrated into the repo

代码质量 Code Quality:

我在这个拉取/合并请求中已经考虑了 As part of this pull request, I've considered the following:

  • 已经仔细查看过代码改动的对比 Already check the difference between PR and old code
  • 代码风格正确,包括缩进空格,命名及其他风格 Style guide is adhered to, including spacing, naming and other styles
  • 没有垃圾代码,代码尽量精简,不包含#if 0代码,不包含已经被注释了的代码 All redundant code is removed and cleaned up
  • 所有变更均有原因及合理的,并且不会影响到其他软件组件代码或BSP All modifications are justified and not affect other components or BSP
  • 对难懂代码均提供对应的注释 I've commented appropriately where code is tricky
  • 本拉取/合并请求代码是高质量的 Code in this PR is of high quality
  • 本拉取/合并使用formatting等源码格式化工具确保格式符合RT-Thread代码规范 This PR complies with RT-Thread code specification

Sorry, something went wrong.

@mysterywolf mysterywolf added in progress PR/issue in progress. and removed in progress PR/issue in progress. labels Dec 22, 2021
@mysterywolf
Copy link
Member

mysterywolf commented Dec 24, 2021

这个CFLAGS没啥问题 但是我在scons手册中没有发现LOCAL_CCFLAGS或者LOCAL_CFLAGS字样
scons-user.pdf

@liukangcc
Copy link
Member Author

这个CFLAGS没啥问题 但是我在scons手册中没有发现LOCAL_CCFLAGS或者LOCAL_CFLAGS字样 scons-user.pdf

确实。在 scons 手册中搜索不到 local_ccflags。所以,这里的 local_ccflags 可以删除掉了?

@mysterywolf
Copy link
Member

这个local是我们这边自己的
image
也应该需要修改为一个C

@mysterywolf
Copy link
Member

image
这里边也有CCFLAGS的问题
搜索的时候请进行全局搜索,不要局限在sconscript上进行搜索

@JcZou
Copy link
Contributor

JcZou commented Dec 26, 2021

LOCAL_CCFLAGS在building.py的local_group()函数中会将其加入CCFLAGS中

    def local_group(group, objects):
        if 'LOCAL_CCFLAGS' in group or 'LOCAL_CPPPATH' in group or 'LOCAL_CPPDEFINES' in group or 'LOCAL_ASFLAGS' in group:
            CCFLAGS = Env.get('CCFLAGS', '') + group.get('LOCAL_CCFLAGS', '')

但是目前LOCAL_CFLAGS并没有其定义,所以编译的时候也并不会用到

@JcZou
Copy link
Contributor

JcZou commented Dec 26, 2021

另外,在之前的MR已经将CCFLAGS修改为CFLAGS,所以这里CCFLAGS实际上是C compiler的标志位,而C++ compiler的标志是CXXFLAGS

env = Environment(tools=['mingw'],
                  AS=rtconfig.AS, ASFLAGS=rtconfig.AFLAGS,
                  CC=rtconfig.CC, CFLAGS=rtconfig.CFLAGS,
                  AR=rtconfig.AR, ARFLAGS='-rc',
                  CXX=rtconfig.CXX, CXXFLAGS=rtconfig.CXXFLAGS,
                  LINK=rtconfig.LINK, LINKFLAGS=rtconfig.LFLAGS)

@mysterywolf
Copy link
Member

CCFLAGS -> 不区分C/C++ 都设置
CXXFLAGS -> 专门给C++,单独设置C++,不设置C
CFLAGS -> 专门给C,不设置C++

建议增加LOCAL_CXXFLAGS LOCAL_CFLAGS

@liukangcc liukangcc force-pushed the cflag branch 2 times, most recently from 96a11e4 to 32a827a Compare January 20, 2022 03:41

Unverified

This commit is not signed, but one or more authors requires that any commit attributed to them is signed.
@Guozhanxin Guozhanxin added the +1 Agree +1 label Jan 20, 2022
@Guozhanxin Guozhanxin merged commit d96e85c into RT-Thread:master Jan 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants