PR 17916: Don't fail if xcrun is not present.

llvm-svn: 194745
This commit is contained in:
Joerg Sonnenberger 2013-11-14 23:18:08 +00:00
parent 4afe079663
commit 7a1ae9f1a1
1 changed files with 8 additions and 5 deletions

View File

@ -359,11 +359,14 @@ if use_gmalloc:
# On Darwin, support relocatable SDKs by providing Clang with a
# default system root path.
if 'darwin' in config.target_triple:
cmd = subprocess.Popen(['xcrun', '--show-sdk-path'],
stdout=subprocess.PIPE, stderr=subprocess.PIPE)
out, err = cmd.communicate()
out = out.strip()
res = cmd.wait()
try:
cmd = subprocess.Popen(['xcrun', '--show-sdk-path'],
stdout=subprocess.PIPE, stderr=subprocess.PIPE)
out, err = cmd.communicate()
out = out.strip()
res = cmd.wait()
except OSError:
res = -1
if res == 0 and out:
sdk_path = out
lit_config.note('using SDKROOT: %r' % sdk_path)