]> granicus.if.org Git - clang/commitdiff
scan-build: Disable distributed builds for xcodebuild
authorTed Kremenek <kremenek@apple.com>
Wed, 30 Apr 2008 23:47:12 +0000 (23:47 +0000)
committerTed Kremenek <kremenek@apple.com>
Wed, 30 Apr 2008 23:47:12 +0000 (23:47 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50506 91177308-0d34-0410-b5e6-96231b3b80d8

utils/scan-build

index 0eb798026c3a2a0c3e203924512c5b275c9ba169..0024c8ec366bc53ddfeefe56ed0a8544a08db011 100755 (executable)
@@ -390,6 +390,23 @@ ENDTEXT
 # RunBuildCommand - Run the build command.
 ##----------------------------------------------------------------------------##
 
+sub AddIfNotPresent {
+  my $Args = shift;
+  my $Arg = shift;  
+  my $found = 0;
+  
+  foreach my $k (@$Args) {
+    if ($k eq $Arg) {
+      $found = 1;
+      last;
+    }
+  }
+  
+  if ($found == 0) {
+    push @$Args, $Arg;
+  }
+}
+
 sub RunBuildCommand {
   
   my $Args = shift;
@@ -402,12 +419,17 @@ sub RunBuildCommand {
   }
   elsif ($IgnoreErrors) {
     if ($Cmd eq "make" or $Cmd eq "gmake") {
-      push @$Args, "-k";
+      AddIfNotPresent($Args,"-k");
     }
     elsif ($Cmd eq "xcodebuild") {
-      push @$Args, "-PBXBuildsContinueAfterErrors=YES";
+      AddIfNotPresent($Args,"-PBXBuildsContinueAfterErrors=YES");
     }
-  }  
+  } 
+  
+  # Disable distributed builds for xcodebuild.
+  if ($Cmd eq "xcodebuild") {
+    AddIfNotPresent($Args,"-nodistribute");
+  }
   
   system(@$Args);
 }