Skip to content
项目
群组
代码片段
帮助
正在加载...
登录
切换导航
M
mediasoup
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
聂卓夫
mediasoup
Commits
f741a1c9
Unverified
提交
f741a1c9
authored
6月 02, 2020
作者:
Rocky LUO
提交者:
GitHub
6月 02, 2020
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix CLT detection without XCode install (#413)
上级
3a1232b7
隐藏空白字符变更
内嵌
并排
正在显示
1 个修改的文件
包含
17 行增加
和
14 行删除
+17
-14
xcode_emulation.py
worker/deps/gyp/pylib/gyp/xcode_emulation.py
+17
-14
没有找到文件。
worker/deps/gyp/pylib/gyp/xcode_emulation.py
浏览文件 @
f741a1c9
...
...
@@ -1396,6 +1396,8 @@ def XcodeVersion():
global
XCODE_VERSION_CACHE
if
XCODE_VERSION_CACHE
:
return
XCODE_VERSION_CACHE
version
=
""
build
=
""
try
:
version_list
=
GetStdout
([
'xcodebuild'
,
'-version'
])
.
splitlines
()
# In some circumstances xcodebuild exits 0 but doesn't return
...
...
@@ -1405,21 +1407,16 @@ def XcodeVersion():
# checking that version.
if
len
(
version_list
)
<
2
:
raise
GypError
(
"xcodebuild returned unexpected results"
)
except
:
version
=
CLTVersion
()
if
version
:
version
=
re
.
match
(
r'(\d\.\d\.?\d*)'
,
version
)
.
groups
()[
0
]
else
:
version
=
version_list
[
0
]
.
split
()[
-
1
]
# Last word on first line
build
=
version_list
[
-
1
]
.
split
()[
-
1
]
# Last word on last line
except
GypError
:
# Xcode not installed so look for CLT
version
=
CLTVersion
()
# OS X 10.15 may returns 11.0.0.0.xxx or 11.5
if
not
version
:
raise
GypError
(
"No Xcode or CLT version detected!"
)
# The CLT has no build information, so we return an empty string.
version_list
=
[
version
,
''
]
version
=
version_list
[
0
]
build
=
version_list
[
-
1
]
# Be careful to convert "4.2" to "0420":
version
=
version
.
split
()[
-
1
]
.
replace
(
'.'
,
''
)
version
=
(
version
+
'0'
*
(
3
-
len
(
version
)))
.
zfill
(
4
)
if
build
:
build
=
build
.
split
()[
-
1
]
# Be careful to convert "4.2" to "0420" and "11.0.0" to "1100":
version
=
version
.
split
(
"."
)[:
3
]
# Just major, minor, micro
version
[
0
]
=
version
[
0
]
.
zfill
(
2
)
# Add a leading zero if major is one digit
version
=
(
""
.
join
(
version
)
+
"00"
)[:
4
]
# Limit to exactly four characters
XCODE_VERSION_CACHE
=
(
version
,
build
)
return
XCODE_VERSION_CACHE
...
...
@@ -1446,6 +1443,12 @@ def CLTVersion():
except
:
continue
regex
=
re
.
compile
(
'Command Line Tools for Xcode
\
s+(?P<version>
\
S+)'
)
try
:
output
=
GetStdout
([
'/usr/sbin/softwareupdate'
,
'--history'
])
return
re
.
search
(
regex
,
output
)
.
groupdict
()[
'version'
]
except
(
GypError
,
OSError
):
return
None
def
GetStdout
(
cmdlist
):
"""Returns the content of standard output returned by invoking |cmdlist|.
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论