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