]> granicus.if.org Git - clang/commitdiff
scan-build: Set CC and CXX as make variables when wrapping make builds.
authorJordan Rose <jordan_rose@apple.com>
Tue, 27 Aug 2013 16:59:33 +0000 (16:59 +0000)
committerJordan Rose <jordan_rose@apple.com>
Tue, 27 Aug 2013 16:59:33 +0000 (16:59 +0000)
Variables set in a makefile are not overridden by environment variables.
Make sure we actually override CC and CXX when using scan-build.

Patch by Steve McCoy!

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

tools/scan-build/scan-build

index 82f0e837db8c07a5df78f1b639511f05109316c1..4590279b1569157a4799eda3e786d9e0524ff58c 100755 (executable)
@@ -1018,10 +1018,10 @@ sub RunBuildCommand {
     shift @$Args;
     unshift @$Args, $CXXAnalyzer;
   }
-  elsif ($IgnoreErrors) {
-    if ($Cmd eq "make" or $Cmd eq "gmake") {
-      AddIfNotPresent($Args, "CC=$CCAnalyzer");
-      AddIfNotPresent($Args, "CXX=$CXXAnalyzer");
+  elsif ($Cmd eq "make" or $Cmd eq "gmake") {
+    AddIfNotPresent($Args, "CC=$CCAnalyzer");
+    AddIfNotPresent($Args, "CXX=$CXXAnalyzer");
+    if ($IgnoreErrors) {
       AddIfNotPresent($Args,"-k");
       AddIfNotPresent($Args,"-i");
     }