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

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

Issue 1724533002: clang/gn/win: Stop running the compiler through `ninja -t msvc -e environment.foo` (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . Created 4 years, 10 months 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 | build/toolchain/win/setup_toolchain.py » ('j') | build/toolchain/win/setup_toolchain.py » ('J')
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 1934e9b19ad43287d8435364e318d8dd0b4b3d8f..be54376b9c4558a2f49439ea9dbcdcd26205884a 100644
--- a/build/toolchain/win/BUILD.gn
+++ b/build/toolchain/win/BUILD.gn
@@ -61,6 +61,7 @@ template("msvc_toolchain") {
env = invoker.environment
cl = invoker.cl
+ include_flags = invoker.include_flags
toolchain(target_name) {
# Make these apply to all tools below.
@@ -74,7 +75,7 @@ template("msvc_toolchain") {
rspfile = "{{output}}.rsp"
precompiled_header_type = "msvc"
pdbname = "{{target_out_dir}}/{{label_name}}_c.pdb"
- command = "ninja -t msvc -e $env -- $cl /nologo /showIncludes /FC @$rspfile /c {{source}} /Fo{{output}} /Fd$pdbname"
+ command = "$cl /nologo $include_flags /showIncludes /FC @$rspfile /c {{source}} /Fo{{output}} /Fd$pdbname"
scottmg 2016/02/25 03:40:15 I don't understand how cl.exe gets PATH to be set
Nico 2016/02/25 03:45:41 We don't need the path. cl is set to `cl = "${goma
scottmg 2016/02/25 18:16:23 Are you sure? Looking in VC\bin\amd64_x86, there's
depsformat = "msvc"
description = "CC {{output}}"
outputs = [
@@ -89,7 +90,7 @@ template("msvc_toolchain") {
# The PDB name needs to be different between C and C++ compiled files.
pdbname = "{{target_out_dir}}/{{label_name}}_cc.pdb"
- command = "ninja -t msvc -e $env -- $cl /nologo /showIncludes /FC @$rspfile /c {{source}} /Fo{{output}} /Fd$pdbname"
+ command = "$cl /nologo $include_flags /showIncludes /FC @$rspfile /c {{source}} /Fo{{output}} /Fd$pdbname"
depsformat = "msvc"
description = "CXX {{output}}"
outputs = [
@@ -239,6 +240,13 @@ template("msvc_toolchain") {
}
}
+if (is_clang) {
+ sys_include_prefix = "-isystem="
+} else {
+ # MSVC doesn't have the concept of system headers.
+ sys_include_prefix = "/I"
+}
+
if (host_os == "win") {
clang_cl = "clang-cl.exe"
} else {
@@ -256,6 +264,7 @@ if (target_cpu == "x86") {
windows_sdk_path,
visual_studio_runtime_dirs,
"x86",
+ "${sys_include_prefix}",
],
"scope")
@@ -264,6 +273,7 @@ if (target_cpu == "x86") {
toolchain_cpu = "x86"
cl = "${goma_prefix}\"${x86_toolchain_data.vc_bin_dir}/cl.exe\""
is_clang = false
+ include_flags = "${x86_toolchain_data.include_flags}"
}
msvc_toolchain("clang_x86") {
@@ -274,6 +284,7 @@ if (target_cpu == "x86") {
cl = "${goma_prefix}$prefix/${clang_cl}"
toolchain_os = "win"
is_clang = true
+ include_flags = "${x86_toolchain_data.include_flags}"
}
}
@@ -285,6 +296,7 @@ x64_toolchain_data = exec_script("setup_toolchain.py",
windows_sdk_path,
visual_studio_runtime_dirs,
"x64",
+ "${sys_include_prefix}",
],
"scope")
@@ -301,6 +313,7 @@ template("win_x64_toolchains") {
toolchain_cpu = "x64"
cl = "${goma_prefix}\"${x64_toolchain_data.vc_bin_dir}/cl.exe\""
is_clang = false
+ include_flags = "${x64_toolchain_data.include_flags}"
forward_variables_from(invoker, [ "is_component_build" ])
}
@@ -313,6 +326,7 @@ template("win_x64_toolchains") {
cl = "${goma_prefix}$prefix/${clang_cl}"
toolchain_os = "win"
is_clang = true
+ include_flags = "${x64_toolchain_data.include_flags}"
forward_variables_from(invoker, [ "is_component_build" ])
}
« no previous file with comments | « no previous file | build/toolchain/win/setup_toolchain.py » ('j') | build/toolchain/win/setup_toolchain.py » ('J')

Powered by Google App Engine
This is Rietveld 408576698