From 44f279e68f718af57dd052f9bb5dd0a57a37ce92 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Eloy=20Dur=C3=A1n?= Date: Tue, 12 Nov 2013 22:09:57 +0100 Subject: [PATCH] [analyzer] Ensure normal builds have a clean env and set DEBUG. --- Rakefile | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/Rakefile b/Rakefile index 7e527f46..bd04f641 100644 --- a/Rakefile +++ b/Rakefile @@ -49,6 +49,9 @@ task :all => :build targets.each do |target| desc "Build target #{target}" task "build:#{target}" do + unless ENV['CCC_ANALYZER_ANALYSIS'] + ENV['CC'] = ENV['CXX'] = nil + end rake(target) end end @@ -58,9 +61,8 @@ task :build => targets.map { |x| "build:#{x}" } desc "Run the clang static analyzer against the source" task :analyze do - sh './static-analyzer/scan-build --keep-empty --use-analyzer=/usr/bin/clang -o ./static-analysis rake' - results = Dir.glob('static-analysis/*').sort_by { |path| File.mtime(path) }.last - sh "./static-analyzer/scan-view #{results}" + ENV['DEBUG'] = '1' + sh './static-analyzer/scan-build --view --use-analyzer=/usr/bin/clang --use-cc=/usr/bin/clang --use-c++=/usr/bin/clang++ -o ./static-analysis rake' end targets.each do |target|