From 4a9abad208cbde5b55e515f584e374ea939b2eea Mon Sep 17 00:00:00 2001 From: kjellander Date: Sun, 18 Sep 2016 08:12:29 -0700 Subject: [PATCH] GN: Enable rtc_common_config for more targets. In the migration to GN templates, some targets got the whole rtc_common_config removed, which can have unpredicted consequences in terms of different code behavior due to defines not being set as expected etc. It's better to enable this config and only disable the warnings that fails the build. BUG=webrtc:6306,webrtc:6307,webrtc:6308 NOTRY=True Review-Url: https://codereview.webrtc.org/2347263002 Cr-Commit-Position: refs/heads/master@{#14280} --- webrtc/examples/BUILD.gn | 16 ++++++++++------ webrtc/modules/video_coding/BUILD.gn | 15 ++++++++++----- webrtc/sdk/BUILD.gn | 15 ++++++++++----- 3 files changed, 30 insertions(+), 16 deletions(-) diff --git a/webrtc/examples/BUILD.gn b/webrtc/examples/BUILD.gn index d05a0c79fd..4ebfeaffcb 100644 --- a/webrtc/examples/BUILD.gn +++ b/webrtc/examples/BUILD.gn @@ -377,8 +377,9 @@ if (is_linux || is_win) { } config("peerconnection_client_warnings_config") { + cflags = [] if (is_win && is_clang) { - cflags = [ + cflags += [ # Disable warnings failing when compiling with Clang on Windows. # https://bugs.chromium.org/p/webrtc/issues/detail?id=5366 "-Wno-format", @@ -390,11 +391,18 @@ if (is_linux || is_win) { ] } if (is_linux && target_cpu == "x86") { - cflags = [ + cflags += [ # Needed to compile on Linux 32-bit. "-Wno-sentinel", ] } + + if (is_clang) { + # TODO(ehmaldonado): Make peerconnection_client compile with the standard + # set of warnings. + # See https://bugs.chromium.org/p/webrtc/issues/detail?id=6306 + cflags += [ "-Wno-inconsistent-missing-override" ] + } } rtc_executable("peerconnection_client") { @@ -407,10 +415,6 @@ if (is_linux || is_win) { "peerconnection/client/peer_connection_client.h", ] - # TODO(ehmaldonado): Make peerconnection_client compile with the standard - # set of warnings. - # See https://bugs.chromium.org/p/webrtc/issues/detail?id=6306 - suppressed_configs += [ rtc_common_config ] if (is_clang) { # Suppress warnings from the Chromium Clang plugin. # See http://code.google.com/p/webrtc/issues/detail?id=163 for details. diff --git a/webrtc/modules/video_coding/BUILD.gn b/webrtc/modules/video_coding/BUILD.gn index 979355d229..3db9b029ba 100644 --- a/webrtc/modules/video_coding/BUILD.gn +++ b/webrtc/modules/video_coding/BUILD.gn @@ -169,6 +169,15 @@ rtc_source_set("webrtc_h264") { } if (is_ios) { + config("webrtc_h264_video_toolbox_warnings_config") { + if (is_clang) { + # TODO(tkchin): Make webrtc_h264_video_toolbox compile with the standard set + # of warnings. + # See https://bugs.chromium.org/p/webrtc/issues/detail?id=6307 + cflags = [ "-Wno-thread-safety-analysis" ] + } + } + rtc_source_set("webrtc_h264_video_toolbox") { sources = [ "codecs/h264/h264_video_toolbox_decoder.cc", @@ -180,15 +189,11 @@ if (is_ios) { ] configs += [ + ":webrtc_h264_video_toolbox_warnings_config", "../..:common_objc", "//build/config/compiler:enable_arc", ] - # TODO(hbos): Make webrtc_h264_video_toolbox compile with the standard set - # of warnings. - # See https://bugs.chromium.org/p/webrtc/issues/detail?id=6307 - suppressed_configs += [ rtc_common_config ] - deps = [ "../../sdk:rtc_sdk_common_objc", ] diff --git a/webrtc/sdk/BUILD.gn b/webrtc/sdk/BUILD.gn index 3b99746ef4..70954eee8b 100644 --- a/webrtc/sdk/BUILD.gn +++ b/webrtc/sdk/BUILD.gn @@ -68,6 +68,15 @@ if (is_ios || (is_mac && mac_deployment_target == "10.7")) { } } + config("rtc_sdk_peerconnection_objc_warnings_config") { + if (is_clang) { + # TODO(tkchin): Make rtc_sdk_peerconnection_objc compile with the standard + # set of warnings. + # See https://bugs.chromium.org/p/webrtc/issues/detail?id=6308 + cflags = [ "-Wno-thread-safety-analysis" ] + } + } + rtc_source_set("rtc_sdk_peerconnection_objc") { sources = [ "objc/Framework/Classes/RTCAVFoundationVideoSource+Private.h", @@ -185,15 +194,11 @@ if (is_ios || (is_mac && mac_deployment_target == "10.7")) { } configs += [ + ":rtc_sdk_peerconnection_objc_warnings_config", "..:common_objc", "//build/config/compiler:enable_arc", ] - # TODO(tkchin): Make rtc_sdk_peerconnection_objc compile with the standard - # set of warnings. - # See https://bugs.chromium.org/p/webrtc/issues/detail?id=6308 - suppressed_configs += [ rtc_common_config ] - public_configs = [ ":rtc_sdk_common_objc_config" ] if (is_clang) {