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

Unified Diff: build/toolchain/mac/BUILD.gn

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/gcc_toolchain.gni ('k') | build/toolchain/wrapper_utils.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: build/toolchain/mac/BUILD.gn
diff --git a/build/toolchain/mac/BUILD.gn b/build/toolchain/mac/BUILD.gn
index 537c733e6873e3a4ed0d5609540fed92e46bae91..8de58cef3654ce64df7d07bfdd3fc932717fc082 100644
--- a/build/toolchain/mac/BUILD.gn
+++ b/build/toolchain/mac/BUILD.gn
@@ -17,6 +17,7 @@ import("//build/config/mac/symbols.gni")
assert(host_os == "mac")
import("//build/toolchain/cc_wrapper.gni")
+import("//build/toolchain/clang_static_analyzer.gni")
import("//build/toolchain/goma.gni")
import("//build/toolchain/toolchain.gni")
import("//build/toolchain/concurrent_links.gni")
@@ -122,7 +123,23 @@ template("mac_toolchain") {
cc = compiler_prefix + _cc
cxx = compiler_prefix + _cxx
- ld = _cxx
+
+ if (use_clang_static_analyzer && !toolchain_uses_goma) {
+ # 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)
+ }
+
+ ld = cxx
linker_driver =
"TOOL_VERSION=${tool_versions.linker_driver} " +
« no previous file with comments | « build/toolchain/gcc_toolchain.gni ('k') | build/toolchain/wrapper_utils.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698