From: Jordan Rose Date: Tue, 27 Aug 2013 16:59:33 +0000 (+0000) Subject: scan-build: Set CC and CXX as make variables when wrapping make builds. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=33881620f4b160f020712f26df57ed39b540fcdd;p=clang scan-build: Set CC and CXX as make variables when wrapping make builds. 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 --- diff --git a/tools/scan-build/scan-build b/tools/scan-build/scan-build index 82f0e837db..4590279b15 100755 --- a/tools/scan-build/scan-build +++ b/tools/scan-build/scan-build @@ -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"); }