]> granicus.if.org Git - clang/commitdiff
PR 17916: Don't fail if xcrun is not present.
authorJoerg Sonnenberger <joerg@bec.de>
Thu, 14 Nov 2013 23:18:08 +0000 (23:18 +0000)
committerJoerg Sonnenberger <joerg@bec.de>
Thu, 14 Nov 2013 23:18:08 +0000 (23:18 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@194745 91177308-0d34-0410-b5e6-96231b3b80d8

test/lit.cfg

index 139126db9915a15c83f668c6a3aeab47763ce318..bfac9f2415be3e45bea0cd552aa0476ed1bc4c70 100644 (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)