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

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

Issue 738333002: Make goma work on win GN builds. (Closed) Base URL: http://chromium.googlesource.com/chromium/src.git@master
Patch Set: update w/ more review feedback; get vc_bin_dir from setup_toolchain.py Created 6 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
Index: build/toolchain/win/BUILD.gn
diff --git a/build/toolchain/win/BUILD.gn b/build/toolchain/win/BUILD.gn
index 87bd254ca8303b4a04e3cb59965ec34e1b9fa2a2..d48c38ca893c10b6abf93acb0817aa5a3545ac1e 100644
--- a/build/toolchain/win/BUILD.gn
+++ b/build/toolchain/win/BUILD.gn
@@ -2,6 +2,13 @@
# 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.
+ vc_bin_dir = ""
+}
+
import("//build/config/win/visual_studio_version.gni")
import("//build/toolchain/goma.gni")
@@ -15,13 +22,18 @@ assert(is_win)
# list to us.
gyp_win_tool_path = rebase_path("//tools/gyp/pylib/gyp/win_tool.py",
root_build_dir)
-exec_script("setup_toolchain.py",
- [
- visual_studio_path,
- gyp_win_tool_path,
- windows_sdk_path,
- visual_studio_runtime_dirs
- ])
+
+toolchain_data = exec_script("setup_toolchain.py",
+ [visual_studio_path,
+ gyp_win_tool_path,
+ windows_sdk_path,
+ visual_studio_runtime_dirs,
+ cpu_arch],
+ "scope")
+
+if (vc_bin_dir == "") {
+ vc_bin_dir = toolchain_data.vc_bin_dir
+}
# This value will be inherited in the toolchain below.
concurrent_links = exec_script("../get_concurrent_links.py", [], "value")
@@ -46,6 +58,14 @@ template("msvc_toolchain") {
configuration,
invoker.cpu_arch])
+ if (use_goma) {
+ goma_prefix = "$goma_dir/gomacc.exe "
+ } else {
+ goma_prefix = ""
+ }
+
+ cl = "${goma_prefix}\"${vc_bin_dir}/cl.exe\""
+
toolchain(target_name) {
# Make these apply to all tools below.
lib_switch = ""
@@ -54,7 +74,7 @@ template("msvc_toolchain") {
tool("cc") {
rspfile = "{{output}}.rsp"
pdbname = "{{target_out_dir}}/{{target_output_name}}_c.pdb"
- command = "ninja -t msvc -e $env -- cl.exe /nologo /showIncludes /FC @$rspfile /c {{source}} /Fo{{output}} /Fd$pdbname"
+ command = "ninja -t msvc -e $env -- $cl /nologo /showIncludes /FC @$rspfile /c {{source}} /Fo{{output}} /Fd$pdbname"
depsformat = "msvc"
description = "CC {{output}}"
outputs = [
@@ -67,7 +87,7 @@ template("msvc_toolchain") {
rspfile = "{{output}}.rsp"
# The PDB name needs to be different between C and C++ compiled files.
pdbname = "{{target_out_dir}}/{{target_output_name}}_cc.pdb"
- command = "ninja -t msvc -e $env -- cl.exe /nologo /showIncludes /FC @$rspfile /c {{source}} /Fo{{output}} /Fd$pdbname"
+ command = "ninja -t msvc -e $env -- $cl /nologo /showIncludes /FC @$rspfile /c {{source}} /Fo{{output}} /Fd$pdbname"
depsformat = "msvc"
description = "CXX {{output}}"
outputs = [

Powered by Google App Engine
This is Rietveld 408576698