Index: build/toolchain/gcc_toolchain.gni |
diff --git a/build/toolchain/gcc_toolchain.gni b/build/toolchain/gcc_toolchain.gni |
index 7ee2b6ad25e011bdbba41a6f11e9e7145204771d..6102c8dd91edb56d65979c723d6d8af0306a2f23 100644 |
--- a/build/toolchain/gcc_toolchain.gni |
+++ b/build/toolchain/gcc_toolchain.gni |
@@ -8,6 +8,7 @@ import("//build/config/nacl/config.gni") |
import("//build/config/sanitizers/sanitizers.gni") |
import("//build/config/v8_target_cpu.gni") |
import("//build/toolchain/cc_wrapper.gni") |
+import("//build/toolchain/clang_static_analyzer.gni") |
import("//build/toolchain/goma.gni") |
import("//build/toolchain/toolchain.gni") |
@@ -487,6 +488,21 @@ template("clang_toolchain") { |
cxx = "$prefix/clang++" |
ld = cxx |
+ if (use_clang_static_analyzer) { |
+ # Call "ccc-analyzer" or "c++-analyzer" instead of directly calling Clang. |
+ # |wrapper_tool| sets the environment variables which are read by the |
+ # analyzer tools. |
+ analyzer_wrapper = |
+ rebase_path("//build/toolchain/clang_static_analyzer_wrapper.py", |
+ root_build_dir) |
+ cc = analyzer_wrapper + " --clang-cc-path=${cc} --analyzer=" + |
+ rebase_path("//third_party/scan-build/src/libexec/ccc-analyzer", |
+ root_build_dir) |
+ cxx = analyzer_wrapper + " --clang-cxx-path=${cxx} --analyzer=" + |
+ rebase_path("//third_party/scan-build/src/libexec/c++-analyzer", |
+ root_build_dir) |
+ } |
+ |
readelf = "${toolprefix}readelf" |
ar = "${toolprefix}ar" |
nm = "${toolprefix}nm" |