]> granicus.if.org Git - clang/commitdiff
Add hack (provided by Jonathan Sauer) to fall back to assuming Xcode is installed...
authorTed Kremenek <kremenek@apple.com>
Mon, 16 Jul 2012 21:39:29 +0000 (21:39 +0000)
committerTed Kremenek <kremenek@apple.com>
Mon, 16 Jul 2012 21:39:29 +0000 (21:39 +0000)
when using Python < 2.7.0.  This is the case on Snow Leopard, where the tools are always
installed in /Developer.  This isn't a proper fix for really figuring out where Xcode
is installed, but should work to fix an obvious problem on Snow Leopard.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160321 91177308-0d34-0410-b5e6-96231b3b80d8

tools/scan-build/set-xcode-analyzer

index 06e1d857de9112bda4a7009afee568a1a144c7c6..c280bb4d40a3f69c68ad7897e2cea5a24c40b666 100755 (executable)
@@ -75,7 +75,11 @@ def main():
     print "(+) Using the Clang bundled with Xcode"
     path = options.default
   
-  xcode_path = subprocess.check_output(["xcode-select", "-print-path"])
+  try:
+    xcode_path = subprocess.check_output(["xcode-select", "-print-path"])
+  except AttributeError:
+    # Fall back to the default install location when using Python < 2.7.0
+    xcode_path = "/Developer"
   if (re.search("Xcode.app", xcode_path)):
     # Cut off the 'Developer' dir, as the xcspec lies in another part
     # of the Xcode.app subtree.