[analyzer] scan-build: If we are on MacOS, use clang as the default

compiler.

llvm-svn: 147644
This commit is contained in:
Anna Zaks 2012-01-06 01:54:05 +00:00
parent 3a7f73d996
commit 1d39152059
2 changed files with 24 additions and 4 deletions

View File

@ -27,17 +27,27 @@ use Text::ParseWords;
my $Compiler;
my $Clang;
my $DefaultCCompiler;
my $DefaultCXXCompiler;
if (`uname -a` =~ m/Darwin/) {
$DefaultCCompiler = 'clang';
$DefaultCXXCompiler = 'clang++';
} else {
$DefaultCCompiler = 'gcc';
$DefaultCXXCompiler = 'g++';
}
if ($FindBin::Script =~ /c\+\+-analyzer/) {
$Compiler = $ENV{'CCC_CXX'};
if (!defined $Compiler) { $Compiler = "g++"; }
if (!defined $Compiler) { $Compiler = $DefaultCXXCompiler; }
$Clang = $ENV{'CLANG_CXX'};
if (!defined $Clang) { $Clang = 'clang++'; }
}
else {
$Compiler = $ENV{'CCC_CC'};
if (!defined $Compiler) { $Compiler = "gcc"; }
if (!defined $Compiler) { $Compiler = $DefaultCCompiler; }
$Clang = $ENV{'CLANG'};
if (!defined $Clang) { $Clang = 'clang'; }

View File

@ -27,17 +27,27 @@ use Text::ParseWords;
my $Compiler;
my $Clang;
my $DefaultCCompiler;
my $DefaultCXXCompiler;
if (`uname -a` =~ m/Darwin/) {
$DefaultCCompiler = 'clang';
$DefaultCXXCompiler = 'clang++';
} else {
$DefaultCCompiler = 'gcc';
$DefaultCXXCompiler = 'g++';
}
if ($FindBin::Script =~ /c\+\+-analyzer/) {
$Compiler = $ENV{'CCC_CXX'};
if (!defined $Compiler) { $Compiler = "g++"; }
if (!defined $Compiler) { $Compiler = $DefaultCXXCompiler; }
$Clang = $ENV{'CLANG_CXX'};
if (!defined $Clang) { $Clang = 'clang++'; }
}
else {
$Compiler = $ENV{'CCC_CC'};
if (!defined $Compiler) { $Compiler = "gcc"; }
if (!defined $Compiler) { $Compiler = $DefaultCCompiler; }
$Clang = $ENV{'CLANG'};
if (!defined $Clang) { $Clang = 'clang'; }