OLD | NEW |
1 # Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 # Copyright (c) 2013 The Chromium Authors. All rights reserved. |
2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
4 | 4 |
5 # TODO(brettw) Use "gcc_toolchain.gni" like the Linux toolchains. This requires | 5 # TODO(brettw) Use "gcc_toolchain.gni" like the Linux toolchains. This requires |
6 # some enhancements since the commands on Mac are slightly different than on | 6 # some enhancements since the commands on Mac are slightly different than on |
7 # Linux. | 7 # Linux. |
8 | 8 |
9 import("../goma.gni") | 9 import("../goma.gni") |
10 import("//build/config/clang/clang.gni") | 10 import("//build/config/clang/clang.gni") |
11 if (is_ios) { | 11 if (is_ios) { |
12 import("//build/config/ios/ios_sdk.gni") | 12 import("//build/config/ios/ios_sdk.gni") |
13 } | 13 } |
14 import("//build/config/mac/mac_sdk.gni") | 14 import("//build/config/mac/mac_sdk.gni") |
15 import("//build/config/mac/symbols.gni") | 15 import("//build/config/mac/symbols.gni") |
16 | 16 |
17 assert(host_os == "mac") | 17 assert(host_os == "mac") |
18 | 18 |
19 import("//build/toolchain/cc_wrapper.gni") | 19 import("//build/toolchain/cc_wrapper.gni") |
| 20 import("//build/toolchain/clang_static_analyzer.gni") |
20 import("//build/toolchain/goma.gni") | 21 import("//build/toolchain/goma.gni") |
21 import("//build/toolchain/toolchain.gni") | 22 import("//build/toolchain/toolchain.gni") |
22 import("//build/toolchain/concurrent_links.gni") | 23 import("//build/toolchain/concurrent_links.gni") |
23 | 24 |
24 declare_args() { | 25 declare_args() { |
25 # Reduce the number of tasks using the copy_bundle_data and compile_xcassets | 26 # Reduce the number of tasks using the copy_bundle_data and compile_xcassets |
26 # tools as they can cause lots of I/O contention when invoking ninja with a | 27 # tools as they can cause lots of I/O contention when invoking ninja with a |
27 # large number of parallel jobs (e.g. when using distributed build like goma). | 28 # large number of parallel jobs (e.g. when using distributed build like goma). |
28 bundle_pool_depth = -1 | 29 bundle_pool_depth = -1 |
29 } | 30 } |
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
115 "Goma and cc_wrapper can't be used together.") | 116 "Goma and cc_wrapper can't be used together.") |
116 compiler_prefix = "$goma_dir/gomacc " | 117 compiler_prefix = "$goma_dir/gomacc " |
117 } else if (toolchain_cc_wrapper != "") { | 118 } else if (toolchain_cc_wrapper != "") { |
118 compiler_prefix = toolchain_cc_wrapper + " " | 119 compiler_prefix = toolchain_cc_wrapper + " " |
119 } else { | 120 } else { |
120 compiler_prefix = "" | 121 compiler_prefix = "" |
121 } | 122 } |
122 | 123 |
123 cc = compiler_prefix + _cc | 124 cc = compiler_prefix + _cc |
124 cxx = compiler_prefix + _cxx | 125 cxx = compiler_prefix + _cxx |
125 ld = _cxx | 126 |
| 127 if (use_clang_static_analyzer && !toolchain_uses_goma) { |
| 128 # Call "ccc-analyzer" or "c++-analyzer" instead of directly calling Clang. |
| 129 # |wrapper_tool| sets the environment variables which are read by the |
| 130 # analyzer tools. |
| 131 analyzer_wrapper = |
| 132 rebase_path("//build/toolchain/clang_static_analyzer_wrapper.py", |
| 133 root_build_dir) |
| 134 cc = analyzer_wrapper + " --clang-cc-path=${cc} --analyzer=" + |
| 135 rebase_path("//third_party/scan-build/src/libexec/ccc-analyzer", |
| 136 root_build_dir) |
| 137 cxx = analyzer_wrapper + " --clang-cxx-path=${cxx} --analyzer=" + |
| 138 rebase_path("//third_party/scan-build/src/libexec/c++-analyzer", |
| 139 root_build_dir) |
| 140 } |
| 141 |
| 142 ld = cxx |
126 | 143 |
127 linker_driver = | 144 linker_driver = |
128 "TOOL_VERSION=${tool_versions.linker_driver} " + | 145 "TOOL_VERSION=${tool_versions.linker_driver} " + |
129 rebase_path("//build/toolchain/mac/linker_driver.py", root_build_dir) | 146 rebase_path("//build/toolchain/mac/linker_driver.py", root_build_dir) |
130 | 147 |
131 # On iOS, the final applications are assembled using lipo (to support fat | 148 # On iOS, the final applications are assembled using lipo (to support fat |
132 # builds). The correct flags are passed to the linker_driver.py script | 149 # builds). The correct flags are passed to the linker_driver.py script |
133 # directly during the lipo call. | 150 # directly during the lipo call. |
134 if (toolchain_args.current_os != "ios") { | 151 if (toolchain_args.current_os != "ios") { |
135 _enable_dsyms = enable_dsyms | 152 _enable_dsyms = enable_dsyms |
(...skipping 363 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
499 } | 516 } |
500 } | 517 } |
501 | 518 |
502 mac_toolchain("ios_clang_x64") { | 519 mac_toolchain("ios_clang_x64") { |
503 toolchain_args = { | 520 toolchain_args = { |
504 current_cpu = "x64" | 521 current_cpu = "x64" |
505 current_os = "ios" | 522 current_os = "ios" |
506 } | 523 } |
507 } | 524 } |
508 } | 525 } |
OLD | NEW |