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 import("//build/config/clang/clang.gni") | 5 import("//build/config/clang/clang.gni") |
6 import("//build/config/compiler/compiler.gni") | 6 import("//build/config/compiler/compiler.gni") |
7 import("//build/config/sanitizers/sanitizers.gni") | 7 import("//build/config/sanitizers/sanitizers.gni") |
8 import("//build/config/win/visual_studio_version.gni") | 8 import("//build/config/win/visual_studio_version.gni") |
| 9 import("//build/toolchain/clang_static_analyzer.gni") |
9 import("//build/toolchain/goma.gni") | 10 import("//build/toolchain/goma.gni") |
10 import("//build/toolchain/toolchain.gni") | 11 import("//build/toolchain/toolchain.gni") |
11 | 12 |
12 # Should only be running on Windows. | 13 # Should only be running on Windows. |
13 assert(is_win) | 14 assert(is_win) |
14 | 15 |
15 # Setup the Visual Studio state. | 16 # Setup the Visual Studio state. |
16 # | 17 # |
17 # Its arguments are the VS path and the compiler wrapper tool. It will write | 18 # Its arguments are the VS path and the compiler wrapper tool. It will write |
18 # "environment.x86" and "environment.x64" to the build directory and return a | 19 # "environment.x86" and "environment.x64" to the build directory and return a |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
88 if (toolchain_uses_clang && host_os != "win") { | 89 if (toolchain_uses_clang && host_os != "win") { |
89 # This toolchain definition uses response files for compilations. GN uses | 90 # This toolchain definition uses response files for compilations. GN uses |
90 # the quoting rules of the host OS, while clang-cl always defaults to | 91 # the quoting rules of the host OS, while clang-cl always defaults to |
91 # cmd.exe quoting rules for parsing response files. Tell clang-cl to use | 92 # cmd.exe quoting rules for parsing response files. Tell clang-cl to use |
92 # POSIX quoting rules, so it can understand what GN generates. | 93 # POSIX quoting rules, so it can understand what GN generates. |
93 cl = "${invoker.cl} --rsp-quoting=posix" | 94 cl = "${invoker.cl} --rsp-quoting=posix" |
94 } else { | 95 } else { |
95 cl = invoker.cl | 96 cl = invoker.cl |
96 } | 97 } |
97 | 98 |
| 99 if (toolchain_uses_clang && use_clang_static_analyzer) { |
| 100 analyzer_prefix = |
| 101 "$python_path " + |
| 102 rebase_path("//build/toolchain/clang_static_analyzer_wrapper.py", |
| 103 root_build_dir) + " --mode=cl" |
| 104 cl = "${analyzer_prefix} ${cl}" |
| 105 } |
| 106 |
98 if (use_lld) { | 107 if (use_lld) { |
99 if (host_os == "win") { | 108 if (host_os == "win") { |
100 lld_link = "lld-link.exe" | 109 lld_link = "lld-link.exe" |
101 } else { | 110 } else { |
102 lld_link = "lld-link" | 111 lld_link = "lld-link" |
103 } | 112 } |
104 prefix = rebase_path("$clang_base_path/bin", root_build_dir) | 113 prefix = rebase_path("$clang_base_path/bin", root_build_dir) |
105 | 114 |
106 # lld-link includes a replacement for lib.exe that can produce thin | 115 # lld-link includes a replacement for lib.exe that can produce thin |
107 # archives and understands bitcode (for lto builds). | 116 # archives and understands bitcode (for lto builds). |
(...skipping 322 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
430 msvc_toolchain("winrt_x64") { | 439 msvc_toolchain("winrt_x64") { |
431 environment = "environment.winrt_x64" | 440 environment = "environment.winrt_x64" |
432 cl = "${goma_prefix}\"${vc_bin_dir}/cl.exe\"" | 441 cl = "${goma_prefix}\"${vc_bin_dir}/cl.exe\"" |
433 | 442 |
434 toolchain_args = { | 443 toolchain_args = { |
435 is_clang = false | 444 is_clang = false |
436 current_cpu = "x64" | 445 current_cpu = "x64" |
437 } | 446 } |
438 } | 447 } |
439 } | 448 } |
OLD | NEW |