| 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/goma.gni") | 9 import("//build/toolchain/goma.gni") |
| 10 import("//build/toolchain/toolchain.gni") | 10 import("//build/toolchain/toolchain.gni") |
| 11 | 11 |
| 12 # Should only be running on Windows. | 12 # Should only be running on Windows. |
| 13 assert(is_win) | 13 assert(is_win) |
| 14 | 14 |
| 15 # Setup the Visual Studio state. | 15 # Setup the Visual Studio state. |
| 16 # | 16 # |
| 17 # Its arguments are the VS path and the compiler wrapper tool. It will write | 17 # 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 | 18 # "environment.x86" and "environment.x64" to the build directory and return a |
| 19 # list to us. | 19 # list to us. |
| 20 | 20 |
| 21 # TODO bug 642014 remove this when all users of the script have been removed. |
| 22 gyp_win_tool_path = |
| 23 rebase_path("//tools/gyp/pylib/gyp/win_tool.py", root_build_dir) |
| 24 |
| 21 # This tool will is used as a wrapper for various commands below. | 25 # This tool will is used as a wrapper for various commands below. |
| 22 tool_wrapper_path = rebase_path("tool_wrapper.py", root_build_dir) | 26 tool_wrapper_path = rebase_path("tool_wrapper.py", root_build_dir) |
| 23 | 27 |
| 24 if (use_goma) { | 28 if (use_goma) { |
| 25 goma_prefix = "$goma_dir/gomacc.exe " | 29 goma_prefix = "$goma_dir/gomacc.exe " |
| 26 } else { | 30 } else { |
| 27 goma_prefix = "" | 31 goma_prefix = "" |
| 28 } | 32 } |
| 29 | 33 |
| 30 # Copy the VS runtime DLL for the default toolchain to the root build directory | 34 # Copy the VS runtime DLL for the default toolchain to the root build directory |
| (...skipping 276 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 307 clang_cl = "clang-cl" | 311 clang_cl = "clang-cl" |
| 308 } | 312 } |
| 309 | 313 |
| 310 # 32-bit toolchains. Only define these when the target architecture is 32-bit | 314 # 32-bit toolchains. Only define these when the target architecture is 32-bit |
| 311 # since we don't do any 32-bit cross compiles when targeting 64-bit (the | 315 # since we don't do any 32-bit cross compiles when targeting 64-bit (the |
| 312 # build does generate some 64-bit stuff from 32-bit target builds). | 316 # build does generate some 64-bit stuff from 32-bit target builds). |
| 313 if (target_cpu == "x86") { | 317 if (target_cpu == "x86") { |
| 314 x86_toolchain_data = exec_script("setup_toolchain.py", | 318 x86_toolchain_data = exec_script("setup_toolchain.py", |
| 315 [ | 319 [ |
| 316 visual_studio_path, | 320 visual_studio_path, |
| 321 gyp_win_tool_path, |
| 317 windows_sdk_path, | 322 windows_sdk_path, |
| 318 visual_studio_runtime_dirs, | 323 visual_studio_runtime_dirs, |
| 319 "x86", | 324 "x86", |
| 320 "${sys_include_prefix}", | 325 "${sys_include_prefix}", |
| 321 ], | 326 ], |
| 322 "scope") | 327 "scope") |
| 323 | 328 |
| 324 msvc_toolchain("x86") { | 329 msvc_toolchain("x86") { |
| 325 environment = "environment.x86" | 330 environment = "environment.x86" |
| 326 cl = "${goma_prefix}\"${x86_toolchain_data.vc_bin_dir}/cl.exe\"" | 331 cl = "${goma_prefix}\"${x86_toolchain_data.vc_bin_dir}/cl.exe\"" |
| (...skipping 13 matching lines...) Expand all Loading... |
| 340 current_cpu = "x86" | 345 current_cpu = "x86" |
| 341 is_clang = true | 346 is_clang = true |
| 342 } | 347 } |
| 343 } | 348 } |
| 344 } | 349 } |
| 345 | 350 |
| 346 # 64-bit toolchains. | 351 # 64-bit toolchains. |
| 347 x64_toolchain_data = exec_script("setup_toolchain.py", | 352 x64_toolchain_data = exec_script("setup_toolchain.py", |
| 348 [ | 353 [ |
| 349 visual_studio_path, | 354 visual_studio_path, |
| 355 gyp_win_tool_path, |
| 350 windows_sdk_path, | 356 windows_sdk_path, |
| 351 visual_studio_runtime_dirs, | 357 visual_studio_runtime_dirs, |
| 352 "x64", | 358 "x64", |
| 353 "${sys_include_prefix}", | 359 "${sys_include_prefix}", |
| 354 ], | 360 ], |
| 355 "scope") | 361 "scope") |
| 356 | 362 |
| 357 template("win_x64_toolchains") { | 363 template("win_x64_toolchains") { |
| 358 msvc_toolchain(target_name) { | 364 msvc_toolchain(target_name) { |
| 359 environment = "environment.x64" | 365 environment = "environment.x64" |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 421 msvc_toolchain("winrt_x64") { | 427 msvc_toolchain("winrt_x64") { |
| 422 environment = "environment.winrt_x64" | 428 environment = "environment.winrt_x64" |
| 423 cl = "${goma_prefix}\"${vc_bin_dir}/cl.exe\"" | 429 cl = "${goma_prefix}\"${vc_bin_dir}/cl.exe\"" |
| 424 | 430 |
| 425 toolchain_args = { | 431 toolchain_args = { |
| 426 is_clang = false | 432 is_clang = false |
| 427 current_cpu = "x64" | 433 current_cpu = "x64" |
| 428 } | 434 } |
| 429 } | 435 } |
| 430 } | 436 } |
| OLD | NEW |