| 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/compiler/compiler.gni") | 5 import("//build/config/compiler/compiler.gni") |
| 6 import("//build/config/sanitizers/sanitizers.gni") | 6 import("//build/config/sanitizers/sanitizers.gni") |
| 7 import("//build/config/win/visual_studio_version.gni") | 7 import("//build/config/win/visual_studio_version.gni") |
| 8 | 8 |
| 9 assert(is_win) | 9 assert(is_win) |
| 10 | 10 |
| (...skipping 22 matching lines...) Expand all Loading... |
| 33 | 33 |
| 34 cflags = [ | 34 cflags = [ |
| 35 "/Gy", # Enable function-level linking. | 35 "/Gy", # Enable function-level linking. |
| 36 "/FS", # Preserve previous PDB behavior. | 36 "/FS", # Preserve previous PDB behavior. |
| 37 "/bigobj", # Some of our files are bigger than the regular limits. | 37 "/bigobj", # Some of our files are bigger than the regular limits. |
| 38 | 38 |
| 39 # Tell the compiler to crash on failures. This is undocumented | 39 # Tell the compiler to crash on failures. This is undocumented |
| 40 # and unsupported but very handy. | 40 # and unsupported but very handy. |
| 41 "/d2FastFail", | 41 "/d2FastFail", |
| 42 ] | 42 ] |
| 43 if (!is_clang) { | |
| 44 # TODO(thakis): Enable this with clang too, https://crbug.com/598767 | |
| 45 cflags += [ "/GS" ] # Enable buffer security checking. | |
| 46 } | |
| 47 | 43 |
| 48 # Force C/C++ mode for the given GN detected file type. This is necessary | 44 # Force C/C++ mode for the given GN detected file type. This is necessary |
| 49 # for precompiled headers where the same source file is compiled in both | 45 # for precompiled headers where the same source file is compiled in both |
| 50 # modes. | 46 # modes. |
| 51 cflags_c = [ "/TC" ] | 47 cflags_c = [ "/TC" ] |
| 52 cflags_cc = [ "/TP" ] | 48 cflags_cc = [ "/TP" ] |
| 53 | 49 |
| 54 if (visual_studio_version == "2015") { | 50 if (visual_studio_version == "2015") { |
| 55 cflags += [ | 51 cflags += [ |
| 56 # Work around crbug.com/526851, bug in VS 2015 RTM compiler. | 52 # Work around crbug.com/526851, bug in VS 2015 RTM compiler. |
| (...skipping 343 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 400 | 396 |
| 401 # Internal stuff -------------------------------------------------------------- | 397 # Internal stuff -------------------------------------------------------------- |
| 402 | 398 |
| 403 # Config used by the MIDL template to disable warnings. | 399 # Config used by the MIDL template to disable warnings. |
| 404 config("midl_warnings") { | 400 config("midl_warnings") { |
| 405 if (is_clang) { | 401 if (is_clang) { |
| 406 # MIDL generates code like "#endif !_MIDL_USE_GUIDDEF_". | 402 # MIDL generates code like "#endif !_MIDL_USE_GUIDDEF_". |
| 407 cflags = [ "-Wno-extra-tokens" ] | 403 cflags = [ "-Wno-extra-tokens" ] |
| 408 } | 404 } |
| 409 } | 405 } |
| OLD | NEW |