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 |
(...skipping 19 matching lines...) Expand all Loading... | |
30 # valid for the image. Note that /SAFESEH isn't accepted on the command | 30 # valid for the image. Note that /SAFESEH isn't accepted on the command |
31 # line, only /safeseh. This is only accepted by ml.exe, not ml64.exe. | 31 # line, only /safeseh. This is only accepted by ml.exe, not ml64.exe. |
32 "/safeseh", | 32 "/safeseh", |
33 ] | 33 ] |
34 } | 34 } |
35 | 35 |
36 cflags = [ | 36 cflags = [ |
37 "/Gy", # Enable function-level linking. | 37 "/Gy", # Enable function-level linking. |
38 "/FS", # Preserve previous PDB behavior. | 38 "/FS", # Preserve previous PDB behavior. |
39 "/bigobj", # Some of our files are bigger than the regular limits. | 39 "/bigobj", # Some of our files are bigger than the regular limits. |
40 | |
41 # Tell the compiler to crash on failures. This is undocumented | |
42 # and unsupported but very handy. | |
43 "/d2FastFail", | |
44 ] | 40 ] |
45 | 41 |
46 # Force C/C++ mode for the given GN detected file type. This is necessary | 42 # Force C/C++ mode for the given GN detected file type. This is necessary |
47 # for precompiled headers where the same source file is compiled in both | 43 # for precompiled headers where the same source file is compiled in both |
48 # modes. | 44 # modes. |
49 cflags_c = [ "/TC" ] | 45 cflags_c = [ "/TC" ] |
50 cflags_cc = [ "/TP" ] | 46 cflags_cc = [ "/TP" ] |
51 | 47 |
48 # Flags not supported in version 2013. | |
Michael Achenbach
2016/07/21 09:03:19
We could also add this to the 2015 case below, but
| |
49 if (visual_studio_version != "2013" && visual_studio_version != "2013e") { | |
50 cflags += [ | |
51 # Tell the compiler to crash on failures. This is undocumented | |
52 # and unsupported but very handy. | |
53 "/d2FastFail", | |
54 ] | |
55 } | |
56 | |
52 if (visual_studio_version == "2015") { | 57 if (visual_studio_version == "2015") { |
53 cflags += [ | 58 cflags += [ |
54 # Work around crbug.com/526851, bug in VS 2015 RTM compiler. | 59 # Work around crbug.com/526851, bug in VS 2015 RTM compiler. |
55 "/Zc:sizedDealloc-", | 60 "/Zc:sizedDealloc-", |
56 | 61 |
57 # Disable thread-safe statics to avoid overhead and because | 62 # Disable thread-safe statics to avoid overhead and because |
58 # they are disabled on other platforms. See crbug.com/587210 | 63 # they are disabled on other platforms. See crbug.com/587210 |
59 # and -fno-threadsafe-statics. | 64 # and -fno-threadsafe-statics. |
60 "/Zc:threadSafeInit-", | 65 "/Zc:threadSafeInit-", |
61 ] | 66 ] |
(...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
253 "/ignore:4199", | 258 "/ignore:4199", |
254 "/ignore:4221", | 259 "/ignore:4221", |
255 "/NXCOMPAT", | 260 "/NXCOMPAT", |
256 | 261 |
257 # Suggested by Microsoft Devrel to avoid | 262 # Suggested by Microsoft Devrel to avoid |
258 # LINK : fatal error LNK1248: image size (80000000) | 263 # LINK : fatal error LNK1248: image size (80000000) |
259 # exceeds maximum allowable size (80000000) | 264 # exceeds maximum allowable size (80000000) |
260 # which started happening more regularly after VS2013 Update 4. | 265 # which started happening more regularly after VS2013 Update 4. |
261 # Needs to be a bit lower for VS2015, or else errors out. | 266 # Needs to be a bit lower for VS2015, or else errors out. |
262 "/maxilksize:0x7ff00000", | 267 "/maxilksize:0x7ff00000", |
268 ] | |
263 | 269 |
264 # Tell the linker to crash on failures. | 270 # Flags not supported in version 2013. |
265 "/fastfail", | 271 if (visual_studio_version != "2013" && visual_studio_version != "2013e") { |
266 ] | 272 ldflags += [ |
273 # Tell the linker to crash on failures. | |
274 "/fastfail", | |
275 ] | |
276 } | |
267 | 277 |
268 # ASLR makes debugging with windbg difficult because Chrome.exe and | 278 # ASLR makes debugging with windbg difficult because Chrome.exe and |
269 # 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 |
270 # Chrome.dll module like chrome_<base address>, where <base address> | 280 # Chrome.dll module like chrome_<base address>, where <base address> |
271 # 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 |
272 # 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 |
273 # turn ASLR off in debug builds. | 283 # turn ASLR off in debug builds. |
274 if (is_debug) { | 284 if (is_debug) { |
275 ldflags += [ "/DYNAMICBASE:NO" ] | 285 ldflags += [ "/DYNAMICBASE:NO" ] |
276 } else { | 286 } else { |
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
382 | 392 |
383 # Internal stuff -------------------------------------------------------------- | 393 # Internal stuff -------------------------------------------------------------- |
384 | 394 |
385 # Config used by the MIDL template to disable warnings. | 395 # Config used by the MIDL template to disable warnings. |
386 config("midl_warnings") { | 396 config("midl_warnings") { |
387 if (is_clang) { | 397 if (is_clang) { |
388 # MIDL generates code like "#endif !_MIDL_USE_GUIDDEF_". | 398 # MIDL generates code like "#endif !_MIDL_USE_GUIDDEF_". |
389 cflags = [ "-Wno-extra-tokens" ] | 399 cflags = [ "-Wno-extra-tokens" ] |
390 } | 400 } |
391 } | 401 } |
OLD | NEW |