| 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 30 matching lines...) Expand all Loading... |
| 41 "/FS", # Preserve previous PDB behavior. | 41 "/FS", # Preserve previous PDB behavior. |
| 42 "/bigobj", # Some of our files are bigger than the regular limits. | 42 "/bigobj", # Some of our files are bigger than the regular limits. |
| 43 ] | 43 ] |
| 44 | 44 |
| 45 # Force C/C++ mode for the given GN detected file type. This is necessary | 45 # Force C/C++ mode for the given GN detected file type. This is necessary |
| 46 # for precompiled headers where the same source file is compiled in both | 46 # for precompiled headers where the same source file is compiled in both |
| 47 # modes. | 47 # modes. |
| 48 cflags_c = [ "/TC" ] | 48 cflags_c = [ "/TC" ] |
| 49 cflags_cc = [ "/TP" ] | 49 cflags_cc = [ "/TP" ] |
| 50 | 50 |
| 51 # Flags not supported in version 2013. | 51 cflags += [ |
| 52 if (visual_studio_version != "2013" && visual_studio_version != "2013e") { | 52 # Tell the compiler to crash on failures. This is undocumented |
| 53 cflags += [ | 53 # and unsupported but very handy. |
| 54 # Tell the compiler to crash on failures. This is undocumented | 54 "/d2FastFail", |
| 55 # and unsupported but very handy. | |
| 56 "/d2FastFail", | |
| 57 ] | |
| 58 } | |
| 59 | 55 |
| 60 if (visual_studio_version == "2015") { | 56 # Work around crbug.com/526851, bug in VS 2015 RTM compiler. |
| 61 cflags += [ | 57 "/Zc:sizedDealloc-", |
| 62 # Work around crbug.com/526851, bug in VS 2015 RTM compiler. | |
| 63 "/Zc:sizedDealloc-", | |
| 64 | 58 |
| 65 # Disable thread-safe statics to avoid overhead and because | 59 # Disable thread-safe statics to avoid overhead and because |
| 66 # they are disabled on other platforms. See crbug.com/587210 | 60 # they are disabled on other platforms. See crbug.com/587210 |
| 67 # and -fno-threadsafe-statics. | 61 # and -fno-threadsafe-statics. |
| 68 "/Zc:threadSafeInit-", | 62 "/Zc:threadSafeInit-", |
| 69 ] | 63 ] |
| 70 } | |
| 71 | 64 |
| 72 # Building with Clang on Windows is a work in progress and very | 65 # Building with Clang on Windows is a work in progress and very |
| 73 # experimental. See crbug.com/82385. | 66 # experimental. See crbug.com/82385. |
| 74 # Keep this in sync with the similar block in build/common.gypi | |
| 75 if (is_clang) { | 67 if (is_clang) { |
| 76 if (visual_studio_version == "2013") { | 68 cflags += [ "-fmsc-version=1900" ] |
| 77 cflags += [ "-fmsc-version=1800" ] | |
| 78 } else if (visual_studio_version == "2015") { | |
| 79 cflags += [ "-fmsc-version=1900" ] | |
| 80 } | |
| 81 | 69 |
| 82 if (current_cpu == "x86") { | 70 if (current_cpu == "x86") { |
| 83 cflags += [ "-m32" ] | 71 cflags += [ "-m32" ] |
| 84 } else { | 72 } else { |
| 85 cflags += [ "-m64" ] | 73 cflags += [ "-m64" ] |
| 86 } | 74 } |
| 87 | 75 |
| 88 if (exec_script("//build/win/use_ansi_codes.py", [], "trim string") == | 76 if (exec_script("//build/win/use_ansi_codes.py", [], "trim string") == |
| 89 "True") { | 77 "True") { |
| 90 cflags += [ | 78 cflags += [ |
| (...skipping 344 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 435 | 423 |
| 436 # Internal stuff -------------------------------------------------------------- | 424 # Internal stuff -------------------------------------------------------------- |
| 437 | 425 |
| 438 # Config used by the MIDL template to disable warnings. | 426 # Config used by the MIDL template to disable warnings. |
| 439 config("midl_warnings") { | 427 config("midl_warnings") { |
| 440 if (is_clang) { | 428 if (is_clang) { |
| 441 # MIDL generates code like "#endif !_MIDL_USE_GUIDDEF_". | 429 # MIDL generates code like "#endif !_MIDL_USE_GUIDDEF_". |
| 442 cflags = [ "-Wno-extra-tokens" ] | 430 cflags = [ "-Wno-extra-tokens" ] |
| 443 } | 431 } |
| 444 } | 432 } |
| OLD | NEW |