OLD | NEW |
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/toolchain.gni") | 9 import("//build/toolchain/toolchain.gni") |
10 | 10 |
11 assert(is_win) | 11 assert(is_win) |
12 | 12 |
13 declare_args() { | 13 declare_args() { |
14 # Set this to true to enable static analysis through Visual Studio's | 14 # Set this to true to enable static analysis through Visual Studio's |
15 # /analyze. This dramatically slows compiles and reports thousands of | 15 # /analyze. This dramatically slows compiles and reports thousands of |
16 # warnings, so normally this is done on a build machine and only the new | 16 # warnings, so normally this is done on a build machine and only the new |
17 # warnings are examined. | 17 # warnings are examined. |
18 use_vs_code_analysis = false | 18 use_vs_code_analysis = false |
| 19 |
| 20 # Turn this on to have the linker output extra timing information. |
| 21 win_linker_timing = false |
19 } | 22 } |
20 | 23 |
21 # This is included by reference in the //build/config/compiler config that | 24 # This is included by reference in the //build/config/compiler config that |
22 # is applied to all targets. It is here to separate out the logic that is | 25 # is applied to all targets. It is here to separate out the logic that is |
23 # Windows-only. | 26 # Windows-only. |
24 config("compiler") { | 27 config("compiler") { |
25 if (current_cpu == "x86") { | 28 if (current_cpu == "x86") { |
26 asmflags = [ | 29 asmflags = [ |
27 # When /safeseh is specified, the linker will only produce an image if it | 30 # When /safeseh is specified, the linker will only produce an image if it |
28 # can also produce a table of the image's safe exception handlers. This | 31 # can also produce a table of the image's safe exception handlers. This |
(...skipping 231 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
260 "/NXCOMPAT", | 263 "/NXCOMPAT", |
261 | 264 |
262 # Suggested by Microsoft Devrel to avoid | 265 # Suggested by Microsoft Devrel to avoid |
263 # LINK : fatal error LNK1248: image size (80000000) | 266 # LINK : fatal error LNK1248: image size (80000000) |
264 # exceeds maximum allowable size (80000000) | 267 # exceeds maximum allowable size (80000000) |
265 # which started happening more regularly after VS2013 Update 4. | 268 # which started happening more regularly after VS2013 Update 4. |
266 # Needs to be a bit lower for VS2015, or else errors out. | 269 # Needs to be a bit lower for VS2015, or else errors out. |
267 "/maxilksize:0x7ff00000", | 270 "/maxilksize:0x7ff00000", |
268 ] | 271 ] |
269 | 272 |
270 # Flags not supported in version 2013. | 273 ldflags += [ |
271 if (visual_studio_version != "2013" && visual_studio_version != "2013e") { | 274 # Tell the linker to crash on failures. |
272 ldflags += [ | 275 "/fastfail", |
273 # Tell the linker to crash on failures. | 276 ] |
274 "/fastfail", | |
275 ] | |
276 } | |
277 | 277 |
278 # ASLR makes debugging with windbg difficult because Chrome.exe and | 278 # ASLR makes debugging with windbg difficult because Chrome.exe and |
279 # Chrome.dll share the same base name. As result, windbg will name the | 279 # Chrome.dll share the same base name. As result, windbg will name the |
280 # Chrome.dll module like chrome_<base address>, where <base address> | 280 # Chrome.dll module like chrome_<base address>, where <base address> |
281 # typically changes with each launch. This in turn means that breakpoints in | 281 # typically changes with each launch. This in turn means that breakpoints in |
282 # Chrome.dll don't stick from one launch to the next. For this reason, we | 282 # Chrome.dll don't stick from one launch to the next. For this reason, we |
283 # turn ASLR off in debug builds. | 283 # turn ASLR off in debug builds. |
284 if (is_debug) { | 284 if (is_debug) { |
285 ldflags += [ "/DYNAMICBASE:NO" ] | 285 ldflags += [ "/DYNAMICBASE:NO" ] |
286 } else { | 286 } else { |
287 ldflags += [ "/DYNAMICBASE" ] | 287 ldflags += [ "/DYNAMICBASE" ] |
288 } | 288 } |
| 289 |
| 290 if (win_linker_timing) { |
| 291 ldflags += [ |
| 292 "/time", |
| 293 "/verbose:incr", |
| 294 ] |
| 295 } |
289 } | 296 } |
290 | 297 |
291 # Subsystem -------------------------------------------------------------------- | 298 # Subsystem -------------------------------------------------------------------- |
292 | 299 |
293 # This is appended to the subsystem to specify a minimum version. | 300 # This is appended to the subsystem to specify a minimum version. |
294 if (current_cpu == "x64") { | 301 if (current_cpu == "x64") { |
295 # The number after the comma is the minimum required OS version. | 302 # The number after the comma is the minimum required OS version. |
296 # 5.02 = Windows Server 2003. | 303 # 5.02 = Windows Server 2003. |
297 subsystem_version_suffix = ",5.02" | 304 subsystem_version_suffix = ",5.02" |
298 } else { | 305 } else { |
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
392 | 399 |
393 # Internal stuff -------------------------------------------------------------- | 400 # Internal stuff -------------------------------------------------------------- |
394 | 401 |
395 # Config used by the MIDL template to disable warnings. | 402 # Config used by the MIDL template to disable warnings. |
396 config("midl_warnings") { | 403 config("midl_warnings") { |
397 if (is_clang) { | 404 if (is_clang) { |
398 # MIDL generates code like "#endif !_MIDL_USE_GUIDDEF_". | 405 # MIDL generates code like "#endif !_MIDL_USE_GUIDDEF_". |
399 cflags = [ "-Wno-extra-tokens" ] | 406 cflags = [ "-Wno-extra-tokens" ] |
400 } | 407 } |
401 } | 408 } |
OLD | NEW |