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

Side by Side Diff: build/toolchain/win/BUILD.gn

Issue 2287833002: Revert of Move gyp-win-tool to the GN Windows toolchain. (Closed)
Patch Set: Created 4 years, 3 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 unified diff | Download patch
« no previous file with comments | « build/toolchain/toolchain.gni ('k') | build/toolchain/win/midl.gni » ('j') | 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/clang/clang.gni") 5 import("//build/config/clang/clang.gni")
6 import("//build/config/compiler/compiler.gni") 6 import("//build/config/compiler/compiler.gni")
7 import("//build/config/sanitizers/sanitizers.gni") 7 import("//build/config/sanitizers/sanitizers.gni")
8 import("//build/config/win/visual_studio_version.gni") 8 import("//build/config/win/visual_studio_version.gni")
9 import("//build/toolchain/goma.gni") 9 import("//build/toolchain/goma.gni")
10 import("//build/toolchain/toolchain.gni") 10 import("//build/toolchain/toolchain.gni")
11 11
12 # Should only be running on Windows. 12 # Should only be running on Windows.
13 assert(is_win) 13 assert(is_win)
14 14
15 # Setup the Visual Studio state. 15 # Setup the Visual Studio state.
16 # 16 #
17 # Its arguments are the VS path and the compiler wrapper tool. It will write 17 # Its arguments are the VS path and the compiler wrapper tool. It will write
18 # "environment.x86" and "environment.x64" to the build directory and return a 18 # "environment.x86" and "environment.x64" to the build directory and return a
19 # list to us. 19 # list to us.
20 20 gyp_win_tool_path =
21 # This tool will is used as a wrapper for various commands below. 21 rebase_path("//tools/gyp/pylib/gyp/win_tool.py", root_build_dir)
22 tool_wrapper_path = rebase_path("tool_wrapper.py", root_build_dir)
23 22
24 if (use_goma) { 23 if (use_goma) {
25 goma_prefix = "$goma_dir/gomacc.exe " 24 goma_prefix = "$goma_dir/gomacc.exe "
26 } else { 25 } else {
27 goma_prefix = "" 26 goma_prefix = ""
28 } 27 }
29 28
30 # Copy the VS runtime DLL for the default toolchain to the root build directory 29 # Copy the VS runtime DLL for the default toolchain to the root build directory
31 # so things will run. 30 # so things will run.
32 if (current_toolchain == default_toolchain) { 31 if (current_toolchain == default_toolchain) {
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after
154 command = "$env_wrapper$cl /nologo /showIncludes /FC @$rspfile /c {{source }} /Fo{{output}} /Fd\"$pdbname\"" 153 command = "$env_wrapper$cl /nologo /showIncludes /FC @$rspfile /c {{source }} /Fo{{output}} /Fd\"$pdbname\""
155 depsformat = "msvc" 154 depsformat = "msvc"
156 description = "CXX {{output}}" 155 description = "CXX {{output}}"
157 outputs = [ 156 outputs = [
158 "$object_subdir/{{source_name_part}}.obj", 157 "$object_subdir/{{source_name_part}}.obj",
159 ] 158 ]
160 rspfile_content = "$sys_include_flags{{defines}} {{include_dirs}} {{cflags }} {{cflags_cc}}" 159 rspfile_content = "$sys_include_flags{{defines}} {{include_dirs}} {{cflags }} {{cflags_cc}}"
161 } 160 }
162 161
163 tool("rc") { 162 tool("rc") {
164 command = "$python_path $tool_wrapper_path rc-wrapper $env rc.exe {{define s}} {{include_dirs}} /fo{{output}} {{source}}" 163 command = "$python_path gyp-win-tool rc-wrapper $env rc.exe {{defines}} {{ include_dirs}} /fo{{output}} {{source}}"
165 outputs = [ 164 outputs = [
166 "$object_subdir/{{source_name_part}}.res", 165 "$object_subdir/{{source_name_part}}.res",
167 ] 166 ]
168 description = "RC {{output}}" 167 description = "RC {{output}}"
169 } 168 }
170 169
171 tool("asm") { 170 tool("asm") {
172 if (toolchain_args.current_cpu == "x64") { 171 if (toolchain_args.current_cpu == "x64") {
173 ml = "ml64.exe" 172 ml = "ml64.exe"
174 } else { 173 } else {
175 ml = "ml.exe" 174 ml = "ml.exe"
176 } 175 }
177 command = "$python_path $tool_wrapper_path asm-wrapper $env $ml {{defines} } {{include_dirs}} {{asmflags}} /c /Fo{{output}} {{source}}" 176 command = "$python_path gyp-win-tool asm-wrapper $env $ml {{defines}} {{in clude_dirs}} {{asmflags}} /c /Fo{{output}} {{source}}"
178 description = "ASM {{output}}" 177 description = "ASM {{output}}"
179 outputs = [ 178 outputs = [
180 "$object_subdir/{{source_name_part}}.obj", 179 "$object_subdir/{{source_name_part}}.obj",
181 ] 180 ]
182 } 181 }
183 182
184 tool("alink") { 183 tool("alink") {
185 rspfile = "{{output}}.rsp" 184 rspfile = "{{output}}.rsp"
186 command = "$python_path $tool_wrapper_path link-wrapper $env False $lib /n ologo {{arflags}} /OUT:{{output}} @$rspfile" 185 command = "$python_path gyp-win-tool link-wrapper $env False $lib /nologo {{arflags}} /OUT:{{output}} @$rspfile"
187 description = "LIB {{output}}" 186 description = "LIB {{output}}"
188 outputs = [ 187 outputs = [
189 # Ignore {{output_extension}} and always use .lib, there's no reason to 188 # Ignore {{output_extension}} and always use .lib, there's no reason to
190 # allow targets to override this extension on Windows. 189 # allow targets to override this extension on Windows.
191 "{{output_dir}}/{{target_output_name}}.lib", 190 "{{output_dir}}/{{target_output_name}}.lib",
192 ] 191 ]
193 default_output_extension = ".lib" 192 default_output_extension = ".lib"
194 default_output_dir = "{{target_out_dir}}" 193 default_output_dir = "{{target_out_dir}}"
195 194
196 # The use of inputs_newline is to work around a fixed per-line buffer 195 # The use of inputs_newline is to work around a fixed per-line buffer
197 # size in the linker. 196 # size in the linker.
198 rspfile_content = "{{inputs_newline}}" 197 rspfile_content = "{{inputs_newline}}"
199 } 198 }
200 199
201 tool("solink") { 200 tool("solink") {
202 dllname = "{{output_dir}}/{{target_output_name}}{{output_extension}}" # e .g. foo.dll 201 dllname = "{{output_dir}}/{{target_output_name}}{{output_extension}}" # e .g. foo.dll
203 libname = "${dllname}.lib" # e.g. foo.dll.lib 202 libname = "${dllname}.lib" # e.g. foo.dll.lib
204 pdbname = "${dllname}.pdb" 203 pdbname = "${dllname}.pdb"
205 rspfile = "${dllname}.rsp" 204 rspfile = "${dllname}.rsp"
206 pool = "//build/toolchain:link_pool($default_toolchain)" 205 pool = "//build/toolchain:link_pool($default_toolchain)"
207 206
208 command = "$python_path $tool_wrapper_path link-wrapper $env False $link / nologo /IMPLIB:$libname /DLL /OUT:$dllname /PDB:$pdbname @$rspfile" 207 command = "$python_path gyp-win-tool link-wrapper $env False $link /nologo /IMPLIB:$libname /DLL /OUT:$dllname /PDB:$pdbname @$rspfile"
209 208
210 default_output_extension = ".dll" 209 default_output_extension = ".dll"
211 default_output_dir = "{{root_out_dir}}" 210 default_output_dir = "{{root_out_dir}}"
212 description = "LINK(DLL) {{output}}" 211 description = "LINK(DLL) {{output}}"
213 outputs = [ 212 outputs = [
214 dllname, 213 dllname,
215 libname, 214 libname,
216 ] 215 ]
217 link_output = libname 216 link_output = libname
218 depend_output = libname 217 depend_output = libname
(...skipping 12 matching lines...) Expand all
231 # size in the linker. 230 # size in the linker.
232 rspfile_content = "{{libs}} {{solibs}} {{inputs_newline}} {{ldflags}}" 231 rspfile_content = "{{libs}} {{solibs}} {{inputs_newline}} {{ldflags}}"
233 } 232 }
234 233
235 tool("solink_module") { 234 tool("solink_module") {
236 dllname = "{{output_dir}}/{{target_output_name}}{{output_extension}}" # e .g. foo.dll 235 dllname = "{{output_dir}}/{{target_output_name}}{{output_extension}}" # e .g. foo.dll
237 pdbname = "${dllname}.pdb" 236 pdbname = "${dllname}.pdb"
238 rspfile = "${dllname}.rsp" 237 rspfile = "${dllname}.rsp"
239 pool = "//build/toolchain:link_pool($default_toolchain)" 238 pool = "//build/toolchain:link_pool($default_toolchain)"
240 239
241 command = "$python_path $tool_wrapper_path link-wrapper $env False $link / nologo /DLL /OUT:$dllname /PDB:$pdbname @$rspfile" 240 command = "$python_path gyp-win-tool link-wrapper $env False $link /nologo /DLL /OUT:$dllname /PDB:$pdbname @$rspfile"
242 241
243 default_output_extension = ".dll" 242 default_output_extension = ".dll"
244 default_output_dir = "{{root_out_dir}}" 243 default_output_dir = "{{root_out_dir}}"
245 description = "LINK_MODULE(DLL) {{output}}" 244 description = "LINK_MODULE(DLL) {{output}}"
246 outputs = [ 245 outputs = [
247 dllname, 246 dllname,
248 ] 247 ]
249 if (symbol_level != 0) { 248 if (symbol_level != 0) {
250 outputs += [ pdbname ] 249 outputs += [ pdbname ]
251 } 250 }
252 runtime_outputs = outputs 251 runtime_outputs = outputs
253 252
254 # The use of inputs_newline is to work around a fixed per-line buffer 253 # The use of inputs_newline is to work around a fixed per-line buffer
255 # size in the linker. 254 # size in the linker.
256 rspfile_content = "{{libs}} {{solibs}} {{inputs_newline}} {{ldflags}}" 255 rspfile_content = "{{libs}} {{solibs}} {{inputs_newline}} {{ldflags}}"
257 } 256 }
258 257
259 tool("link") { 258 tool("link") {
260 exename = "{{output_dir}}/{{target_output_name}}{{output_extension}}" 259 exename = "{{output_dir}}/{{target_output_name}}{{output_extension}}"
261 pdbname = "$exename.pdb" 260 pdbname = "$exename.pdb"
262 rspfile = "$exename.rsp" 261 rspfile = "$exename.rsp"
263 pool = "//build/toolchain:link_pool($default_toolchain)" 262 pool = "//build/toolchain:link_pool($default_toolchain)"
264 263
265 command = "$python_path $tool_wrapper_path link-wrapper $env False $link / nologo /OUT:$exename /PDB:$pdbname @$rspfile" 264 command = "$python_path gyp-win-tool link-wrapper $env False $link /nologo /OUT:$exename /PDB:$pdbname @$rspfile"
266 265
267 default_output_extension = ".exe" 266 default_output_extension = ".exe"
268 default_output_dir = "{{root_out_dir}}" 267 default_output_dir = "{{root_out_dir}}"
269 description = "LINK {{output}}" 268 description = "LINK {{output}}"
270 outputs = [ 269 outputs = [
271 exename, 270 exename,
272 ] 271 ]
273 if (symbol_level != 0) { 272 if (symbol_level != 0) {
274 outputs += [ pdbname ] 273 outputs += [ pdbname ]
275 } 274 }
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
307 clang_cl = "clang-cl" 306 clang_cl = "clang-cl"
308 } 307 }
309 308
310 # 32-bit toolchains. Only define these when the target architecture is 32-bit 309 # 32-bit toolchains. Only define these when the target architecture is 32-bit
311 # since we don't do any 32-bit cross compiles when targeting 64-bit (the 310 # since we don't do any 32-bit cross compiles when targeting 64-bit (the
312 # build does generate some 64-bit stuff from 32-bit target builds). 311 # build does generate some 64-bit stuff from 32-bit target builds).
313 if (target_cpu == "x86") { 312 if (target_cpu == "x86") {
314 x86_toolchain_data = exec_script("setup_toolchain.py", 313 x86_toolchain_data = exec_script("setup_toolchain.py",
315 [ 314 [
316 visual_studio_path, 315 visual_studio_path,
316 gyp_win_tool_path,
317 windows_sdk_path, 317 windows_sdk_path,
318 visual_studio_runtime_dirs, 318 visual_studio_runtime_dirs,
319 "x86", 319 "x86",
320 "${sys_include_prefix}", 320 "${sys_include_prefix}",
321 ], 321 ],
322 "scope") 322 "scope")
323 323
324 msvc_toolchain("x86") { 324 msvc_toolchain("x86") {
325 environment = "environment.x86" 325 environment = "environment.x86"
326 cl = "${goma_prefix}\"${x86_toolchain_data.vc_bin_dir}/cl.exe\"" 326 cl = "${goma_prefix}\"${x86_toolchain_data.vc_bin_dir}/cl.exe\""
(...skipping 13 matching lines...) Expand all
340 current_cpu = "x86" 340 current_cpu = "x86"
341 is_clang = true 341 is_clang = true
342 } 342 }
343 } 343 }
344 } 344 }
345 345
346 # 64-bit toolchains. 346 # 64-bit toolchains.
347 x64_toolchain_data = exec_script("setup_toolchain.py", 347 x64_toolchain_data = exec_script("setup_toolchain.py",
348 [ 348 [
349 visual_studio_path, 349 visual_studio_path,
350 gyp_win_tool_path,
350 windows_sdk_path, 351 windows_sdk_path,
351 visual_studio_runtime_dirs, 352 visual_studio_runtime_dirs,
352 "x64", 353 "x64",
353 "${sys_include_prefix}", 354 "${sys_include_prefix}",
354 ], 355 ],
355 "scope") 356 "scope")
356 357
357 template("win_x64_toolchains") { 358 template("win_x64_toolchains") {
358 msvc_toolchain(target_name) { 359 msvc_toolchain(target_name) {
359 environment = "environment.x64" 360 environment = "environment.x64"
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
421 msvc_toolchain("winrt_x64") { 422 msvc_toolchain("winrt_x64") {
422 environment = "environment.winrt_x64" 423 environment = "environment.winrt_x64"
423 cl = "${goma_prefix}\"${vc_bin_dir}/cl.exe\"" 424 cl = "${goma_prefix}\"${vc_bin_dir}/cl.exe\""
424 425
425 toolchain_args = { 426 toolchain_args = {
426 is_clang = false 427 is_clang = false
427 current_cpu = "x64" 428 current_cpu = "x64"
428 } 429 }
429 } 430 }
430 } 431 }
OLDNEW
« no previous file with comments | « build/toolchain/toolchain.gni ('k') | build/toolchain/win/midl.gni » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698