Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
BaiXuePrincess
rt-thread
提交
e0998e3c
R
rt-thread
项目概览
BaiXuePrincess
/
rt-thread
与 Fork 源项目一致
Fork自
RT-Thread / rt-thread
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
R
rt-thread
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
提交
e0998e3c
编写于
3月 08, 2016
作者:
B
Bernard Xiong
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #614 from onelife/upstream
SCons PreProcessor patch: Stop processing "#define" in false condition
上级
10fd3d34
aee3a1d4
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
41 addition
and
3 deletion
+41
-3
tools/building.py
tools/building.py
+41
-3
未找到文件。
tools/building.py
浏览文件 @
e0998e3c
...
...
@@ -36,6 +36,44 @@ Projects = []
Rtt_Root
=
''
Env
=
None
# SCons PreProcessor patch
def
start_handling_includes
(
self
,
t
=
None
):
"""
Causes the PreProcessor object to start processing #import,
#include and #include_next lines.
This method will be called when a #if, #ifdef, #ifndef or #elif
evaluates True, or when we reach the #else in a #if, #ifdef,
#ifndef or #elif block where a condition already evaluated
False.
"""
d
=
self
.
dispatch_table
p
=
self
.
stack
[
-
1
]
if
self
.
stack
else
self
.
default_table
for
k
in
(
'import'
,
'include'
,
'include_next'
,
'define'
):
d
[
k
]
=
p
[
k
]
def
stop_handling_includes
(
self
,
t
=
None
):
"""
Causes the PreProcessor object to stop processing #import,
#include and #include_next lines.
This method will be called when a #if, #ifdef, #ifndef or #elif
evaluates False, or when we reach the #else in a #if, #ifdef,
#ifndef or #elif block where a condition already evaluated True.
"""
d
=
self
.
dispatch_table
d
[
'import'
]
=
self
.
do_nothing
d
[
'include'
]
=
self
.
do_nothing
d
[
'include_next'
]
=
self
.
do_nothing
d
[
'define'
]
=
self
.
do_nothing
PatchedPreProcessor
=
SCons
.
cpp
.
PreProcessor
PatchedPreProcessor
.
start_handling_includes
=
start_handling_includes
PatchedPreProcessor
.
stop_handling_includes
=
stop_handling_includes
class
Win32Spawn
:
def
spawn
(
self
,
sh
,
escape
,
cmd
,
args
,
env
):
# deal with the cmd build-in commands which cannot be used in
...
...
@@ -123,7 +161,7 @@ def PrepareBuilding(env, root_directory, has_libcpu=False, remove_components = [
Env
.
Append
(
BUILDERS
=
{
'BuildLib'
:
bld
})
# parse rtconfig.h to get used component
PreProcessor
=
SCons
.
cpp
.
PreProcessor
()
PreProcessor
=
Patched
PreProcessor
()
f
=
file
(
'rtconfig.h'
,
'r'
)
contents
=
f
.
read
()
f
.
close
()
...
...
@@ -277,7 +315,7 @@ def PrepareModuleBuilding(env, root_directory, bsp_directory):
Rtt_Root
=
root_directory
# parse bsp rtconfig.h to get used component
PreProcessor
=
SCons
.
cpp
.
PreProcessor
()
PreProcessor
=
Patched
PreProcessor
()
f
=
file
(
bsp_directory
+
'/rtconfig.h'
,
'r'
)
contents
=
f
.
read
()
f
.
close
()
...
...
@@ -631,7 +669,7 @@ def GetVersion():
rtdef
=
os
.
path
.
join
(
Rtt_Root
,
'include'
,
'rtdef.h'
)
# parse rtdef.h to get RT-Thread version
prepcessor
=
SCons
.
cpp
.
PreProcessor
()
prepcessor
=
Patched
PreProcessor
()
f
=
file
(
rtdef
,
'r'
)
contents
=
f
.
read
()
f
.
close
()
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录