Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1133)

Unified Diff: build/toolchain/win/BUILD.gn

Issue 1428123003: Clean up Windows GN toolchains (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | cloud_print/BUILD.gn » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: build/toolchain/win/BUILD.gn
diff --git a/build/toolchain/win/BUILD.gn b/build/toolchain/win/BUILD.gn
index 4b550525712c3aadc8510cc327c76da692e387e5..c0ab4f35ff13b5dbf007bcd2038cfcc545445b69 100644
--- a/build/toolchain/win/BUILD.gn
+++ b/build/toolchain/win/BUILD.gn
@@ -2,15 +2,6 @@
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
-declare_args() {
- # Path to the directory containing the VC binaries for the right
- # combination of host and target architectures. Currently only the
- # 64-bit host toolchain is supported, with either 32-bit or 64-bit targets.
- # If vc_bin_dir is not specified on the command line (and it normally
- # isn't), we will dynamically determine the right value to use at runtime.
- vc_bin_dir = ""
-}
-
import("//build/config/win/visual_studio_version.gni")
import("//build/toolchain/goma.gni")
import("//build/toolchain/toolchain.gni")
@@ -26,20 +17,6 @@ assert(is_win)
gyp_win_tool_path =
rebase_path("//tools/gyp/pylib/gyp/win_tool.py", root_build_dir)
-toolchain_data = exec_script("setup_toolchain.py",
- [
- visual_studio_path,
- gyp_win_tool_path,
- windows_sdk_path,
- visual_studio_runtime_dirs,
- current_cpu,
- ],
- "scope")
-
-if (vc_bin_dir == "") {
- vc_bin_dir = toolchain_data.vc_bin_dir
-}
-
if (use_goma) {
goma_prefix = "$goma_dir/gomacc.exe "
} else {
@@ -244,17 +221,27 @@ template("msvc_toolchain") {
}
}
-# TODO(dpranke): Declare both toolchains all of the time when we
-# get it sorted out how we want to support them both in a single build.
-# Right now only one of these can be enabled at a time because the
-# runtime libraries get copied to root_build_dir and would collide.
-if (current_cpu == "x86") {
+# 32-bit toolchains. Only define these when the target architecture is 32-bit
+# since we don't do any 32-bit cross compiles when targeting 64-bit (the
+# build does generate some 64-bit stuff from 32-bit target builds).
+if (target_cpu == "x86") {
+ x86_toolchain_data = exec_script("setup_toolchain.py",
+ [
+ visual_studio_path,
+ gyp_win_tool_path,
+ windows_sdk_path,
+ visual_studio_runtime_dirs,
+ "x86",
+ ],
+ "scope")
+
msvc_toolchain("x86") {
environment = "environment.x86"
current_cpu = "x86"
- cl = "${goma_prefix}\"${vc_bin_dir}/cl.exe\""
+ cl = "${goma_prefix}\"${x86_toolchain_data.vc_bin_dir}/cl.exe\""
is_clang = false
}
+
msvc_toolchain("clang_x86") {
environment = "environment.x86"
current_cpu = "x86"
@@ -266,39 +253,56 @@ if (current_cpu == "x86") {
}
}
-if (current_cpu == "x64") {
- msvc_toolchain("x64") {
- environment = "environment.x64"
- current_cpu = "x64"
- cl = "${goma_prefix}\"${vc_bin_dir}/cl.exe\""
- is_clang = false
- }
- msvc_toolchain("clang_x64") {
- environment = "environment.x64"
- current_cpu = "x64"
- prefix = rebase_path("//third_party/llvm-build/Release+Asserts/bin",
- root_build_dir)
- cl = "${goma_prefix}$prefix/clang-cl.exe"
- current_os = "win"
- is_clang = true
- }
-}
-
-# WinRT toolchains
-msvc_toolchain("winrt_x86") {
- environment = "environment.winrt_x86"
- cl = "${goma_prefix}\"${vc_bin_dir}/cl.exe\""
+# 64-bit toolchains.
+x64_toolchain_data = exec_script("setup_toolchain.py",
+ [
+ visual_studio_path,
+ gyp_win_tool_path,
+ windows_sdk_path,
+ visual_studio_runtime_dirs,
+ "x64",
+ ],
+ "scope")
+
+msvc_toolchain("x64") {
+ environment = "environment.x64"
+ current_cpu = "x64"
+ cl = "${goma_prefix}\"${x64_toolchain_data.vc_bin_dir}/cl.exe\""
is_clang = false
+}
- current_cpu = "x86"
- current_os = current_os
+msvc_toolchain("clang_x64") {
+ environment = "environment.x64"
+ current_cpu = "x64"
+ prefix = rebase_path("//third_party/llvm-build/Release+Asserts/bin",
+ root_build_dir)
+ cl = "${goma_prefix}$prefix/clang-cl.exe"
+ current_os = "win"
+ is_clang = true
}
-msvc_toolchain("winrt_x64") {
- environment = "environment.winrt_x64"
- cl = "${goma_prefix}\"${vc_bin_dir}/cl.exe\""
- is_clang = false
+# WinRT toolchains. Only define these when targeting them.
+#
+# NOTE: This is currently broken because it references vc_bin_dir. brettw@
+# changed this around a bit, and I don't know what this should be set to
+# in terms of what setup_toolchain returns for a certain CPU architecture.
+if (target_os == "winrt_81" || target_os == "winrt_81_phone" ||
+ target_os == "winrt_10") {
+ msvc_toolchain("winrt_x86") {
+ environment = "environment.winrt_x86"
+ cl = "${goma_prefix}\"${vc_bin_dir}/cl.exe\""
scottmg 2015/11/10 20:22:21 Was anyone using this? I guess it'll have to be am
brettw 2015/11/10 21:36:13 Some people did this stuff and seemed to be workin
+ is_clang = false
- current_cpu = "x64"
- current_os = current_os
+ current_cpu = "x86"
+ current_os = current_os
+ }
+
+ msvc_toolchain("winrt_x64") {
+ environment = "environment.winrt_x64"
+ cl = "${goma_prefix}\"${vc_bin_dir}/cl.exe\""
+ is_clang = false
+
+ current_cpu = "x64"
+ current_os = current_os
+ }
}
« no previous file with comments | « no previous file | cloud_print/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698