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

Side by Side 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: fix pdb flags 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 unified diff | Download patch
« build/config/BUILDCONFIG.gn ('K') | « build/config/BUILDCONFIG.gn ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # Copyright (c) 2013 The Chromium Authors. All rights reserved. 1 # Copyright (c) 2013 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be 2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file. 3 # found in the LICENSE file.
4 4
5 import("//build/config/win/visual_studio_version.gni") 5 import("//build/config/win/visual_studio_version.gni")
6 import("//build/toolchain/goma.gni") 6 import("//build/toolchain/goma.gni")
7 7
8 # Should only be running on Windows. 8 # Should only be running on Windows.
9 assert(is_win) 9 assert(is_win)
10 10
(...skipping 28 matching lines...) Expand all
39 if (is_debug) { 39 if (is_debug) {
40 configuration = "Debug" 40 configuration = "Debug"
41 } else { 41 } else {
42 configuration = "Release" 42 configuration = "Release"
43 } 43 }
44 exec_script("../../vs_toolchain.py", ["copy_dlls", 44 exec_script("../../vs_toolchain.py", ["copy_dlls",
45 rebase_path(root_build_dir), 45 rebase_path(root_build_dir),
46 configuration, 46 configuration,
47 invoker.cpu_arch]) 47 invoker.cpu_arch])
48 48
49 if (use_goma) {
50 goma_prefix = "$goma_dir/gomacc.exe "
51 } else {
52 goma_prefix = ""
53 }
54
55 if (cpu_arch == "x86") {
56 vc_bin = "\vc\bin\amd64_x86"
57 } else {
58 vc_bin = "\vc\bin\amd64"
59 }
Dirk Pranke 2014/11/20 03:47:13 Scott: is there a better way to get the right subd
scottmg 2014/11/20 04:58:34 Yes, setup_toolchain should probably do the same a
Dirk Pranke 2014/11/20 05:01:03 Okay, will fix.
60 cl = "${goma_prefix}\"${visual_studio_path}${vc_bin}/cl.exe\""
61
49 toolchain(target_name) { 62 toolchain(target_name) {
50 # Make these apply to all tools below. 63 # Make these apply to all tools below.
51 lib_switch = "" 64 lib_switch = ""
52 lib_dir_switch="/LIBPATH:" 65 lib_dir_switch="/LIBPATH:"
53 66
54 tool("cc") { 67 tool("cc") {
68 if (use_goma) {
scottmg 2014/11/20 04:58:34 you could probably just leave this to avoid the co
Dirk Pranke 2014/11/20 05:01:03 Okay, I'll doublecheck to make sure and always pas
69 pdb_flag = ""
70 } else {
71 pdb_flag = " /Fd{{target_out_dir}}/{{target_output_name}}_c.pdb"
72 }
73
55 rspfile = "{{output}}.rsp" 74 rspfile = "{{output}}.rsp"
56 pdbname = "{{target_out_dir}}/{{target_output_name}}_c.pdb" 75 command = "ninja -t msvc -e $env -- $cl /nologo /showIncludes /FC @$rspfil e /c {{source}} /Fo{{output}}$pdb_flag"
57 command = "ninja -t msvc -e $env -- cl.exe /nologo /showIncludes /FC @$rsp file /c {{source}} /Fo{{output}} /Fd$pdbname" 76
58 depsformat = "msvc" 77 depsformat = "msvc"
59 description = "CC {{output}}" 78 description = "CC {{output}}"
60 outputs = [ 79 outputs = [
61 "{{source_out_dir}}/{{target_output_name}}.{{source_name_part}}.obj", 80 "{{source_out_dir}}/{{target_output_name}}.{{source_name_part}}.obj",
62 ] 81 ]
63 rspfile_content = "{{defines}} {{include_dirs}} {{cflags}} {{cflags_c}}" 82 rspfile_content = "{{defines}} {{include_dirs}} {{cflags}} {{cflags_c}}"
64 } 83 }
65 84
66 tool("cxx") { 85 tool("cxx") {
86 if (use_goma) {
scottmg 2014/11/20 04:58:34 same
Dirk Pranke 2014/11/20 05:01:03 Acknowledged.
87 pdb_flag = ""
88 } else {
89 # The PDB name needs to be different between C and C++ compiled files.
90 pdb_flag = " /Fd{{target_out_dir}}/{{target_output_name}}_cc.pdb"
91 }
92
67 rspfile = "{{output}}.rsp" 93 rspfile = "{{output}}.rsp"
68 # The PDB name needs to be different between C and C++ compiled files. 94 command = "ninja -t msvc -e $env -- $cl /nologo /showIncludes /FC @$rspfil e /c {{source}} /Fo{{output}}$pdb_flag"
69 pdbname = "{{target_out_dir}}/{{target_output_name}}_cc.pdb"
70 command = "ninja -t msvc -e $env -- cl.exe /nologo /showIncludes /FC @$rsp file /c {{source}} /Fo{{output}} /Fd$pdbname"
71 depsformat = "msvc" 95 depsformat = "msvc"
72 description = "CXX {{output}}" 96 description = "CXX {{output}}"
73 outputs = [ 97 outputs = [
74 "{{source_out_dir}}/{{target_output_name}}.{{source_name_part}}.obj", 98 "{{source_out_dir}}/{{target_output_name}}.{{source_name_part}}.obj",
75 ] 99 ]
76 rspfile_content = "{{defines}} {{include_dirs}} {{cflags}} {{cflags_c}}" 100 rspfile_content = "{{defines}} {{include_dirs}} {{cflags}} {{cflags_c}}"
77 } 101 }
78 102
79 tool("rc") { 103 tool("rc") {
80 command = "$python_path gyp-win-tool rc-wrapper $env rc.exe {{defines}} {{ include_dirs}} /fo{{output}} {{source}}" 104 command = "$python_path gyp-win-tool rc-wrapper $env rc.exe {{defines}} {{ include_dirs}} /fo{{output}} {{source}}"
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after
182 cpu_arch = "x86" 206 cpu_arch = "x86"
183 } 207 }
184 } 208 }
185 209
186 if (cpu_arch == "x64") { 210 if (cpu_arch == "x64") {
187 msvc_toolchain("64") { 211 msvc_toolchain("64") {
188 environment = "environment.x64" 212 environment = "environment.x64"
189 cpu_arch = "x64" 213 cpu_arch = "x64"
190 } 214 }
191 } 215 }
OLDNEW
« build/config/BUILDCONFIG.gn ('K') | « build/config/BUILDCONFIG.gn ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698