Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Mozi
rt-thread
提交
ce51d0b0
R
rt-thread
项目概览
Mozi
/
rt-thread
与 Fork 源项目一致
Fork自
RT-Thread / rt-thread
通知
0
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看板
体验新版 GitCode,发现更多精彩内容 >>
未验证
提交
ce51d0b0
编写于
3月 22, 2022
作者:
G
guo
提交者:
GitHub
3月 22, 2022
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[tools]keil.py Distinguish LOCAL_CFLAGS/LOCAL_CXXFLAGS, refine file control (#5694)
上级
f6f6dae2
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
30 addition
and
27 deletion
+30
-27
tools/keil.py
tools/keil.py
+30
-27
未找到文件。
tools/keil.py
浏览文件 @
ce51d0b0
...
...
@@ -137,7 +137,7 @@ def MDK4AddLibToGroup(ProjectFiles, group, name, filename, project_path):
return
group
def
MDK4AddGroup
(
ProjectFiles
,
parent
,
name
,
files
,
project_path
):
def
MDK4AddGroup
(
ProjectFiles
,
parent
,
name
,
files
,
project_path
,
group_scons
):
# don't add an empty group
if
len
(
files
)
==
0
:
return
...
...
@@ -176,9 +176,36 @@ def MDK4AddGroup(ProjectFiles, parent, name, files, project_path):
file_type
=
SubElement
(
file
,
'FileType'
)
file_type
.
text
=
'%d'
%
_get_filetype
(
name
)
file_path
=
SubElement
(
file
,
'FilePath'
)
file_path
.
text
=
path
# path.decode(fs_encoding)
# for local LOCAL_CFLAGS/LOCAL_CXXFLAGS/LOCAL_CCFLAGS/LOCAL_CPPPATH/LOCAL_CPPDEFINES
MiscControls_text
=
' '
if
file_type
.
text
==
'1'
and
'LOCAL_CFLAGS'
in
group_scons
:
MiscControls_text
=
MiscControls_text
+
group_scons
[
'LOCAL_CFLAGS'
]
elif
file_type
.
text
==
'8'
and
'LOCAL_CXXFLAGS'
in
group_scons
:
MiscControls_text
=
MiscControls_text
+
group_scons
[
'LOCAL_CXXFLAGS'
]
if
'LOCAL_CCFLAGS'
in
group_scons
:
MiscControls_text
=
MiscControls_text
+
group_scons
[
'LOCAL_CCFLAGS'
]
if
MiscControls_text
!=
' '
:
FileOption
=
SubElement
(
file
,
'FileOption'
)
FileArmAds
=
SubElement
(
FileOption
,
'FileArmAds'
)
Cads
=
SubElement
(
FileArmAds
,
'Cads'
)
VariousControls
=
SubElement
(
Cads
,
'VariousControls'
)
MiscControls
=
SubElement
(
VariousControls
,
'MiscControls'
)
MiscControls
.
text
=
MiscControls_text
Define
=
SubElement
(
VariousControls
,
'Define'
)
if
'LOCAL_CPPDEFINES'
in
group_scons
:
Define
.
text
=
', '
.
join
(
set
(
group_scons
[
'LOCAL_CPPDEFINES'
]))
else
:
Define
.
text
=
' '
Undefine
=
SubElement
(
VariousControls
,
'Undefine'
)
Undefine
.
text
=
' '
IncludePath
=
SubElement
(
VariousControls
,
'IncludePath'
)
if
'LOCAL_CPPPATH'
in
group_scons
:
IncludePath
.
text
=
';'
.
join
([
_make_path_relative
(
project_path
,
os
.
path
.
normpath
(
i
))
for
i
in
group_scons
[
'LOCAL_CPPPATH'
]])
else
:
IncludePath
.
text
=
' '
return
group
# The common part of making MDK4/5 project
...
...
@@ -201,31 +228,7 @@ def MDK45Project(tree, target, script):
groups
=
SubElement
(
tree
.
find
(
'Targets/Target'
),
'Groups'
)
groups
.
clear
()
# clean old groups
for
group
in
script
:
group_tree
=
MDK4AddGroup
(
ProjectFiles
,
groups
,
group
[
'name'
],
group
[
'src'
],
project_path
)
# for local CPPPATH/CPPDEFINES
if
(
group_tree
!=
None
)
and
(
'LOCAL_CPPPATH'
in
group
or
'LOCAL_CFLAGS'
in
group
or
'LOCAL_CPPDEFINES'
in
group
):
GroupOption
=
SubElement
(
group_tree
,
'GroupOption'
)
GroupArmAds
=
SubElement
(
GroupOption
,
'GroupArmAds'
)
Cads
=
SubElement
(
GroupArmAds
,
'Cads'
)
VariousControls
=
SubElement
(
Cads
,
'VariousControls'
)
MiscControls
=
SubElement
(
VariousControls
,
'MiscControls'
)
if
'LOCAL_CFLAGS'
in
group
:
MiscControls
.
text
=
group
[
'LOCAL_CFLAGS'
]
else
:
MiscControls
.
text
=
' '
Define
=
SubElement
(
VariousControls
,
'Define'
)
if
'LOCAL_CPPDEFINES'
in
group
:
Define
.
text
=
', '
.
join
(
set
(
group
[
'LOCAL_CPPDEFINES'
]))
else
:
Define
.
text
=
' '
Undefine
=
SubElement
(
VariousControls
,
'Undefine'
)
Undefine
.
text
=
' '
IncludePath
=
SubElement
(
VariousControls
,
'IncludePath'
)
if
'LOCAL_CPPPATH'
in
group
:
IncludePath
.
text
=
';'
.
join
([
_make_path_relative
(
project_path
,
os
.
path
.
normpath
(
i
))
for
i
in
group
[
'LOCAL_CPPPATH'
]])
else
:
IncludePath
.
text
=
' '
group_tree
=
MDK4AddGroup
(
ProjectFiles
,
groups
,
group
[
'name'
],
group
[
'src'
],
project_path
,
group
)
# get each include path
if
'CPPPATH'
in
group
and
group
[
'CPPPATH'
]:
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录