From e530e5153f8dcd6a08125993c46b9db57c95e838 Mon Sep 17 00:00:00 2001 From: Brian Osman Date: Thu, 19 Jul 2018 15:48:21 -0400 Subject: 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 Commit-Queue: Brian Osman --- gn/toolchain/BUILD.gn | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) (limited to 'gn') 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}}" } -- cgit v1.2.3