Index: build/toolchain/mac/BUILD.gn |
diff --git a/build/toolchain/mac/BUILD.gn b/build/toolchain/mac/BUILD.gn |
index 537c733e6873e3a4ed0d5609540fed92e46bae91..15edb81cb27a749472197eec58a02979d41a995b 100644 |
--- a/build/toolchain/mac/BUILD.gn |
+++ b/build/toolchain/mac/BUILD.gn |
@@ -122,7 +122,23 @@ template("mac_toolchain") { |
cc = compiler_prefix + _cc |
cxx = compiler_prefix + _cxx |
- ld = _cxx |
+ |
+ if (use_clang_static_analyzer) { |
sdefresne
2017/01/11 16:49:11
I tried to run it with goma enabled and it got stu
Kevin M
2017/01/11 18:27:46
Done.
|
+ # 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/llvm/tools/clang/tools/scan-build/libexec/ccc-analyzer", |
+ root_build_dir) |
+ cxx = analyzer_wrapper + " --clang-cxx-path=${cxx} --analyzer=" + rebase_path( |
+ "//third_party/llvm/tools/clang/tools/scan-build/libexec/c++-analyzer", |
+ root_build_dir) |
+ } |
+ |
+ ld = cxx |
linker_driver = |
"TOOL_VERSION=${tool_versions.linker_driver} " + |
@@ -170,7 +186,7 @@ template("mac_toolchain") { |
tool("cc") { |
depfile = "{{output}}.d" |
precompiled_header_type = "gcc" |
- command = "$env_wrapper $cc -MMD -MF $depfile {{defines}} {{include_dirs}} {{cflags}} {{cflags_c}} -c {{source}} -o {{output}}" |
sdefresne
2017/01/11 16:49:11
You need to restore "$env_wrapper" here otherwise
Kevin M
2017/01/11 18:27:46
Done.
|
+ command = "$cc -MMD -MF $depfile {{defines}} {{include_dirs}} {{cflags}} {{cflags_c}} -c {{source}} -o {{output}}" |
depsformat = "gcc" |
description = "CC {{output}}" |
outputs = [ |
@@ -181,7 +197,7 @@ template("mac_toolchain") { |
tool("cxx") { |
depfile = "{{output}}.d" |
precompiled_header_type = "gcc" |
- command = "$env_wrapper $cxx -MMD -MF $depfile {{defines}} {{include_dirs}} {{cflags}} {{cflags_cc}} -c {{source}} -o {{output}}" |
+ command = "$cxx -MMD -MF $depfile {{defines}} {{include_dirs}} {{cflags}} {{cflags_cc}} -c {{source}} -o {{output}}" |
depsformat = "gcc" |
description = "CXX {{output}}" |
outputs = [ |
@@ -192,7 +208,7 @@ template("mac_toolchain") { |
tool("asm") { |
# For GCC we can just use the C compiler to compile assembly. |
depfile = "{{output}}.d" |
- command = "$env_wrapper $cc -MMD -MF $depfile {{defines}} {{include_dirs}} {{asmflags}} -c {{source}} -o {{output}}" |
+ command = "$cc -MMD -MF $depfile {{defines}} {{include_dirs}} {{asmflags}} -c {{source}} -o {{output}}" |
depsformat = "gcc" |
description = "ASM {{output}}" |
outputs = [ |
@@ -203,7 +219,7 @@ template("mac_toolchain") { |
tool("objc") { |
depfile = "{{output}}.d" |
precompiled_header_type = "gcc" |
- command = "$env_wrapper $cc -MMD -MF $depfile {{defines}} {{include_dirs}} {{cflags}} {{cflags_objc}} -c {{source}} -o {{output}}" |
+ command = "$cc -MMD -MF $depfile {{defines}} {{include_dirs}} {{cflags}} {{cflags_objc}} -c {{source}} -o {{output}}" |
depsformat = "gcc" |
description = "OBJC {{output}}" |
outputs = [ |
@@ -214,7 +230,7 @@ template("mac_toolchain") { |
tool("objcxx") { |
depfile = "{{output}}.d" |
precompiled_header_type = "gcc" |
- command = "$env_wrapper $cxx -MMD -MF $depfile {{defines}} {{include_dirs}} {{cflags}} {{cflags_objcc}} -c {{source}} -o {{output}}" |
+ command = "$cxx -MMD -MF $depfile {{defines}} {{include_dirs}} {{cflags}} {{cflags_objcc}} -c {{source}} -o {{output}}" |
depsformat = "gcc" |
description = "OBJCXX {{output}}" |
outputs = [ |
@@ -438,45 +454,6 @@ mac_toolchain("clang_x64") { |
} |
} |
-mac_toolchain("clang_x86") { |
- toolchain_args = { |
- current_cpu = "x86" |
- current_os = "mac" |
- } |
-} |
- |
-mac_toolchain("clang_x86_v8_arm") { |
- toolchain_args = { |
- current_cpu = "x86" |
- v8_current_cpu = "arm" |
- current_os = "mac" |
- } |
-} |
- |
-mac_toolchain("clang_x86_v8_mipsel") { |
- toolchain_args = { |
- current_cpu = "x86" |
- v8_current_cpu = "mipsel" |
- current_os = "mac" |
- } |
-} |
- |
-mac_toolchain("clang_x64_v8_arm64") { |
- toolchain_args = { |
- current_cpu = "x64" |
- v8_current_cpu = "arm64" |
- current_os = "mac" |
- } |
-} |
- |
-mac_toolchain("clang_x64_v8_mips64el") { |
- toolchain_args = { |
- current_cpu = "x64" |
- v8_current_cpu = "mips64el" |
- current_os = "mac" |
- } |
-} |
- |
if (is_ios) { |
mac_toolchain("ios_clang_arm") { |
toolchain_args = { |