| 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 |
| 19 # list to us. | 20 # list to us. |
| 20 | 21 |
| 21 # This tool will is used as a wrapper for various commands below. | 22 # This tool will is used as a wrapper for various commands below. |
| 22 tool_wrapper_path = rebase_path("tool_wrapper.py", root_build_dir) | 23 tool_wrapper_path = rebase_path("tool_wrapper.py", root_build_dir) |
| 23 | 24 |
| 24 if (use_goma) { | 25 if (use_goma) { |
| 25 goma_prefix = "$goma_dir/gomacc.exe " | 26 goma_prefix = "$goma_dir/gomacc.exe " |
| 26 } else { | 27 } else { |
| 27 goma_prefix = "" | 28 goma_prefix = "" |
| 28 } | 29 } |
| 29 | 30 |
| 31 # Path to the Clang static analysis wrapper script. |
| 32 if (is_clang && use_clang_static_analyzer) { |
| 33 analyzer_prefix = "$python_path " + rebase_path( |
| 34 "//build/toolchain/clang_static_analyzer_wrapper.py", |
| 35 root_build_dir) + " --clang-prefix=\"-Xclang\" " |
| 36 } |
| 37 |
| 30 # Copy the VS runtime DLL for the default toolchain to the root build directory | 38 # Copy the VS runtime DLL for the default toolchain to the root build directory |
| 31 # so things will run. | 39 # so things will run. |
| 32 if (current_toolchain == default_toolchain) { | 40 if (current_toolchain == default_toolchain) { |
| 33 if (is_debug) { | 41 if (is_debug) { |
| 34 configuration_name = "Debug" | 42 configuration_name = "Debug" |
| 35 } else { | 43 } else { |
| 36 configuration_name = "Release" | 44 configuration_name = "Release" |
| 37 } | 45 } |
| 38 exec_script("../../vs_toolchain.py", | 46 exec_script("../../vs_toolchain.py", |
| 39 [ | 47 [ |
| (...skipping 333 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 373 forward_variables_from(invoker.toolchain_args, "*") | 381 forward_variables_from(invoker.toolchain_args, "*") |
| 374 } | 382 } |
| 375 is_clang = false | 383 is_clang = false |
| 376 current_cpu = "x64" | 384 current_cpu = "x64" |
| 377 } | 385 } |
| 378 } | 386 } |
| 379 | 387 |
| 380 msvc_toolchain("clang_" + target_name) { | 388 msvc_toolchain("clang_" + target_name) { |
| 381 environment = "environment.x64" | 389 environment = "environment.x64" |
| 382 prefix = rebase_path("$clang_base_path/bin", root_build_dir) | 390 prefix = rebase_path("$clang_base_path/bin", root_build_dir) |
| 383 cl = "${goma_prefix}$prefix/${clang_cl}" | 391 cl = "${analyzer_prefix}${goma_prefix}$prefix/${clang_cl}" |
| 384 sys_include_flags = "${x64_toolchain_data.include_flags_imsvc}" | 392 sys_include_flags = "${x64_toolchain_data.include_flags_imsvc}" |
| 385 | 393 |
| 386 toolchain_args = { | 394 toolchain_args = { |
| 387 if (defined(invoker.toolchain_args)) { | 395 if (defined(invoker.toolchain_args)) { |
| 388 forward_variables_from(invoker.toolchain_args, "*") | 396 forward_variables_from(invoker.toolchain_args, "*") |
| 389 } | 397 } |
| 390 is_clang = true | 398 is_clang = true |
| 391 current_cpu = "x64" | 399 current_cpu = "x64" |
| 392 } | 400 } |
| 393 } | 401 } |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 430 msvc_toolchain("winrt_x64") { | 438 msvc_toolchain("winrt_x64") { |
| 431 environment = "environment.winrt_x64" | 439 environment = "environment.winrt_x64" |
| 432 cl = "${goma_prefix}\"${vc_bin_dir}/cl.exe\"" | 440 cl = "${goma_prefix}\"${vc_bin_dir}/cl.exe\"" |
| 433 | 441 |
| 434 toolchain_args = { | 442 toolchain_args = { |
| 435 is_clang = false | 443 is_clang = false |
| 436 current_cpu = "x64" | 444 current_cpu = "x64" |
| 437 } | 445 } |
| 438 } | 446 } |
| 439 } | 447 } |
| OLD | NEW |