Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
SummerGao.
rt-thread
提交
a2e074e0
R
rt-thread
项目概览
SummerGao.
/
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看板
体验新版 GitCode,发现更多精彩内容 >>
提交
a2e074e0
编写于
8月 01, 2014
作者:
B
bernard
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[building] fix command too long issue under win32.
上级
5ccf1d44
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
33 addition
and
13 deletion
+33
-13
tools/building.py
tools/building.py
+33
-13
未找到文件。
tools/building.py
浏览文件 @
a2e074e0
...
...
@@ -12,24 +12,44 @@ Env = None
class
Win32Spawn
:
def
spawn
(
self
,
sh
,
escape
,
cmd
,
args
,
env
):
# deal with the cmd build-in commands which cannot be used in
# subprocess.Popen
if
cmd
==
'del'
:
for
f
in
args
[
1
:]:
try
:
os
.
remove
(
f
)
except
Exception
as
e
:
print
'Error removing file: %s'
%
e
return
-
1
return
0
import
subprocess
newargs
=
string
.
join
(
args
[
1
:],
' '
)
cmdline
=
cmd
+
" "
+
newargs
startupinfo
=
subprocess
.
STARTUPINFO
()
startupinfo
.
dwFlags
|=
subprocess
.
STARTF_USESHOWWINDOW
# Make sure the env is constructed by strings
_e
=
{
k
:
str
(
v
)
for
k
,
v
in
env
.
items
()}
proc
=
subprocess
.
Popen
(
cmdline
,
stdin
=
subprocess
.
PIPE
,
stdout
=
subprocess
.
PIPE
,
stderr
=
subprocess
.
PIPE
,
startupinfo
=
startupinfo
,
shell
=
False
)
data
,
err
=
proc
.
communicate
()
rv
=
proc
.
wait
()
if
data
:
print
data
if
err
:
print
err
# Windows(tm) CreateProcess does not use the env passed to it to find
# the executables. So we have to modify our own PATH to make Popen
# work.
old_path
=
os
.
environ
[
'PATH'
]
os
.
environ
[
'PATH'
]
=
_e
[
'PATH'
]
try
:
proc
=
subprocess
.
Popen
(
cmdline
,
env
=
_e
,
startupinfo
=
startupinfo
,
shell
=
False
)
except
Exception
as
e
:
print
'Error in calling:
\n
%s'
%
cmdline
print
'Exception: %s: %s'
%
(
e
,
os
.
strerror
(
e
.
errno
))
return
e
.
errno
finally
:
os
.
environ
[
'PATH'
]
=
old_path
if
rv
:
return
rv
return
0
return
proc
.
wait
()
def
PrepareBuilding
(
env
,
root_directory
,
has_libcpu
=
False
,
remove_components
=
[]):
import
SCons.cpp
...
...
@@ -59,11 +79,11 @@ def PrepareBuilding(env, root_directory, has_libcpu=False, remove_components = [
env
[
'LIBDIRPREFIX'
]
=
'--userlibpath '
# patch for win32 spawn
if
env
[
'PLATFORM'
]
==
'win32'
and
rtconfig
.
PLATFORM
==
'gcc'
:
if
env
[
'PLATFORM'
]
==
'win32'
:
win32_spawn
=
Win32Spawn
()
win32_spawn
.
env
=
env
env
[
'SPAWN'
]
=
win32_spawn
.
spawn
if
env
[
'PLATFORM'
]
==
'win32'
:
os
.
environ
[
'PATH'
]
=
rtconfig
.
EXEC_PATH
+
";"
+
os
.
environ
[
'PATH'
]
else
:
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录