GN Templates: Move common_config to the template.

Remove common_config from the targets' config and add
it to the template instead.

BUG=webrtc:6187
NOTRY=True

Review-Url: https://codereview.webrtc.org/2300413002
Cr-Commit-Position: refs/heads/master@{#14063}
diff --git a/webrtc/BUILD.gn b/webrtc/BUILD.gn
index ae109a1..aaa1d72 100644
--- a/webrtc/BUILD.gn
+++ b/webrtc/BUILD.gn
@@ -247,7 +247,6 @@
     ]
 
     defines = []
-    configs += [ ":common_config" ]
     public_configs = [ ":common_inherited_config" ]
 
     deps = [
@@ -338,7 +337,6 @@
     "typedefs.h",
   ]
 
-  configs += [ ":common_config" ]
   public_configs = [ ":common_inherited_config" ]
 
   if (is_clang && !is_nacl) {
@@ -366,7 +364,6 @@
   ]
 
   defines = []
-  configs += [ ":common_config" ]
   public_configs = [ ":common_inherited_config" ]
 
   deps = [
@@ -392,7 +389,6 @@
       "call/rtc_event_log_parser.h",
     ]
 
-    configs += [ ":common_config" ]
     public_configs = [ ":common_inherited_config" ]
 
     public_deps = [
@@ -586,10 +582,7 @@
       ]
     }
 
-    configs += [
-      ":common_config",
-      ":rtc_unittests_config",
-    ]
+    configs += [ ":rtc_unittests_config" ]
     public_configs = [ ":common_inherited_config" ]
 
     if (is_clang) {
@@ -638,10 +631,7 @@
   }
 
   rtc_test("xmllite_xmpp_unittests") {
-    configs += [
-      ":common_config",
-      ":rtc_unittests_config",
-    ]
+    configs += [ ":rtc_unittests_config" ]
     public_configs = [ ":common_inherited_config" ]
 
     if (is_clang) {
@@ -728,7 +718,6 @@
 
   rtc_source_set("video_quality_test") {
     testonly = true
-    configs += [ ":common_config" ]
     public_configs = [ ":common_inherited_config" ]
     sources = [
       "video/video_quality_test.cc",
@@ -778,10 +767,7 @@
 
   rtc_test("webrtc_perf_tests") {
     testonly = true
-    configs += [
-      ":common_config",
-      ":rtc_unittests_config",
-    ]
+    configs += [ ":rtc_unittests_config" ]
     public_configs = [ ":common_inherited_config" ]
 
     if (!is_debug) {
@@ -832,10 +818,7 @@
 
   rtc_test("webrtc_nonparallel_tests") {
     testonly = true
-    configs += [
-      ":common_config",
-      ":rtc_unittests_config",
-    ]
+    configs += [ ":rtc_unittests_config" ]
     public_configs = [ ":common_inherited_config" ]
     sources = [
       "base/nullsocketserver_unittest.cc",
diff --git a/webrtc/api/BUILD.gn b/webrtc/api/BUILD.gn
index 176df9e..fba49ef 100644
--- a/webrtc/api/BUILD.gn
+++ b/webrtc/api/BUILD.gn
@@ -26,7 +26,6 @@
     "call/audio_state.h",
   ]
 
-  configs += [ "..:common_config" ]
   public_configs = [ "..:common_inherited_config" ]
 
   deps = [
@@ -119,10 +118,7 @@
     "webrtcsessiondescriptionfactory.h",
   ]
 
-  configs += [
-    "..:common_config",
-    ":libjingle_peerconnection_warnings_config",
-  ]
+  configs += [ ":libjingle_peerconnection_warnings_config" ]
   public_configs = [ "..:common_inherited_config" ]
 
   if (is_clang) {
@@ -190,10 +186,7 @@
       "androidvideotracksource.h",
     ]
 
-    configs += [
-      "..:common_config",
-      ":libjingle_peerconnection_jni_warnings_config",
-    ]
+    configs += [ ":libjingle_peerconnection_jni_warnings_config" ]
     public_configs = [ "..:common_inherited_config" ]
 
     if (is_clang) {
@@ -372,10 +365,7 @@
 
     defines = [ "HAVE_SCTP" ]
 
-    configs += [
-      "..:common_config",
-      ":peerconnection_unittests_config",
-    ]
+    configs += [ ":peerconnection_unittests_config" ]
     public_configs = [ "..:common_inherited_config" ]
 
     if (is_clang) {
diff --git a/webrtc/audio/BUILD.gn b/webrtc/audio/BUILD.gn
index ead25f8..9e6b26f 100644
--- a/webrtc/audio/BUILD.gn
+++ b/webrtc/audio/BUILD.gn
@@ -20,7 +20,6 @@
     "scoped_voe_interface.h",
   ]
 
-  configs += [ "..:common_config" ]
   public_configs = [ "..:common_inherited_config" ]
 
   if (is_clang) {
diff --git a/webrtc/base/BUILD.gn b/webrtc/base/BUILD.gn
index aeb2f35..e7c01be 100644
--- a/webrtc/base/BUILD.gn
+++ b/webrtc/base/BUILD.gn
@@ -94,7 +94,6 @@
   defines = []
   libs = []
   deps = []
-  configs += [ "..:common_config" ]
   public_configs = [ "..:common_inherited_config" ]
   all_dependent_configs = [ ":rtc_base_approved_all_dependent_config" ]
 
@@ -212,7 +211,6 @@
   public_deps = [
     ":rtc_base_approved",
   ]
-  configs += [ "..:common_config" ]
 
   sources = [
     "sequenced_task_checker.h",
@@ -280,7 +278,6 @@
   ]
 
   configs += [
-    "..:common_config",
     ":openssl_config",
     ":rtc_base_config",
   ]
@@ -734,10 +731,7 @@
       "timedelta.h",
       "unittest_main.cc",
     ]
-    configs += [
-      "..:common_config",
-      ":rtc_base_tests_utils_warnings_config",
-    ]
+    configs += [ ":rtc_base_tests_utils_warnings_config" ]
     public_configs = [
       "..:common_inherited_config",
       ":rtc_base_tests_utils_exported_config",
diff --git a/webrtc/build/webrtc.gni b/webrtc/build/webrtc.gni
index 26752ca..60546ad 100644
--- a/webrtc/build/webrtc.gni
+++ b/webrtc/build/webrtc.gni
@@ -161,27 +161,35 @@
 # different subdirectories.
 webrtc_root = get_path_info("../", "abspath")
 
+# Global configuration that should be applied to all WebRTC targets.
+# You normally shouldn't need to # include this in your target as it's
+# automatically included when using the rtc_* templates.
+# It sets defines, include paths and compilation warnings accordingly,
+# both for WebRTC stand-alone builds and for the scenario when WebRTC
+# native code is built as part of Chromium.
+rtc_common_config = webrtc_root + ":common_config"
+
 # Common configs to remove or add in all rtc targets.
 rtc_remove_configs = []
-rtc_add_configs = []
+rtc_add_configs = [ rtc_common_config ]
 
 set_defaults("rtc_test") {
-  configs = []
+  configs = rtc_add_configs
   suppressed_configs = []
 }
 
 set_defaults("rtc_source_set") {
-  configs = []
+  configs = rtc_add_configs
   suppressed_configs = []
 }
 
 set_defaults("rtc_executable") {
-  configs = []
+  configs = rtc_add_configs
   suppressed_configs = []
 }
 
 set_defaults("rtc_static_library") {
-  configs = []
+  configs = rtc_add_configs
   suppressed_configs = []
 }
 
@@ -194,7 +202,6 @@
                              "suppressed_configs",
                            ])
     configs += invoker.configs
-    configs += rtc_add_configs
     configs -= rtc_remove_configs
     configs -= invoker.suppressed_configs
   }
@@ -209,7 +216,6 @@
                              "suppressed_configs",
                            ])
     configs += invoker.configs
-    configs += rtc_add_configs
     configs -= rtc_remove_configs
     configs -= invoker.suppressed_configs
   }
@@ -225,7 +231,6 @@
                              "suppressed_configs",
                            ])
     configs += invoker.configs
-    configs += rtc_add_configs
     configs -= rtc_remove_configs
     configs -= invoker.suppressed_configs
     deps = [
@@ -244,7 +249,6 @@
                              "suppressed_configs",
                            ])
     configs += invoker.configs
-    configs += rtc_add_configs
     configs -= rtc_remove_configs
     configs -= invoker.suppressed_configs
   }
diff --git a/webrtc/call/BUILD.gn b/webrtc/call/BUILD.gn
index ee708c5..eb4f240 100644
--- a/webrtc/call/BUILD.gn
+++ b/webrtc/call/BUILD.gn
@@ -16,7 +16,6 @@
     "transport_adapter.h",
   ]
 
-  configs += [ "..:common_config" ]
   public_configs = [ "..:common_inherited_config" ]
 
   if (is_clang) {
@@ -53,7 +52,6 @@
       "//testing/gmock",
       "//testing/gtest",
     ]
-    configs += [ "..: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/common_audio/BUILD.gn b/webrtc/common_audio/BUILD.gn
index 35f715a..195e971 100644
--- a/webrtc/common_audio/BUILD.gn
+++ b/webrtc/common_audio/BUILD.gn
@@ -172,8 +172,6 @@
     cflags = [ "/wd4334" ]  # Ignore warning on shift operator promotion.
   }
 
-  configs += [ "..:common_config" ]
-
   public_configs = [
     "..:common_inherited_config",
     ":common_audio_config",
@@ -238,7 +236,6 @@
       ]
     }
 
-    configs += [ "..:common_config" ]
     public_configs = [ "..:common_inherited_config" ]
 
     if (is_clang) {
@@ -287,7 +284,6 @@
       sources += [ "resampler/sinc_resampler_unittest.cc" ]
     }
 
-    configs += [ "..:common_config" ]
     public_configs = [ "..:common_inherited_config" ]
 
     if (rtc_use_openmax_dl) {
diff --git a/webrtc/common_video/BUILD.gn b/webrtc/common_video/BUILD.gn
index cb1f024..2f2dbef 100644
--- a/webrtc/common_video/BUILD.gn
+++ b/webrtc/common_video/BUILD.gn
@@ -43,7 +43,6 @@
 
   include_dirs = [ "../modules/interface" ]
 
-  configs += [ "..:common_config" ]
   public_configs = [
     "..:common_inherited_config",
     ":common_video_config",
@@ -108,7 +107,6 @@
       "libyuv/libyuv_unittest.cc",
     ]
 
-    configs += [ "..:common_config" ]
     public_configs = [ "..:common_inherited_config" ]
 
     # TODO(jschuh): Bug 1348: fix this warning.
diff --git a/webrtc/examples/BUILD.gn b/webrtc/examples/BUILD.gn
index de88afb..f60f559 100644
--- a/webrtc/examples/BUILD.gn
+++ b/webrtc/examples/BUILD.gn
@@ -140,7 +140,6 @@
       "objc/AppRTCDemo/common/ARDUtilities.m",
     ]
     configs += [
-      "..:common_config",
       ":warnings_config",
       "//build/config/compiler:enable_arc",
     ]
@@ -209,7 +208,6 @@
       "objc/AppRTCDemo/RTCSessionDescription+JSON.m",
     ]
     configs += [
-      "..:common_config",
       "//build/config/compiler:enable_arc",
       ":warnings_config",
     ]
@@ -299,7 +297,6 @@
         "objc/AppRTCDemo/mac/APPRTCViewController.m",
       ]
       configs += [
-        "..:common_config",
         "..:common_objc",
         "//build/config/compiler:enable_arc",
       ]
@@ -360,7 +357,6 @@
       "objc/AppRTCDemo/third_party/SocketRocket/SRWebSocket.m",
     ]
     configs += [
-      "..:common_config",
       "//build/config/compiler:enable_arc",
       ":socketrocket_warning_config",
     ]
@@ -413,6 +409,11 @@
       "peerconnection/client/peer_connection_client.cc",
       "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/libjingle/xmllite/BUILD.gn b/webrtc/libjingle/xmllite/BUILD.gn
index 936e2b9..3f5d382 100644
--- a/webrtc/libjingle/xmllite/BUILD.gn
+++ b/webrtc/libjingle/xmllite/BUILD.gn
@@ -43,7 +43,6 @@
     ]
   }
 
-  configs += [ "../..:common_config" ]
   public_configs = [ "../..:common_inherited_config" ]
 
   if (!build_with_chromium && is_clang) {
diff --git a/webrtc/libjingle/xmpp/BUILD.gn b/webrtc/libjingle/xmpp/BUILD.gn
index 87152ef..2e4bb0d 100644
--- a/webrtc/libjingle/xmpp/BUILD.gn
+++ b/webrtc/libjingle/xmpp/BUILD.gn
@@ -74,10 +74,7 @@
     ]
   }
 
-  configs += [
-    "../..:common_config",
-    ":xmpp_warnings_config",
-  ]
+  configs += [ ":xmpp_warnings_config" ]
 
   public_configs = [
     "../..:common_inherited_config",
diff --git a/webrtc/media/BUILD.gn b/webrtc/media/BUILD.gn
index 1a526a6..e3b6843 100644
--- a/webrtc/media/BUILD.gn
+++ b/webrtc/media/BUILD.gn
@@ -117,10 +117,7 @@
     "sctp/sctpdataengine.h",
   ]
 
-  configs += [
-    "..:common_config",
-    ":rtc_media_warnings_config",
-  ]
+  configs += [ ":rtc_media_warnings_config" ]
 
   public_configs = [ "..:common_inherited_config" ]
 
@@ -250,10 +247,7 @@
       "engine/fakewebrtcvoiceengine.h",
     ]
 
-    configs += [
-      "..:common_config",
-      ":rtc_unittest_main_config",
-    ]
+    configs += [ ":rtc_unittest_main_config" ]
     public_configs = [ "..:common_inherited_config" ]
 
     if (rtc_build_libyuv) {
@@ -349,10 +343,7 @@
       "sctp/sctpdataengine_unittest.cc",
     ]
 
-    configs += [
-      "..:common_config",
-      ":rtc_media_unittests_config",
-    ]
+    configs += [ ":rtc_media_unittests_config" ]
     public_configs = [ "..:common_inherited_config" ]
 
     if (rtc_use_h264) {
diff --git a/webrtc/modules/BUILD.gn b/webrtc/modules/BUILD.gn
index c3e24a1..76edef5 100644
--- a/webrtc/modules/BUILD.gn
+++ b/webrtc/modules/BUILD.gn
@@ -54,7 +54,6 @@
   rtc_test("modules_tests") {
     testonly = true
 
-    configs += [ "..:common_config" ]
     public_configs = [ "..:common_inherited_config" ]
 
     videoprocessor_defines = []
@@ -567,7 +566,6 @@
       deps += [ rtc_libvpx_dir ]
     }
 
-    configs += [ "..:common_config" ]
     public_configs = [ "..:common_inherited_config" ]
 
     # TODO(jschuh): bugs.webrtc.org/1348: fix this warning.
diff --git a/webrtc/modules/audio_coding/BUILD.gn b/webrtc/modules/audio_coding/BUILD.gn
index 1738c5c..ce35737 100644
--- a/webrtc/modules/audio_coding/BUILD.gn
+++ b/webrtc/modules/audio_coding/BUILD.gn
@@ -45,7 +45,6 @@
     "codecs/audio_format.cc",
     "codecs/audio_format.h",
   ]
-  configs += [ "../..:common_config" ]
   public_configs = [ "../..:common_inherited_config" ]
   deps = [
     "../..:webrtc_common",
@@ -57,7 +56,6 @@
     "codecs/builtin_audio_decoder_factory.cc",
     "codecs/builtin_audio_decoder_factory.h",
   ]
-  configs += [ "../..:common_config" ]
   public_configs = [ "../..:common_inherited_config" ]
   deps = [
            "../..:webrtc_common",
@@ -73,7 +71,6 @@
     "acm2/rent_a_codec.cc",
     "acm2/rent_a_codec.h",
   ]
-  configs += [ "../..:common_config" ]
   public_configs = [ "../..:common_inherited_config" ]
   deps = [ "../..:webrtc_common" ] + audio_codec_deps
   defines = audio_codec_defines
@@ -106,8 +103,6 @@
 
   defines = []
 
-  configs += [ "../..:common_config" ]
-
   public_configs = [
     "../..:common_inherited_config",
     ":audio_coding_config",
@@ -139,7 +134,6 @@
     "codecs/audio_decoder.cc",
     "codecs/audio_decoder.h",
   ]
-  configs += [ "../..:common_config" ]
   public_configs = [ "../..:common_inherited_config" ]
   deps = [
     "../..:webrtc_common",
@@ -152,7 +146,6 @@
     "codecs/audio_encoder.cc",
     "codecs/audio_encoder.h",
   ]
-  configs += [ "../..:common_config" ]
   public_configs = [ "../..:common_inherited_config" ]
   deps = [
     "../..:webrtc_common",
@@ -175,8 +168,6 @@
     "codecs/cng/webrtc_cng.h",
   ]
 
-  configs += [ "../..:common_config" ]
-
   public_configs = [
     "../..:common_inherited_config",
     ":cng_config",
@@ -198,8 +189,6 @@
     "codecs/red/audio_encoder_copy_red.h",
   ]
 
-  configs += [ "../..:common_config" ]
-
   public_configs = [
     "../..:common_inherited_config",
     ":red_config",
@@ -230,8 +219,6 @@
     "codecs/g711/g711_interface.h",
   ]
 
-  configs += [ "../..:common_config" ]
-
   public_configs = [
     "../..:common_inherited_config",
     ":g711_config",
@@ -263,8 +250,6 @@
     "codecs/g722/g722_interface.h",
   ]
 
-  configs += [ "../..:common_config" ]
-
   public_configs = [
     "../..:common_inherited_config",
     ":g722_config",
@@ -430,8 +415,6 @@
     "codecs/ilbc/xcorr_coef.h",
   ]
 
-  configs += [ "../..:common_config" ]
-
   public_configs = [
     "../..:common_inherited_config",
     ":ilbc_config",
@@ -524,8 +507,6 @@
     libs = [ "m" ]
   }
 
-  configs += [ "../..:common_config" ]
-
   public_configs = [
     "../..:common_inherited_config",
     ":isac_config",
@@ -604,8 +585,6 @@
     defines = [ "WEBRTC_LINUX" ]
   }
 
-  configs += [ "../..:common_config" ]
-
   public_configs = [
     "../..:common_inherited_config",
     ":isac_fix_config",
@@ -686,7 +665,6 @@
       ]
     }
 
-    configs += [ "../..:common_config" ]
     public_configs = [ "../..:common_inherited_config" ]
 
     deps = [
@@ -718,8 +696,6 @@
     ":g711",
   ]
 
-  configs += [ "../..:common_config" ]
-
   public_configs = [
     "../..:common_inherited_config",
     ":pcm16b_config",
@@ -748,7 +724,6 @@
   ]
 
   if (rtc_build_opus) {
-    configs += [ "../..:common_config" ]
     public_configs = [ "../..:common_inherited_config" ]
 
     public_deps = [
@@ -844,8 +819,6 @@
     "neteq/timestamp_scaler.h",
   ]
 
-  configs += [ "../..:common_config" ]
-
   public_configs = [
     "../..:common_inherited_config",
     ":neteq_config",
@@ -894,7 +867,6 @@
       "acm2/acm_receive_test_oldapi.h",
     ]
 
-    configs += [ "../..:common_config" ]
     public_configs = [ "../..:common_inherited_config" ]
 
     defines = audio_coding_defines
@@ -913,7 +885,6 @@
       "acm2/acm_send_test_oldapi.h",
     ]
 
-    configs += [ "../..:common_config" ]
     public_configs = [ "../..:common_inherited_config" ]
 
     defines = audio_coding_defines
@@ -934,7 +905,6 @@
       "test/utility.cc",
     ]
 
-    configs += [ "../..:common_config" ]
     public_configs = [ "../..:common_inherited_config" ]
 
     deps = [
@@ -957,7 +927,6 @@
       "test/insert_packet_with_timing.cc",
     ]
 
-    configs += [ "../..:common_config" ]
     public_configs = [ "../..:common_inherited_config" ]
 
     if (is_clang) {
@@ -999,7 +968,6 @@
       "neteq/audio_decoder_unittest.cc",
     ]
 
-    configs += [ "../..:common_config" ]
     public_configs = [ "../..:common_inherited_config" ]
 
     if (is_clang) {
@@ -1134,7 +1102,6 @@
       "neteq/tools/neteq_performance_test.h",
     ]
 
-    configs += [ "../..:common_config" ]
     public_configs = [ "../..:common_inherited_config" ]
 
     if (!is_debug) {
@@ -1163,7 +1130,6 @@
       "neteq/tools/neteq_quality_test.h",
     ]
 
-    configs += [ "../..:common_config" ]
     public_configs = [ "../..:common_inherited_config" ]
 
     if (is_clang) {
@@ -1218,7 +1184,6 @@
       "neteq/tools/rtp_generator.h",
     ]
 
-    configs += [ "../..:common_config" ]
     public_configs = [
       "../..:common_inherited_config",
       ":neteq_unittest_tools_config",
@@ -1560,7 +1525,6 @@
       "codecs/g711/test/testG711.cc",
     ]
 
-    configs += [ "../..:common_config" ]
     public_configs = [ "../..:common_inherited_config" ]
 
     deps = [
@@ -1575,7 +1539,6 @@
       "codecs/g722/test/testG722.cc",
     ]
 
-    configs += [ "../..:common_config" ]
     public_configs = [ "../..:common_inherited_config" ]
 
     deps = [
@@ -1592,7 +1555,6 @@
       "codecs/isac/main/util/utility.c",
     ]
 
-    configs += [ "../..:common_config" ]
     public_configs = [ "../..:common_inherited_config" ]
 
     deps = [
@@ -1615,7 +1577,6 @@
       "codecs/isac/main/util/utility.c",
     ]
 
-    configs += [ "../..:common_config" ]
     public_configs = [ "../..:common_inherited_config" ]
 
     deps = [
@@ -1637,7 +1598,6 @@
       "codecs/ilbc/test/iLBC_test.c",
     ]
 
-    configs += [ "../..:common_config" ]
     public_configs = [ "../..:common_inherited_config" ]
 
     deps = [
diff --git a/webrtc/modules/audio_conference_mixer/BUILD.gn b/webrtc/modules/audio_conference_mixer/BUILD.gn
index 72379fa..286cb7f 100644
--- a/webrtc/modules/audio_conference_mixer/BUILD.gn
+++ b/webrtc/modules/audio_conference_mixer/BUILD.gn
@@ -31,8 +31,6 @@
     "source/time_scheduler.h",
   ]
 
-  configs += [ "../..:common_config" ]
-
   public_configs = [
     "../..:common_inherited_config",
     ":audio_conference_mixer_config",
diff --git a/webrtc/modules/audio_device/BUILD.gn b/webrtc/modules/audio_device/BUILD.gn
index 898147d..4151e37 100644
--- a/webrtc/modules/audio_device/BUILD.gn
+++ b/webrtc/modules/audio_device/BUILD.gn
@@ -49,7 +49,6 @@
 }
 
 rtc_source_set("audio_device") {
-  configs += [ "../..:common_config" ]
   public_configs = [
     "../..:common_inherited_config",
     ":audio_device_config",
@@ -263,7 +262,6 @@
       "../utility",
       "//testing/gtest",
     ]
-    configs += [ "../..:common_config" ]
     public_configs = [
       "../..:common_inherited_config",
       ":audio_device_config",
diff --git a/webrtc/modules/audio_mixer/BUILD.gn b/webrtc/modules/audio_mixer/BUILD.gn
index 51fd785..76ac49a 100644
--- a/webrtc/modules/audio_mixer/BUILD.gn
+++ b/webrtc/modules/audio_mixer/BUILD.gn
@@ -27,8 +27,6 @@
     "audio_mixer.h",
   ]
 
-  configs += [ "../..:common_config" ]
-
   public_configs = [
     "../..:common_inherited_config",
     ":audio_conference_mixer_config",
diff --git a/webrtc/modules/audio_processing/BUILD.gn b/webrtc/modules/audio_processing/BUILD.gn
index d65b5f8..3fb2268 100644
--- a/webrtc/modules/audio_processing/BUILD.gn
+++ b/webrtc/modules/audio_processing/BUILD.gn
@@ -151,7 +151,6 @@
     "voice_detection_impl.h",
   ]
 
-  configs += [ "../..:common_config" ]
   public_configs = [ "../..:common_inherited_config" ]
 
   defines = []
@@ -264,7 +263,6 @@
       cflags = [ "-msse2" ]
     }
 
-    configs += [ "../..:common_config" ]
     public_configs = [ "../..:common_inherited_config" ]
 
     if (apm_debug_dump) {
@@ -301,7 +299,6 @@
       ]
     }
 
-    configs += [ "../..:common_config" ]
     public_configs = [ "../..:common_inherited_config" ]
 
     deps = [
@@ -323,7 +320,6 @@
       "test/process_test.cc",
     ]
 
-    configs += [ "../..:common_config" ]
     public_configs = [ "../..:common_inherited_config" ]
 
     deps = [
@@ -345,7 +341,6 @@
       "test/unpack.cc",
     ]
 
-    configs += [ "../..:common_config" ]
     public_configs = [ "../..:common_inherited_config" ]
 
     deps = [
@@ -371,7 +366,6 @@
       "test/wav_based_simulator.h",
     ]
 
-    configs += [ "../..:common_config" ]
     public_configs = [ "../..:common_inherited_config" ]
 
     deps = [
@@ -396,7 +390,6 @@
       "test/test_utils.h",
     ]
 
-    configs += [ "../..:common_config" ]
     public_configs = [ "../..:common_inherited_config" ]
 
     deps = [
diff --git a/webrtc/modules/bitrate_controller/BUILD.gn b/webrtc/modules/bitrate_controller/BUILD.gn
index 2d5e982..8cdfba2 100644
--- a/webrtc/modules/bitrate_controller/BUILD.gn
+++ b/webrtc/modules/bitrate_controller/BUILD.gn
@@ -18,7 +18,6 @@
     "send_side_bandwidth_estimation.h",
   ]
 
-  configs += [ "../..:common_config" ]
   public_configs = [ "../..:common_inherited_config" ]
 
   # TODO(jschuh): Bug 1348: fix this warning.
diff --git a/webrtc/modules/congestion_controller/BUILD.gn b/webrtc/modules/congestion_controller/BUILD.gn
index c8d6847..3948096 100644
--- a/webrtc/modules/congestion_controller/BUILD.gn
+++ b/webrtc/modules/congestion_controller/BUILD.gn
@@ -18,7 +18,6 @@
     "probe_bitrate_estimator.h",
   ]
 
-  configs += [ "../..:common_config" ]
   public_configs = [ "../..:common_inherited_config" ]
 
   # TODO(jschuh): Bug 1348: fix this warning.
diff --git a/webrtc/modules/desktop_capture/BUILD.gn b/webrtc/modules/desktop_capture/BUILD.gn
index 8e3f36d..c91f7f2 100644
--- a/webrtc/modules/desktop_capture/BUILD.gn
+++ b/webrtc/modules/desktop_capture/BUILD.gn
@@ -148,7 +148,6 @@
     ]
   }
 
-  configs += [ "../..:common_config" ]
   public_configs = [ "../..:common_inherited_config" ]
 
   if (is_clang && !is_nacl) {
@@ -178,7 +177,6 @@
       "differ_block_sse2.h",
     ]
 
-    configs += [ "../..:common_config" ]
     public_configs = [ "../..:common_inherited_config" ]
 
     if (is_posix) {
diff --git a/webrtc/modules/media_file/BUILD.gn b/webrtc/modules/media_file/BUILD.gn
index c4d5424..b751343 100644
--- a/webrtc/modules/media_file/BUILD.gn
+++ b/webrtc/modules/media_file/BUILD.gn
@@ -22,7 +22,6 @@
     "media_file_utility.h",
   ]
 
-  configs += [ "../..:common_config" ]
   public_configs = [
     "../..:common_inherited_config",
     ":media_file_config",
diff --git a/webrtc/modules/pacing/BUILD.gn b/webrtc/modules/pacing/BUILD.gn
index 0cf8e6e..aed3293 100644
--- a/webrtc/modules/pacing/BUILD.gn
+++ b/webrtc/modules/pacing/BUILD.gn
@@ -18,7 +18,6 @@
     "packet_router.h",
   ]
 
-  configs += [ "../..:common_config" ]
   public_configs = [ "../..:common_inherited_config" ]
 
   if (is_clang) {
diff --git a/webrtc/modules/remote_bitrate_estimator/BUILD.gn b/webrtc/modules/remote_bitrate_estimator/BUILD.gn
index ea4f38e..6377eae 100644
--- a/webrtc/modules/remote_bitrate_estimator/BUILD.gn
+++ b/webrtc/modules/remote_bitrate_estimator/BUILD.gn
@@ -46,7 +46,6 @@
     defines = [ "BWE_TEST_LOGGING_COMPILE_TIME_ENABLE=0" ]
   }
 
-  configs += [ "../..:common_config" ]
   public_configs = [ "../..:common_inherited_config" ]
 
   if (is_clang) {
@@ -100,7 +99,6 @@
       defines = [ "BWE_TEST_LOGGING_COMPILE_TIME_ENABLE=0" ]
     }
 
-    configs += [ "../..:common_config" ]
     public_configs = [ "../..:common_inherited_config" ]
 
     if (is_clang) {
diff --git a/webrtc/modules/rtp_rtcp/BUILD.gn b/webrtc/modules/rtp_rtcp/BUILD.gn
index a26dd73..1949fe9 100644
--- a/webrtc/modules/rtp_rtcp/BUILD.gn
+++ b/webrtc/modules/rtp_rtcp/BUILD.gn
@@ -154,7 +154,6 @@
     "source/vp8_partition_aggregator.h",
   ]
 
-  configs += [ "../..:common_config" ]
   public_configs = [ "../..:common_inherited_config" ]
 
   if (is_clang) {
diff --git a/webrtc/modules/utility/BUILD.gn b/webrtc/modules/utility/BUILD.gn
index 7647d38..1ece573 100644
--- a/webrtc/modules/utility/BUILD.gn
+++ b/webrtc/modules/utility/BUILD.gn
@@ -28,7 +28,6 @@
     "source/process_thread_impl.h",
   ]
 
-  configs += [ "../..:common_config" ]
   public_configs = [ "../..:common_inherited_config" ]
 
   if (is_clang) {
diff --git a/webrtc/modules/video_capture/BUILD.gn b/webrtc/modules/video_capture/BUILD.gn
index 23b978b..68ceb1a 100644
--- a/webrtc/modules/video_capture/BUILD.gn
+++ b/webrtc/modules/video_capture/BUILD.gn
@@ -33,7 +33,6 @@
     "../utility",
   ]
 
-  configs += [ "../..:common_config" ]
   public_configs = [ "../..:common_inherited_config" ]
 
   if (is_clang) {
@@ -54,7 +53,6 @@
     "../../system_wrappers",
   ]
 
-  configs += [ "../..:common_config" ]
   public_configs = [ "../..:common_inherited_config" ]
 
   if (is_clang) {
@@ -179,7 +177,6 @@
 
     all_dependent_configs = [ ":video_capture_internal_impl_config" ]
 
-    configs += [ "../..:common_config" ]
     public_configs = [ "../..:common_inherited_config" ]
 
     if (is_clang) {
diff --git a/webrtc/modules/video_coding/BUILD.gn b/webrtc/modules/video_coding/BUILD.gn
index 8b40b7e..1b684d8 100644
--- a/webrtc/modules/video_coding/BUILD.gn
+++ b/webrtc/modules/video_coding/BUILD.gn
@@ -74,7 +74,6 @@
     "video_sender.cc",
   ]
 
-  configs += [ "../..:common_config" ]
   public_configs = [ "../..:common_inherited_config" ]
 
   # TODO(jschuh): Bug 1348: fix this warning.
@@ -115,7 +114,6 @@
     "utility/vp8_header_parser.h",
   ]
 
-  configs += [ "../..:common_config" ]
   public_configs = [ "../..:common_inherited_config" ]
 
   if (is_clang) {
@@ -136,7 +134,6 @@
     "codecs/h264/include/h264.h",
   ]
 
-  configs += [ "../..:common_config" ]
   public_configs = [ "../..:common_inherited_config" ]
 
   if (is_clang) {
@@ -190,6 +187,11 @@
       "//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",
     ]
@@ -225,7 +227,6 @@
     "codecs/i420/include/i420.h",
   ]
 
-  configs += [ "../..:common_config" ]
   public_configs = [ "../..:common_inherited_config" ]
 
   if (is_clang) {
@@ -257,7 +258,6 @@
     "codecs/vp8/vp8_impl.h",
   ]
 
-  configs += [ "../..:common_config" ]
   public_configs = [ "../..:common_inherited_config" ]
 
   # TODO(jschuh): Bug 1348: fix this warning.
@@ -291,7 +291,6 @@
     "codecs/vp9/vp9_impl.h",
   ]
 
-  configs += [ "../..:common_config" ]
   public_configs = [ "../..:common_inherited_config" ]
 
   if (is_clang) {
@@ -325,7 +324,6 @@
       "codecs/test/videoprocessor.h",
     ]
 
-    configs += [ "../..:common_config" ]
     public_configs = [ "../..:common_inherited_config" ]
 
     if (is_clang) {
diff --git a/webrtc/modules/video_processing/BUILD.gn b/webrtc/modules/video_processing/BUILD.gn
index c297e29..42e5ade 100644
--- a/webrtc/modules/video_processing/BUILD.gn
+++ b/webrtc/modules/video_processing/BUILD.gn
@@ -48,7 +48,6 @@
     deps += [ ":video_processing_neon" ]
   }
 
-  configs += [ "../..:common_config" ]
   public_configs = [ "../..:common_inherited_config" ]
 
   if (is_clang) {
@@ -65,7 +64,6 @@
       "util/denoiser_filter_sse2.h",
     ]
 
-    configs += [ "../..:common_config" ]
     public_configs = [ "../..:common_inherited_config" ]
 
     if (is_clang) {
@@ -90,7 +88,6 @@
       suppressed_configs += [ "//build/config/compiler:compiler_arm_fpu" ]
       cflags = [ "-mfpu=neon" ]
     }
-    configs += [ "../..:common_config" ]
     public_configs = [ "../..:common_inherited_config" ]
   }
 }
diff --git a/webrtc/p2p/BUILD.gn b/webrtc/p2p/BUILD.gn
index ac26779..9614896 100644
--- a/webrtc/p2p/BUILD.gn
+++ b/webrtc/p2p/BUILD.gn
@@ -95,7 +95,6 @@
     ]
   }
 
-  configs += [ "..:common_config" ]
   public_configs = [
     "..:common_inherited_config",
     ":rtc_p2p_inherited_config",
@@ -170,7 +169,6 @@
       "stunprober/main.cc",
     ]
 
-    configs += [ "..:common_config" ]
     if (!build_with_chromium && 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/pc/BUILD.gn b/webrtc/pc/BUILD.gn
index 3b4611b..8212577 100644
--- a/webrtc/pc/BUILD.gn
+++ b/webrtc/pc/BUILD.gn
@@ -63,7 +63,6 @@
     deps += [ "//third_party/libsrtp" ]
   }
 
-  configs += [ "..:common_config" ]
   public_configs = [
     "..:common_inherited_config",
     ":rtc_pc_config",
@@ -100,10 +99,7 @@
 
     include_dirs = [ "//third_party/libsrtp/srtp" ]
 
-    configs += [
-      "..:common_config",
-      ":rtc_pc_unittests_config",
-    ]
+    configs += [ ":rtc_pc_unittests_config" ]
     public_configs = [ "..:common_inherited_config" ]
 
     if (is_clang) {
diff --git a/webrtc/sdk/BUILD.gn b/webrtc/sdk/BUILD.gn
index 69ec091..6e21f53 100644
--- a/webrtc/sdk/BUILD.gn
+++ b/webrtc/sdk/BUILD.gn
@@ -22,10 +22,7 @@
     deps = [
       "../base:rtc_base",
     ]
-    configs += [
-      "..:common_config",
-      "//build/config/compiler:enable_arc",
-    ]
+    configs += [ "//build/config/compiler:enable_arc" ]
     public_configs = [
       "..:common_inherited_config",
       ":rtc_sdk_common_objc_config",
@@ -190,6 +187,11 @@
       "//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) {
diff --git a/webrtc/stats/BUILD.gn b/webrtc/stats/BUILD.gn
index e1f5ea1..af531c7 100644
--- a/webrtc/stats/BUILD.gn
+++ b/webrtc/stats/BUILD.gn
@@ -25,7 +25,6 @@
     "rtcstatsreport.cc",
   ]
 
-  configs += [ "..:common_config" ]
   public_configs = [ "..:common_inherited_config" ]
 
   if (is_clang) {
@@ -48,7 +47,6 @@
       "rtcstatsreport_unittest.cc",
     ]
 
-    configs += [ "..:common_config" ]
     public_configs = [ "..:common_inherited_config" ]
 
     if (is_clang) {
diff --git a/webrtc/system_wrappers/BUILD.gn b/webrtc/system_wrappers/BUILD.gn
index 327c9af..ff3fcb1 100644
--- a/webrtc/system_wrappers/BUILD.gn
+++ b/webrtc/system_wrappers/BUILD.gn
@@ -75,8 +75,6 @@
     "source/trace_win.h",
   ]
 
-  configs += [ "..:common_config" ]
-
   public_configs = [ "..:common_inherited_config" ]
 
   if (rtc_enable_data_logging) {
@@ -146,7 +144,6 @@
     "source/field_trial_default.cc",
   ]
 
-  configs += [ "..:common_config" ]
   public_configs = [ "..:common_inherited_config" ]
 }
 
@@ -156,12 +153,10 @@
     "source/metrics_default.cc",
   ]
 
-  configs += [ "..:common_config" ]
   public_configs = [ "..:common_inherited_config" ]
 }
 
 rtc_source_set("system_wrappers_default") {
-  configs += [ "..:common_config" ]
   public_configs = [ "..:common_inherited_config" ]
 
   deps = [
@@ -177,7 +172,6 @@
       "source/cpu_features_android.c",
     ]
 
-    configs += [ "..:common_config" ]
     public_configs = [ "..:common_inherited_config" ]
     deps = [
       "//third_party/android_tools:cpu_features",
@@ -191,7 +185,6 @@
       "source/cpu_features_linux.c",
     ]
 
-    configs += [ "..:common_config" ]
     public_configs = [ "..:common_inherited_config" ]
   }
 }
@@ -224,7 +217,6 @@
       ]
     }
 
-    configs += [ "..:common_config" ]
     public_configs = [ "..:common_inherited_config" ]
 
     configs += [ "//build/config/compiler:no_size_t_to_int_warning" ]
diff --git a/webrtc/test/BUILD.gn b/webrtc/test/BUILD.gn
index 4b3cb3d..988c2d5 100644
--- a/webrtc/test/BUILD.gn
+++ b/webrtc/test/BUILD.gn
@@ -74,10 +74,7 @@
     "channel_transport/udp_transport_impl.h",
   ]
 
-  configs += [
-    "..:common_config",
-    ":channel_transport_warnings_config",
-  ]
+  configs += [ ":channel_transport_warnings_config" ]
   public_configs = [ "..:common_inherited_config" ]
 
   if (is_clang && !is_nacl) {
@@ -104,7 +101,6 @@
     "frame_utils.h",
   ]
 
-  configs += [ "..:common_config" ]
   public_configs = [ "..:common_inherited_config" ]
 
   if (is_clang && !is_nacl) {
@@ -129,7 +125,6 @@
     "rtp_file_writer.h",
   ]
 
-  configs += [ "..:common_config" ]
   public_configs = [ "..:common_inherited_config" ]
 
   if (is_clang && !is_nacl) {
@@ -158,7 +153,6 @@
     "../system_wrappers:field_trial_default",
   ]
 
-  configs += [ "..:common_config" ]
   public_configs = [ "..:common_inherited_config" ]
 }
 
@@ -176,7 +170,6 @@
     "//third_party/gflags",
   ]
 
-  configs += [ "..:common_config" ]
   public_configs = [ "..:common_inherited_config" ]
 }
 
@@ -229,7 +222,6 @@
     deps += [ "//base:base" ]
   }
 
-  configs += [ "..:common_config" ]
   public_configs = [ "..:common_inherited_config" ]
 }
 
@@ -253,7 +245,6 @@
     "//third_party/gflags",
   ]
 
-  configs += [ "..:common_config" ]
   public_configs = [ "..:common_inherited_config" ]
 }
 
@@ -271,7 +262,6 @@
     "testsupport/mac/run_threaded_main_mac.mm",
   ]
 
-  configs += [ "..:common_config" ]
   public_configs = [ "..:common_inherited_config" ]
 
   deps = [
@@ -322,7 +312,6 @@
     "testsupport/unittest_utils.h",
   ]
 
-  configs += [ "..:common_config" ]
   public_configs = [ "..:common_inherited_config" ]
 
   # TODO(jschuh): Bug 1348: fix this warning.
@@ -406,7 +395,6 @@
     ]
   }
 
-  configs += [ "..:common_config" ]
   public_configs = [ "..:common_inherited_config" ]
 
   if (is_clang && !is_nacl) {
@@ -489,7 +477,6 @@
     ]
   }
 
-  configs += [ "..:common_config" ]
   public_configs = [
     "..:common_inherited_config",
     ":test_renderer_exported_config",
diff --git a/webrtc/tools/BUILD.gn b/webrtc/tools/BUILD.gn
index 8724aca..d09a8d4 100644
--- a/webrtc/tools/BUILD.gn
+++ b/webrtc/tools/BUILD.gn
@@ -31,7 +31,6 @@
   deps = [
     "../base:gtest_prod",
   ]
-  configs += [ "..:common_config" ]
   public_configs = [ "..:common_inherited_config" ]
 }
 
@@ -41,7 +40,6 @@
     "frame_analyzer/video_quality_analysis.h",
   ]
 
-  configs += [ "..:common_config" ]
   public_configs = [ "..:common_inherited_config" ]
 
   deps = [
@@ -57,7 +55,6 @@
     "frame_analyzer/frame_analyzer.cc",
   ]
 
-  configs += [ "..:common_config" ]
   public_configs = [ "..:common_inherited_config" ]
 
   deps = [
@@ -72,7 +69,6 @@
     "psnr_ssim_analyzer/psnr_ssim_analyzer.cc",
   ]
 
-  configs += [ "..:common_config" ]
   public_configs = [ "..:common_inherited_config" ]
 
   deps = [
@@ -89,7 +85,6 @@
     "converter/rgba_to_i420_converter.cc",
   ]
 
-  configs += [ "..:common_config" ]
   public_configs = [ "..:common_inherited_config" ]
 
   deps = [
@@ -105,7 +100,6 @@
     "frame_editing/frame_editing_lib.h",
   ]
 
-  configs += [ "..:common_config" ]
   public_configs = [ "..:common_inherited_config" ]
 
   # TODO(jschuh): Bug 1348: fix this warning.
@@ -127,7 +121,6 @@
     "frame_editing/frame_editing.cc",
   ]
 
-  configs += [ "..:common_config" ]
   public_configs = [ "..:common_inherited_config" ]
 
   deps = [
@@ -142,7 +135,6 @@
     "force_mic_volume_max/force_mic_volume_max.cc",
   ]
 
-  configs += [ "..:common_config" ]
   public_configs = [ "..:common_inherited_config" ]
 
   if (is_clang) {
@@ -177,7 +169,6 @@
       "event_log_visualizer/plot_python.cc",
       "event_log_visualizer/plot_python.h",
     ]
-    configs += [ "..:common_config" ]
     public_configs = [ "..:common_inherited_config" ]
     if (is_clang && !is_nacl) {
       # Suppress warnings from the Chromium Clang plugin.
@@ -209,7 +200,6 @@
         "event_log_visualizer/main.cc",
       ]
 
-      configs += [ "..:common_config" ]
       public_configs = [ "..:common_inherited_config" ]
 
       if (is_clang && !is_nacl) {
@@ -232,7 +222,6 @@
       "agc/activity_metric.cc",
     ]
 
-    configs += [ "..:common_config" ]
     public_configs = [ "..:common_inherited_config" ]
 
     if (is_clang) {
@@ -256,7 +245,6 @@
       "e2e_quality/audio/audio_e2e_harness.cc",
     ]
 
-    configs += [ "..:common_config" ]
     public_configs = [ "..:common_inherited_config" ]
 
     if (is_clang) {
@@ -298,7 +286,6 @@
       "simple_command_line_parser_unittest.cc",
     ]
 
-    configs += [ "..:common_config" ]
     public_configs = [ "..:common_inherited_config" ]
 
     # TODO(jschuh): Bug 1348: fix this warning.
diff --git a/webrtc/video/BUILD.gn b/webrtc/video/BUILD.gn
index 1d3f55c..4d85fd9 100644
--- a/webrtc/video/BUILD.gn
+++ b/webrtc/video/BUILD.gn
@@ -48,7 +48,6 @@
     "vie_remb.h",
   ]
 
-  configs += [ "..:common_config" ]
   public_configs = [ "..:common_inherited_config" ]
 
   if (is_clang) {
@@ -98,7 +97,6 @@
       "vie_encoder_unittest.cc",
       "vie_remb_unittest.cc",
     ]
-    configs += [ "..:common_config" ]
     deps = [
       ":video",
       "//testing/gmock",
diff --git a/webrtc/voice_engine/BUILD.gn b/webrtc/voice_engine/BUILD.gn
index 5fed3ce..7b17717 100644
--- a/webrtc/voice_engine/BUILD.gn
+++ b/webrtc/voice_engine/BUILD.gn
@@ -78,7 +78,6 @@
     ]
   }
 
-  configs += [ "..:common_config" ]
   public_configs = [ "..:common_inherited_config" ]
 
   if (is_clang) {
@@ -113,7 +112,6 @@
     "level_indicator.h",
   ]
 
-  configs += [ "..:common_config" ]
   public_configs = [ "..:common_inherited_config" ]
 
   deps = [