Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(577)

Unified Diff: build/toolchain/gcc_toolchain.gni

Issue 2617283002: Add Clang static analyzer to Clang toolchain defs in GN (Closed)
Patch Set: rebase Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « build/toolchain/clang_static_analyzer_wrapper.py ('k') | build/toolchain/mac/BUILD.gn » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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"
« no previous file with comments | « build/toolchain/clang_static_analyzer_wrapper.py ('k') | build/toolchain/mac/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698