Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
混口饭吃,
rt-thread
提交
fe773416
R
rt-thread
项目概览
混口饭吃,
/
rt-thread
与 Fork 源项目一致
Fork自
Mr_Pangza / 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看板
体验新版 GitCode,发现更多精彩内容 >>
未验证
提交
fe773416
编写于
8月 13, 2018
作者:
B
Bernard Xiong
提交者:
GitHub
8月 13, 2018
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #1717 from geniusgogo/fix_iar_project
fixed IAR project add LIBS
上级
b571cd88
49592769
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
27 addition
and
18 deletion
+27
-18
tools/iar.py
tools/iar.py
+27
-18
未找到文件。
tools/iar.py
浏览文件 @
fe773416
...
...
@@ -49,31 +49,31 @@ def IARAddGroup(parent, name, files, project_path):
group
=
SubElement
(
parent
,
'group'
)
group_name
=
SubElement
(
group
,
'name'
)
group_name
.
text
=
name
for
f
in
files
:
fn
=
f
.
rfile
()
name
=
fn
.
name
path
=
os
.
path
.
dirname
(
fn
.
abspath
)
basename
=
os
.
path
.
basename
(
path
)
path
=
_make_path_relative
(
project_path
,
path
)
path
=
os
.
path
.
join
(
path
,
name
)
file
=
SubElement
(
group
,
'file'
)
file_name
=
SubElement
(
file
,
'name'
)
if
os
.
path
.
isabs
(
path
):
file_name
.
text
=
path
.
decode
(
fs_encoding
)
else
:
file_name
.
text
=
(
'$PROJ_DIR$
\\
'
+
path
).
decode
(
fs_encoding
)
def
IARWorkspace
(
target
):
# make an workspace
# make an workspace
workspace
=
target
.
replace
(
'.ewp'
,
'.eww'
)
out
=
file
(
workspace
,
'wb'
)
xml
=
iar_workspace
%
target
out
.
write
(
xml
)
out
.
close
()
def
IARProject
(
target
,
script
):
project_path
=
os
.
path
.
dirname
(
os
.
path
.
abspath
(
target
))
...
...
@@ -87,7 +87,19 @@ def IARProject(target, script):
LINKFLAGS
=
''
CCFLAGS
=
''
Libs
=
[]
lib_prefix
=
[
'lib'
,
''
]
lib_suffix
=
[
'.a'
,
'.o'
,
''
]
def
searchLib
(
group
):
for
path_item
in
group
[
'LIBPATH'
]:
for
prefix_item
in
lib_prefix
:
for
suffix_item
in
lib_suffix
:
lib_full_path
=
os
.
path
.
join
(
path_item
,
prefix_item
+
item
+
suffix_item
)
if
os
.
path
.
isfile
(
lib_full_path
):
return
lib_full_path
else
:
return
''
# add group
for
group
in
script
:
IARAddGroup
(
root
,
group
[
'name'
],
group
[
'src'
],
project_path
)
...
...
@@ -95,29 +107,26 @@ def IARProject(target, script):
# get each include path
if
group
.
has_key
(
'CPPPATH'
)
and
group
[
'CPPPATH'
]:
CPPPATH
+=
group
[
'CPPPATH'
]
# get each group's definitions
if
group
.
has_key
(
'CPPDEFINES'
)
and
group
[
'CPPDEFINES'
]:
CPPDEFINES
+=
group
[
'CPPDEFINES'
]
# get each group's link flags
if
group
.
has_key
(
'LINKFLAGS'
)
and
group
[
'LINKFLAGS'
]:
LINKFLAGS
+=
group
[
'LINKFLAGS'
]
if
group
.
has_key
(
'LIBS'
)
and
group
[
'LIBS'
]:
for
item
in
group
[
'LIBS'
]:
lib_path
=
''
for
path_item
in
group
[
'LIBPATH'
]:
full_path
=
os
.
path
.
join
(
path_item
,
item
+
'.a'
)
if
os
.
path
.
isfile
(
full_path
):
# has this library
lib_path
=
full_path
lib_path
=
searchLib
(
group
)
if
lib_path
!=
''
:
lib_path
=
_make_path_relative
(
project_path
,
lib_path
)
Libs
+=
[
lib_path
]
# print('found lib isfile: ' + lib_path)
else
:
print
(
'not found LIB: '
+
item
)
# make relative path
# make relative path
paths
=
set
()
for
path
in
CPPPATH
:
inc
=
_make_path_relative
(
project_path
,
os
.
path
.
normpath
(
path
))
...
...
@@ -156,7 +165,7 @@ def IARProject(target, script):
out
.
close
()
IARWorkspace
(
target
)
def
IARVersion
():
import
subprocess
import
re
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录