diff options
| author | Jordan Rose <jordan_rose@apple.com> | 2013-05-22 18:09:57 +0000 | 
|---|---|---|
| committer | Jordan Rose <jordan_rose@apple.com> | 2013-05-22 18:09:57 +0000 | 
| commit | d8fb478b36377ddd2ac11f73906b5a350f9cdd4c (patch) | |
| tree | 37f98a59f984efea84a0da151e75fc0c8f5fde0b | |
| parent | 1bfe9c787f3eea44b7430bfe62d0cb1286b34e47 (diff) | |
| download | bcm5719-llvm-d8fb478b36377ddd2ac11f73906b5a350f9cdd4c.tar.gz bcm5719-llvm-d8fb478b36377ddd2ac11f73906b5a350f9cdd4c.zip | |
scan-build: use the xcodebuild specified by the user.
This is important if the user has multiple Xcodes installed on their
system -- we use xcodebuild to do a version check, and therefore we need
to make sure we match the actual build command.
Reported by Howard Ling!
llvm-svn: 182498
| -rwxr-xr-x | clang/tools/scan-build/scan-build | 13 | 
1 files changed, 4 insertions, 9 deletions
| diff --git a/clang/tools/scan-build/scan-build b/clang/tools/scan-build/scan-build index 35f852e70b2..803c0735110 100755 --- a/clang/tools/scan-build/scan-build +++ b/clang/tools/scan-build/scan-build @@ -910,7 +910,7 @@ sub RunXcodebuild {    # Detect the version of Xcode.  If Xcode 4.6 or higher, use new    # in situ support for analyzer interposition without needed to override    # the compiler. -  open(DETECT_XCODE, "xcodebuild -version |") or +  open(DETECT_XCODE, "-|", $Args->[0], "-version") or      die "error: cannot detect version of xcodebuild\n";    my $oldBehavior = 1; @@ -976,16 +976,11 @@ sub RunBuildCommand {    my $CCAnalyzer = shift;    my $CXXAnalyzer = shift;    my $Options = shift; -   -  # Get only the part of the command after the last '/'. -  if ($Cmd =~ /\/([^\/]+)$/) { -    $Cmd = $1; -  } -   -  if ($Cmd eq "xcodebuild") { + +  if ($Cmd =~ /\bxcodebuild$/) {      return RunXcodebuild($Args, $IgnoreErrors, $CCAnalyzer, $CXXAnalyzer, $Options);    } -   +    # Setup the environment.    SetEnv($Options); | 

