From 380d96e744d6b294ae26ada14a2e4b6610fd81e9 Mon Sep 17 00:00:00 2001 From: thakis Date: Tue, 25 Oct 2016 13:54:59 -0700 Subject: [PATCH] win: Remove unneeded references to visual_studio_version now that it's always 2015. BUG= Review-Url: https://codereview.chromium.org/2450933002 Cr-Original-Commit-Position: refs/heads/master@{#427463} Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src Cr-Mirrored-Commit: a628db5056deb88589224bd68dcd9ec029932c83 --- config/compiler/BUILD.gn | 46 ++++++++++++---------------- config/win/BUILD.gn | 36 ++++++++-------------- config/win/visual_studio_version.gni | 2 +- 3 files changed, 33 insertions(+), 51 deletions(-) diff --git a/config/compiler/BUILD.gn b/config/compiler/BUILD.gn index 42fabf77b..3e14f524f 100644 --- a/config/compiler/BUILD.gn +++ b/config/compiler/BUILD.gn @@ -16,9 +16,6 @@ if (current_cpu == "arm" || current_cpu == "arm64") { if (current_cpu == "mipsel" || current_cpu == "mips64el") { import("//build/config/mips.gni") } -if (is_win) { - import("//build/config/win/visual_studio_version.gni") -} if (is_mac) { import("//build/config/mac/symbols.gni") } @@ -904,28 +901,26 @@ config("default_warnings") { "/wd4459", ] - if (visual_studio_version == "2015") { + cflags += [ + # C4312 is a VS 2015 64-bit warning for integer to larger pointer. + # TODO(brucedawson): fix warnings, crbug.com/554200 + "/wd4312", + + # TODO(brucedawson): http://crbug.com/593448 - C4595 is an 'illegal + # inline operator new' warning that is new in VS 2015 Update 2. + # This is equivalent to clang's no-inline-new-delete warning. + # See http://bugs.icu-project.org/trac/ticket/11122 + "/wd4595", + ] + + if (current_cpu == "x86") { cflags += [ - # C4312 is a VS 2015 64-bit warning for integer to larger pointer. - # TODO(brucedawson): fix warnings, crbug.com/554200 - "/wd4312", - - # TODO(brucedawson): http://crbug.com/593448 - C4595 is an 'illegal - # inline operator new' warning that is new in VS 2015 Update 2. - # This is equivalent to clang's no-inline-new-delete warning. - # See http://bugs.icu-project.org/trac/ticket/11122 - "/wd4595", + # VC++ 2015 changes 32-bit size_t truncation warnings from 4244 to + # 4267. Example: short TruncTest(size_t x) { return x; } + # Since we disable 4244 we need to disable 4267 during migration. + # TODO(jschuh): crbug.com/167187 fix size_t to int truncations. + "/wd4267", ] - - if (current_cpu == "x86") { - cflags += [ - # VC++ 2015 changes 32-bit size_t truncation warnings from 4244 to - # 4267. Example: short TruncTest(size_t x) { return x; } - # Since we disable 4244 we need to disable 4267 during migration. - # TODO(jschuh): crbug.com/167187 fix size_t to int truncations. - "/wd4267", - ] - } } # VS xtree header file needs to be patched or 4702 (unreachable code @@ -938,7 +933,6 @@ config("default_warnings") { # Building with Clang on Windows is a work in progress and very # experimental. See crbug.com/82385. - # Keep this in sync with the similar block in build/common.gypi if (is_clang) { cflags += [ # TODO(hans): Make this list shorter eventually, http://crbug.com/504657 @@ -1519,7 +1513,7 @@ config("symbols") { import("//build/toolchain/goma.gni") cflags = [ "/Zi" ] # Produce PDB file, no edit and continue. - if (is_win_fastlink && visual_studio_version != "2013") { + if (is_win_fastlink) { # Tell VS 2015+ to create a PDB that references debug # information in .obj and .lib files instead of copying # it all. This flag is incompatible with /PROFILE @@ -1562,7 +1556,7 @@ config("minimal_symbols") { if (is_win) { # Linker symbols for backtraces only. cflags = [] - if (is_win_fastlink && visual_studio_version != "2013") { + if (is_win_fastlink) { # Tell VS 2015+ to create a PDB that references debug # information in .obj and .lib files instead of copying # it all. This flag is incompatible with /PROFILE diff --git a/config/win/BUILD.gn b/config/win/BUILD.gn index ebcbb10ce..2b9f7bf77 100644 --- a/config/win/BUILD.gn +++ b/config/win/BUILD.gn @@ -48,36 +48,24 @@ config("compiler") { cflags_c = [ "/TC" ] cflags_cc = [ "/TP" ] - # Flags not supported in version 2013. - if (visual_studio_version != "2013" && visual_studio_version != "2013e") { - cflags += [ - # Tell the compiler to crash on failures. This is undocumented - # and unsupported but very handy. - "/d2FastFail", - ] - } + cflags += [ + # Tell the compiler to crash on failures. This is undocumented + # and unsupported but very handy. + "/d2FastFail", - if (visual_studio_version == "2015") { - cflags += [ - # Work around crbug.com/526851, bug in VS 2015 RTM compiler. - "/Zc:sizedDealloc-", + # Work around crbug.com/526851, bug in VS 2015 RTM compiler. + "/Zc:sizedDealloc-", - # Disable thread-safe statics to avoid overhead and because - # they are disabled on other platforms. See crbug.com/587210 - # and -fno-threadsafe-statics. - "/Zc:threadSafeInit-", - ] - } + # Disable thread-safe statics to avoid overhead and because + # they are disabled on other platforms. See crbug.com/587210 + # and -fno-threadsafe-statics. + "/Zc:threadSafeInit-", + ] # Building with Clang on Windows is a work in progress and very # experimental. See crbug.com/82385. - # Keep this in sync with the similar block in build/common.gypi if (is_clang) { - if (visual_studio_version == "2013") { - cflags += [ "-fmsc-version=1800" ] - } else if (visual_studio_version == "2015") { - cflags += [ "-fmsc-version=1900" ] - } + cflags += [ "-fmsc-version=1900" ] if (current_cpu == "x86") { cflags += [ "-m32" ] diff --git a/config/win/visual_studio_version.gni b/config/win/visual_studio_version.gni index 5bfa9a762..982fbe8d3 100644 --- a/config/win/visual_studio_version.gni +++ b/config/win/visual_studio_version.gni @@ -9,7 +9,7 @@ declare_args() { visual_studio_path = "" # Version of Visual Studio pointed to by the visual_studio_path. - # Use "2013" for Visual Studio 2013, or "2013e" for the Express version. + # Currently always "2015". visual_studio_version = "" # Directory of the Windows driver kit. If visual_studio_path is empty, this