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/sanitizers/sanitizers.gni") | 5 import("//build/config/sanitizers/sanitizers.gni") |
6 import("//build/config/win/visual_studio_version.gni") | 6 import("//build/config/win/visual_studio_version.gni") |
7 import("//build/toolchain/goma.gni") | 7 import("//build/toolchain/goma.gni") |
8 import("//build/toolchain/toolchain.gni") | 8 import("//build/toolchain/toolchain.gni") |
9 | 9 |
10 # Should only be running on Windows. | 10 # Should only be running on Windows. |
(...skipping 220 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
231 } | 231 } |
232 | 232 |
233 # When invoking this toolchain not as the default one, these args will be | 233 # When invoking this toolchain not as the default one, these args will be |
234 # passed to the build. They are ignored when this is the default toolchain. | 234 # passed to the build. They are ignored when this is the default toolchain. |
235 toolchain_args() { | 235 toolchain_args() { |
236 current_cpu = invoker.toolchain_cpu | 236 current_cpu = invoker.toolchain_cpu |
237 if (defined(invoker.toolchain_os)) { | 237 if (defined(invoker.toolchain_os)) { |
238 current_os = invoker.toolchain_os | 238 current_os = invoker.toolchain_os |
239 } | 239 } |
240 | 240 |
241 forward_variables_from(invoker, | 241 # These share a name with global variables that are already defined, and |
242 [ | 242 # forward_variables_from won't clobber the existing value, so we need to |
243 "is_clang", | 243 # set it explicitly. |
244 "is_component_build", | 244 if (defined(invoker.is_clang)) { |
245 ]) | 245 is_clang = invoker.is_clang |
| 246 } |
| 247 if (defined(invoker.is_component_build)) { |
| 248 is_component_build = invoker.is_component_build |
| 249 } |
246 | 250 |
247 # This value needs to be passed through unchanged. | 251 # This value needs to be passed through unchanged. |
248 host_toolchain = host_toolchain | 252 host_toolchain = host_toolchain |
249 } | 253 } |
250 } | 254 } |
251 } | 255 } |
252 | 256 |
253 if (host_os == "win") { | 257 if (host_os == "win") { |
254 clang_cl = "clang-cl.exe" | 258 clang_cl = "clang-cl.exe" |
255 } else { | 259 } else { |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
306 goma_prefix = invoker.goma_prefix | 310 goma_prefix = invoker.goma_prefix |
307 x64_toolchain_data = invoker.x64_toolchain_data | 311 x64_toolchain_data = invoker.x64_toolchain_data |
308 clang_cl = invoker.clang_cl | 312 clang_cl = invoker.clang_cl |
309 | 313 |
310 msvc_toolchain(target_name) { | 314 msvc_toolchain(target_name) { |
311 environment = "environment.x64" | 315 environment = "environment.x64" |
312 toolchain_cpu = "x64" | 316 toolchain_cpu = "x64" |
313 cl = "${goma_prefix}\"${x64_toolchain_data.vc_bin_dir}/cl.exe\"" | 317 cl = "${goma_prefix}\"${x64_toolchain_data.vc_bin_dir}/cl.exe\"" |
314 is_clang = false | 318 is_clang = false |
315 | 319 |
316 forward_variables_from(invoker, [ "is_component_build" ]) | 320 # This shares a name with a global and forward_variables_from won't clobber |
| 321 # the existing value, so we need to set it explicitly. |
| 322 if (defined(invoker.is_component_build)) { |
| 323 is_component_build = invoker.is_component_build |
| 324 } |
317 } | 325 } |
318 | 326 |
319 msvc_toolchain("clang_" + target_name) { | 327 msvc_toolchain("clang_" + target_name) { |
320 environment = "environment.x64" | 328 environment = "environment.x64" |
321 toolchain_cpu = "x64" | 329 toolchain_cpu = "x64" |
322 prefix = rebase_path("//third_party/llvm-build/Release+Asserts/bin", | 330 prefix = rebase_path("//third_party/llvm-build/Release+Asserts/bin", |
323 root_build_dir) | 331 root_build_dir) |
324 cl = "${goma_prefix}$prefix/${clang_cl}" | 332 cl = "${goma_prefix}$prefix/${clang_cl}" |
325 toolchain_os = "win" | 333 toolchain_os = "win" |
326 is_clang = true | 334 is_clang = true |
327 | 335 |
328 forward_variables_from(invoker, [ "is_component_build" ]) | 336 # This shares a name with a global and forward_variables_from won't clobber |
| 337 # the existing value, so we need to set it explicitly. |
| 338 if (defined(invoker.is_component_build)) { |
| 339 is_component_build = invoker.is_component_build |
| 340 } |
329 } | 341 } |
330 } | 342 } |
331 | 343 |
332 win_x64_toolchains("x64") { | 344 win_x64_toolchains("x64") { |
333 # TODO(mcgrathr): These assignments are only required because of | 345 # TODO(mcgrathr): These assignments are only required because of |
334 # crbug.com/395883. Drop them if that ever gets fixed in GN. | 346 # crbug.com/395883. Drop them if that ever gets fixed in GN. |
335 concurrent_links = concurrent_links | 347 concurrent_links = concurrent_links |
336 goma_prefix = goma_prefix | 348 goma_prefix = goma_prefix |
337 x64_toolchain_data = x64_toolchain_data | 349 x64_toolchain_data = x64_toolchain_data |
338 } | 350 } |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
371 | 383 |
372 msvc_toolchain("winrt_x64") { | 384 msvc_toolchain("winrt_x64") { |
373 environment = "environment.winrt_x64" | 385 environment = "environment.winrt_x64" |
374 cl = "${goma_prefix}\"${vc_bin_dir}/cl.exe\"" | 386 cl = "${goma_prefix}\"${vc_bin_dir}/cl.exe\"" |
375 is_clang = false | 387 is_clang = false |
376 | 388 |
377 toolchain_cpu = "x64" | 389 toolchain_cpu = "x64" |
378 toolchain_os = current_os | 390 toolchain_os = current_os |
379 } | 391 } |
380 } | 392 } |
OLD | NEW |