aboutsummaryrefslogtreecommitdiffhomepage
path: root/gn
diff options
context:
space:
mode:
authorGravatar Brian Osman <brianosman@google.com>2018-07-19 15:48:21 -0400
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2018-07-19 20:23:25 +0000
commite530e5153f8dcd6a08125993c46b9db57c95e838 (patch)
treedf4cb2174dadc18e3ca5e16af3c9f5abe6bd9d7d /gn
parent6c48e4d11ce80fa5cfef56e13b2d5847fe94a7cc (diff)
Stop using rsp files for compiling on Windows
Chrome stopped using them in January: https://chromium-review.googlesource.com/c/chromium/src/+/832593 For them, it significantly accelerated goma builds. From my tests, I think we'll see some small speedup. Note that our older build system invoked through CMD, which limited us to 8k of command line. GN/ninja don't do that, so we have the full 32k limit. However, we do use CMD to do our 32-bit builds... But that doesn't matter, becase AFAICT the longest command line we generate right now is only about 2.5k long. Note that (like Chromium) this continues to use rsp files to link. Those command lines *can* become ridiculously long. The original motivation, and a nice benefit of this change: It makes the output of ninja's compdb tool much more useful. That tool emits JSON in a standard format describing the commands used to build each source file. Other tools (eg Visual Studio Code) can parse that JSON, and deduce the correct defines and include paths to help with symbol navigation. Change-Id: I73124f13d5117a0c31445cf6ce1c506d2f73609f Reviewed-on: https://skia-review.googlesource.com/142584 Reviewed-by: Ben Wagner <benjaminwagner@google.com> Commit-Queue: Brian Osman <brianosman@google.com>
Diffstat (limited to 'gn')
-rw-r--r--gn/toolchain/BUILD.gn10
1 files changed, 2 insertions, 8 deletions
diff --git a/gn/toolchain/BUILD.gn b/gn/toolchain/BUILD.gn
index 6229e45ee9..86acfdd0d7 100644
--- a/gn/toolchain/BUILD.gn
+++ b/gn/toolchain/BUILD.gn
@@ -74,34 +74,28 @@ toolchain("msvc") {
}
tool("cc") {
- rspfile = "{{output}}.rsp"
precompiled_header_type = "msvc"
pdbname = "{{target_out_dir}}/{{label_name}}_c.pdb"
# Label names may have spaces so pdbname must be quoted.
- command = "$env_setup $cc_wrapper \"$cl\" /nologo /showIncludes /FC @$rspfile /c {{source}} /Fo{{output}} /Fd\"$pdbname\""
+ command = "$env_setup $cc_wrapper \"$cl\" /nologo /showIncludes /FC {{defines}} {{include_dirs}} {{cflags}} $cl_m32_flag {{cflags_c}} /c {{source}} /Fo{{output}} /Fd\"$pdbname\""
depsformat = "msvc"
outputs = [
"{{source_out_dir}}/{{target_output_name}}.{{source_name_part}}.obj",
]
- rspfile_content =
- "{{defines}} {{include_dirs}} {{cflags}} $cl_m32_flag {{cflags_c}}"
description = "compile {{source}}"
}
tool("cxx") {
- rspfile = "{{output}}.rsp"
precompiled_header_type = "msvc"
pdbname = "{{target_out_dir}}/{{label_name}}_c.pdb"
# Label names may have spaces so pdbname must be quoted.
- command = "$env_setup $cc_wrapper \"$cl\" /nologo /showIncludes /FC @$rspfile /c {{source}} /Fo{{output}} /Fd\"$pdbname\""
+ command = "$env_setup $cc_wrapper \"$cl\" /nologo /showIncludes /FC {{defines}} {{include_dirs}} {{cflags}} $cl_m32_flag {{cflags_cc}} /c {{source}} /Fo{{output}} /Fd\"$pdbname\""
depsformat = "msvc"
outputs = [
"{{source_out_dir}}/{{target_output_name}}.{{source_name_part}}.obj",
]
- rspfile_content =
- "{{defines}} {{include_dirs}} {{cflags}} $cl_m32_flag {{cflags_cc}}"
description = "compile {{source}}"
}