From 8f4419b074b2869e178bb3bd178b8396e4417f3f Mon Sep 17 00:00:00 2001 From: kjellander Date: Thu, 2 Jun 2016 02:09:52 -0700 Subject: [PATCH] GN: Replace Windows suppressions of warning 4267 with config. This makes the GN configurations easier to read. BUG=webrtc:5949 NOTRY=True Review-Url: https://codereview.webrtc.org/2020343003 Cr-Commit-Position: refs/heads/master@{#13006} --- webrtc/modules/audio_processing/BUILD.gn | 8 ++------ webrtc/modules/bitrate_controller/BUILD.gn | 10 +++------- webrtc/modules/congestion_controller/BUILD.gn | 10 +++------- webrtc/modules/media_file/BUILD.gn | 12 ++++-------- webrtc/modules/rtp_rtcp/BUILD.gn | 6 +++--- webrtc/modules/video_coding/BUILD.gn | 18 +++++------------- webrtc/system_wrappers/BUILD.gn | 8 ++++---- webrtc/test/BUILD.gn | 9 ++++----- 8 files changed, 28 insertions(+), 53 deletions(-) diff --git a/webrtc/modules/audio_processing/BUILD.gn b/webrtc/modules/audio_processing/BUILD.gn index a9650f7429..56d4bff65a 100644 --- a/webrtc/modules/audio_processing/BUILD.gn +++ b/webrtc/modules/audio_processing/BUILD.gn @@ -207,12 +207,8 @@ source_set("audio_processing") { sources += [ "aecm/aecm_core_c.cc" ] } - if (is_win) { - cflags = [ - # TODO(jschuh): Bug 1348: fix this warning. - "/wd4267", # size_t to int truncations - ] - } + # TODO(jschuh): Bug 1348: fix this warning. + configs += [ "//build/config/compiler:no_size_t_to_int_warning" ] if (is_clang) { # Suppress warnings from Chrome's Clang plugins. diff --git a/webrtc/modules/bitrate_controller/BUILD.gn b/webrtc/modules/bitrate_controller/BUILD.gn index 5e3741ba93..029f54170f 100644 --- a/webrtc/modules/bitrate_controller/BUILD.gn +++ b/webrtc/modules/bitrate_controller/BUILD.gn @@ -18,16 +18,12 @@ source_set("bitrate_controller") { "send_side_bandwidth_estimation.h", ] - if (is_win) { - cflags = [ - # TODO(jschuh): Bug 1348: fix this warning. - "/wd4267", # size_t to int truncations - ] - } - configs += [ "../..:common_config" ] public_configs = [ "../..:common_inherited_config" ] + # TODO(jschuh): Bug 1348: fix this warning. + configs += [ "//build/config/compiler:no_size_t_to_int_warning" ] + if (is_clang) { # Suppress warnings from Chrome's Clang plugins. # See http://code.google.com/p/webrtc/issues/detail?id=163 for details. diff --git a/webrtc/modules/congestion_controller/BUILD.gn b/webrtc/modules/congestion_controller/BUILD.gn index 8723fe4475..3835c190ea 100644 --- a/webrtc/modules/congestion_controller/BUILD.gn +++ b/webrtc/modules/congestion_controller/BUILD.gn @@ -14,16 +14,12 @@ source_set("congestion_controller") { "include/congestion_controller.h", ] - if (is_win) { - cflags = [ - # TODO(jschuh): Bug 1348: fix this warning. - "/wd4267", # size_t to int truncations - ] - } - configs += [ "../..:common_config" ] public_configs = [ "../..:common_inherited_config" ] + # TODO(jschuh): Bug 1348: fix this warning. + configs += [ "//build/config/compiler:no_size_t_to_int_warning" ] + if (is_clang) { # Suppress warnings from Chrome's Clang plugins. # See http://code.google.com/p/webrtc/issues/detail?id=163 for details. diff --git a/webrtc/modules/media_file/BUILD.gn b/webrtc/modules/media_file/BUILD.gn index 2a4be728f3..84f094fd11 100644 --- a/webrtc/modules/media_file/BUILD.gn +++ b/webrtc/modules/media_file/BUILD.gn @@ -22,19 +22,15 @@ source_set("media_file") { "media_file_utility.h", ] - if (is_win) { - cflags = [ - # TODO(jschuh): Bug 1348: fix this warning. - "/wd4267", # size_t to int truncations - ] - } - configs += [ "../..:common_config" ] public_configs = [ "../..:common_inherited_config", ":media_file_config", ] + # TODO(jschuh): Bug 1348: fix this warning. + configs += [ "//build/config/compiler:no_size_t_to_int_warning" ] + if (is_clang) { # Suppress warnings from Chrome's Clang plugins. # See http://code.google.com/p/webrtc/issues/detail?id=163 for details. @@ -43,7 +39,7 @@ source_set("media_file") { deps = [ "../..:webrtc_common", - "../../system_wrappers", "../../common_audio", + "../../system_wrappers", ] } diff --git a/webrtc/modules/rtp_rtcp/BUILD.gn b/webrtc/modules/rtp_rtcp/BUILD.gn index b826fd1ea9..0f9dd8ad51 100644 --- a/webrtc/modules/rtp_rtcp/BUILD.gn +++ b/webrtc/modules/rtp_rtcp/BUILD.gn @@ -171,11 +171,11 @@ source_set("rtp_rtcp") { "../remote_bitrate_estimator", ] + # TODO(jschuh): Bug 1348: fix this warning. + configs += [ "//build/config/compiler:no_size_t_to_int_warning" ] + if (is_win) { cflags = [ - # TODO(jschuh): Bug 1348: fix this warning. - "/wd4267", # size_t to int truncations - # TODO(kjellander): Bug 261: fix this warning. "/wd4373", # virtual function override. ] diff --git a/webrtc/modules/video_coding/BUILD.gn b/webrtc/modules/video_coding/BUILD.gn index c18ae7152d..0ea5ea2455 100644 --- a/webrtc/modules/video_coding/BUILD.gn +++ b/webrtc/modules/video_coding/BUILD.gn @@ -75,12 +75,8 @@ source_set("video_coding") { configs += [ "../..:common_config" ] public_configs = [ "../..:common_inherited_config" ] - if (is_win) { - cflags = [ - # TODO(jschuh): Bug 1348: fix this warning. - "/wd4267", # size_t to int truncation. - ] - } + # TODO(jschuh): Bug 1348: fix this warning. + configs += [ "//build/config/compiler:no_size_t_to_int_warning" ] if (is_clang) { # Suppress warnings from Chrome's Clang plugins. @@ -263,19 +259,15 @@ source_set("webrtc_vp8") { configs += [ "../..:common_config" ] public_configs = [ "../..:common_inherited_config" ] + # TODO(jschuh): Bug 1348: fix this warning. + configs += [ "//build/config/compiler:no_size_t_to_int_warning" ] + if (is_clang) { # Suppress warnings from Chrome's Clang plugins. # See http://code.google.com/p/webrtc/issues/detail?id=163 for details. configs -= [ "//build/config/clang:find_bad_constructs" ] } - if (is_win) { - cflags = [ - # TODO(jschuh): Bug 1348: fix this warning. - "/wd4267", # size_t to int truncation. - ] - } - deps = [ ":video_coding_utility", "../..:webrtc_common", diff --git a/webrtc/system_wrappers/BUILD.gn b/webrtc/system_wrappers/BUILD.gn index 435418fcd1..a1e97d9d47 100644 --- a/webrtc/system_wrappers/BUILD.gn +++ b/webrtc/system_wrappers/BUILD.gn @@ -121,13 +121,13 @@ static_library("system_wrappers") { sources += [ "source/atomic32_darwin.cc" ] } + # TODO(jschuh): Bug 1348: fix this warning. + configs += [ "//build/config/compiler:no_size_t_to_int_warning" ] + if (is_win) { libs += [ "winmm.lib" ] - cflags = [ - "/wd4267", # size_t to int truncation. - "/wd4334", # Ignore warning on shift operator promotion. - ] + cflags = [ "/wd4334" ] # Ignore warning on shift operator promotion. } deps += [ "../base:rtc_base_approved" ] diff --git a/webrtc/test/BUILD.gn b/webrtc/test/BUILD.gn index 631645e99a..451514089a 100644 --- a/webrtc/test/BUILD.gn +++ b/webrtc/test/BUILD.gn @@ -288,12 +288,11 @@ test("test_support_unittests") { configs += [ "..:common_config" ] public_configs = [ "..:common_inherited_config" ] + # TODO(jschuh): Bug 1348: fix this warning. + configs += [ "//build/config/compiler:no_size_t_to_int_warning" ] + if (is_win) { - cflags = [ - # TODO(jschuh): Bug 1348: fix this warning. - "/wd4267", # size_t to int truncations - "/wd4373", # virtual override w/different const/volatile signature. - ] + cflags = [ "/wd4373" ] # virtual override w/different const/volatile signature. } if (is_clang) {