Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Xiaobo07
rt-thread
提交
b7f7d6e6
R
rt-thread
项目概览
Xiaobo07
/
rt-thread
与 Fork 源项目一致
Fork自
RT-Thread / rt-thread
通知
2
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
R
rt-thread
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
b7f7d6e6
编写于
6月 22, 2018
作者:
armink_ztl
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[tools] Fix the IDE project build error when using 'scons --target=cc'.
上级
9539892a
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
60 addition
and
27 deletion
+60
-27
tools/building.py
tools/building.py
+59
-17
tools/iar.py
tools/iar.py
+1
-10
未找到文件。
tools/building.py
浏览文件 @
b7f7d6e6
...
@@ -112,6 +112,35 @@ class Win32Spawn:
...
@@ -112,6 +112,35 @@ class Win32Spawn:
return
proc
.
wait
()
return
proc
.
wait
()
# auto fix the 'RTT_CC' and 'RTT_EXEC_PATH'
# when using 'scons --target=cc' the 'RTT_CC' will set to 'cc'
# it will fix the the 'rtconfig.EXEC_PATH' when get it failed.
# NOTE: this function will changed your env. Please backup the env before used it.
def
AutoFixRttCCAndExecPath
():
import
rtconfig
target_option
=
None
# get --target=cc option
if
len
(
sys
.
argv
)
>
1
:
option
=
sys
.
argv
[
1
].
split
(
'='
)
if
len
(
option
)
>
1
and
option
[
0
]
==
'--target'
:
target_option
=
option
[
1
]
# force change the 'RTT_CC' when using 'scons --target=cc'
if
target_option
:
if
target_option
==
'mdk'
or
target_option
==
'mdk4'
or
target_option
==
'mdk5'
:
os
.
environ
[
'RTT_CC'
]
=
'keil'
elif
target_option
==
'iar'
:
os
.
environ
[
'RTT_CC'
]
=
'iar'
# auto change the 'RTT_EXEC_PATH' when 'rtconfig.EXEC_PATH' get failed
reload
(
rtconfig
)
if
not
os
.
path
.
exists
(
rtconfig
.
EXEC_PATH
):
if
os
.
environ
[
'RTT_EXEC_PATH'
]:
# del the 'RTT_EXEC_PATH' and using the 'EXEC_PATH' setting on rtconfig.py
del
os
.
environ
[
'RTT_EXEC_PATH'
]
reload
(
rtconfig
)
def
PrepareBuilding
(
env
,
root_directory
,
has_libcpu
=
False
,
remove_components
=
[]):
def
PrepareBuilding
(
env
,
root_directory
,
has_libcpu
=
False
,
remove_components
=
[]):
import
SCons.cpp
import
SCons.cpp
import
rtconfig
import
rtconfig
...
@@ -130,6 +159,9 @@ def PrepareBuilding(env, root_directory, has_libcpu=False, remove_components = [
...
@@ -130,6 +159,9 @@ def PrepareBuilding(env, root_directory, has_libcpu=False, remove_components = [
sys
.
path
=
sys
.
path
+
[
os
.
path
.
join
(
Rtt_Root
,
'tools'
)]
sys
.
path
=
sys
.
path
+
[
os
.
path
.
join
(
Rtt_Root
,
'tools'
)]
# auto fix the 'RTT_CC' and 'RTT_EXEC_PATH'
AutoFixRttCCAndExecPath
()
# add compability with Keil MDK 4.6 which changes the directory of armcc.exe
# add compability with Keil MDK 4.6 which changes the directory of armcc.exe
if
rtconfig
.
PLATFORM
==
'armcc'
:
if
rtconfig
.
PLATFORM
==
'armcc'
:
if
not
os
.
path
.
isfile
(
os
.
path
.
join
(
rtconfig
.
EXEC_PATH
,
'armcc.exe'
)):
if
not
os
.
path
.
isfile
(
os
.
path
.
join
(
rtconfig
.
EXEC_PATH
,
'armcc.exe'
)):
...
@@ -709,18 +741,8 @@ def DoBuilding(target, objects):
...
@@ -709,18 +741,8 @@ def DoBuilding(target, objects):
program
=
Env
.
Program
(
target
,
objects
)
program
=
Env
.
Program
(
target
,
objects
)
EndBuilding
(
target
,
program
)
EndBuilding
(
target
,
program
)
def
EndBuilding
(
target
,
program
=
None
):
def
GenTargetProject
(
program
=
None
):
import
rtconfig
Env
[
'target'
]
=
program
Env
[
'project'
]
=
Projects
Env
.
AddPostAction
(
target
,
rtconfig
.
POST_ACTION
)
# Add addition clean files
Clean
(
target
,
'cconfig.h'
)
Clean
(
target
,
'rtua.py'
)
Clean
(
target
,
'rtua.pyc'
)
if
GetOption
(
'target'
)
==
'mdk'
:
if
GetOption
(
'target'
)
==
'mdk'
:
from
keil
import
MDKProject
from
keil
import
MDKProject
...
@@ -777,27 +799,47 @@ def EndBuilding(target, program = None):
...
@@ -777,27 +799,47 @@ def EndBuilding(target, program = None):
from
cdk
import
CDKProject
from
cdk
import
CDKProject
CDKProject
(
'project.cdkproj'
,
Projects
)
CDKProject
(
'project.cdkproj'
,
Projects
)
def
EndBuilding
(
target
,
program
=
None
):
import
rtconfig
need_exit
=
False
Env
[
'target'
]
=
program
Env
[
'project'
]
=
Projects
Env
.
AddPostAction
(
target
,
rtconfig
.
POST_ACTION
)
# Add addition clean files
Clean
(
target
,
'cconfig.h'
)
Clean
(
target
,
'rtua.py'
)
Clean
(
target
,
'rtua.pyc'
)
if
GetOption
(
'target'
):
GenTargetProject
(
program
)
BSP_ROOT
=
Dir
(
'#'
).
abspath
BSP_ROOT
=
Dir
(
'#'
).
abspath
if
GetOption
(
'copy'
)
and
program
!=
None
:
if
GetOption
(
'copy'
)
and
program
!=
None
:
from
mkdist
import
MakeCopy
from
mkdist
import
MakeCopy
MakeCopy
(
program
,
BSP_ROOT
,
Rtt_Root
,
Env
)
MakeCopy
(
program
,
BSP_ROOT
,
Rtt_Root
,
Env
)
exit
(
0
)
need_exit
=
True
if
GetOption
(
'copy-header'
)
and
program
!=
None
:
if
GetOption
(
'copy-header'
)
and
program
!=
None
:
from
mkdist
import
MakeCopyHeader
from
mkdist
import
MakeCopyHeader
MakeCopyHeader
(
program
,
BSP_ROOT
,
Rtt_Root
,
Env
)
MakeCopyHeader
(
program
,
BSP_ROOT
,
Rtt_Root
,
Env
)
exit
(
0
)
need_exit
=
True
if
GetOption
(
'make-dist'
)
and
program
!=
None
:
if
GetOption
(
'make-dist'
)
and
program
!=
None
:
from
mkdist
import
MkDist
from
mkdist
import
MkDist
MkDist
(
program
,
BSP_ROOT
,
Rtt_Root
,
Env
)
MkDist
(
program
,
BSP_ROOT
,
Rtt_Root
,
Env
)
exit
(
0
)
need_exit
=
True
if
GetOption
(
'cscope'
):
if
GetOption
(
'cscope'
):
from
cscope
import
CscopeDatabase
from
cscope
import
CscopeDatabase
CscopeDatabase
(
Projects
)
CscopeDatabase
(
Projects
)
if
not
GetOption
(
'help'
)
and
not
GetOption
(
'target'
):
if
not
GetOption
(
'help'
)
and
not
GetOption
(
'target'
):
if
not
os
.
path
.
exists
(
rtconfig
.
EXEC_PATH
):
if
not
os
.
path
.
exists
(
rtconfig
.
EXEC_PATH
):
print
"Error: Toolchain path (%s) is not exist, please check 'EXEC_PATH' in path or rtconfig.py."
%
rtconfig
.
EXEC_PATH
print
"Error: the toolchain path (%s) is not exist, please check 'EXEC_PATH' in path or rtconfig.py."
%
rtconfig
.
EXEC_PATH
sys
.
exit
(
1
)
need_exit
=
True
if
need_exit
:
exit
(
0
)
def
SrcRemove
(
src
,
remove
):
def
SrcRemove
(
src
,
remove
):
if
not
src
:
if
not
src
:
...
...
tools/iar.py
浏览文件 @
b7f7d6e6
...
@@ -178,21 +178,12 @@ def IARVersion():
...
@@ -178,21 +178,12 @@ def IARVersion():
return
path
return
path
# get the IAR path in 'RTT_EXEC_PATH'
path
=
IARPath
();
path
=
IARPath
();
# retry to get IAR path on 'rtconfig.py'
if
not
os
.
path
.
exists
(
path
):
rtt_exec_path
=
os
.
environ
[
'RTT_EXEC_PATH'
]
if
rtt_exec_path
:
del
os
.
environ
[
'RTT_EXEC_PATH'
]
path
=
IARPath
();
os
.
environ
[
'RTT_EXEC_PATH'
]
=
rtt_exec_path
if
os
.
path
.
exists
(
path
):
if
os
.
path
.
exists
(
path
):
cmd
=
os
.
path
.
join
(
path
,
'iccarm.exe'
)
cmd
=
os
.
path
.
join
(
path
,
'iccarm.exe'
)
else
:
else
:
print
(
'
Get IAR version error. Please updat
e IAR installation path in rtconfig.py!'
)
print
(
'
Error: get IAR version failed. Please update th
e IAR installation path in rtconfig.py!'
)
return
"0.0"
return
"0.0"
child
=
subprocess
.
Popen
([
cmd
,
'--version'
],
stdout
=
subprocess
.
PIPE
,
stderr
=
subprocess
.
PIPE
,
shell
=
True
)
child
=
subprocess
.
Popen
([
cmd
,
'--version'
],
stdout
=
subprocess
.
PIPE
,
stderr
=
subprocess
.
PIPE
,
shell
=
True
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录