GN hack to tag targets as poisonous (and use it with audio codecs)

Only specially taggged targets may transitively depend on poisonous
targets. We first apply it to audio codecs.

This makes it much clearer exactly what parts of the code still have
dependencies on the audio codecs (and we want to eventually get rid of
pretty much all of them).

Bug: webrtc:8396, webrtc:9121
Change-Id: Iba5c2e806c702b5cfe881022674705f647896d43
Reviewed-on: https://webrtc-review.googlesource.com/69520
Commit-Queue: Karl Wiberg <kwiberg@webrtc.org>
Reviewed-by: Patrik Höglund <phoglund@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22979}
diff --git a/sdk/BUILD.gn b/sdk/BUILD.gn
index b13c50b..00f94a2 100644
--- a/sdk/BUILD.gn
+++ b/sdk/BUILD.gn
@@ -229,6 +229,7 @@
 
     rtc_static_library("ui_objc") {
       visibility = [ "*" ]
+      allow_poison = [ "audio_codecs" ]  # TODO(bugs.webrtc.org/8396): Remove.
       if (is_ios) {
         sources = [
           "objc/Framework/Classes/UI/RTCCameraPreviewView.m",
@@ -255,6 +256,7 @@
     if (rtc_use_metal_rendering) {
       rtc_static_library("metal_objc") {
         visibility = [ "*" ]
+        allow_poison = [ "audio_codecs" ]  # TODO(bugs.webrtc.org/8396): Remove.
         sources = [
           "objc/Framework/Classes/Metal/RTCMTLI420Renderer.h",
           "objc/Framework/Classes/Metal/RTCMTLI420Renderer.mm",
@@ -316,6 +318,7 @@
 
     rtc_static_library("videocapture_objc") {
       visibility = [ "*" ]
+      allow_poison = [ "audio_codecs" ]  # TODO(bugs.webrtc.org/8396): Remove.
       sources = [
         "objc/Framework/Classes/PeerConnection/RTCCameraVideoCapturer.m",
         "objc/Framework/Headers/WebRTC/RTCCameraVideoCapturer.h",
@@ -347,6 +350,8 @@
     }
 
     rtc_static_library("videocodec_objc") {
+      visibility = [ "*" ]
+      allow_poison = [ "audio_codecs" ]  # TODO(bugs.webrtc.org/8396): Remove.
       sources = [
         "objc/Framework/Classes/PeerConnection/RTCEncodedImage.mm",
         "objc/Framework/Classes/PeerConnection/RTCRtpFragmentationHeader.mm",
@@ -363,7 +368,6 @@
         # (bugs.webrtc.org/163).
         suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
       }
-      visibility = [ "*" ]
       public_configs = [ ":common_config_objc" ]
       deps = [
         ":common_objc",
@@ -398,6 +402,7 @@
 
     rtc_static_library("vp8") {
       visibility = [ "*" ]
+      allow_poison = [ "audio_codecs" ]  # TODO(bugs.webrtc.org/8396): Remove.
       sources = [
         "objc/Framework/Classes/PeerConnection/RTCVideoCodecVP8.mm",
         "objc/Framework/Headers/WebRTC/RTCVideoDecoderVP8.h",
@@ -419,6 +424,7 @@
 
     rtc_static_library("vp9") {
       visibility = [ "*" ]
+      allow_poison = [ "audio_codecs" ]  # TODO(bugs.webrtc.org/8396): Remove.
       sources = [
         "objc/Framework/Classes/PeerConnection/RTCVideoCodecVP9.mm",
         "objc/Framework/Headers/WebRTC/RTCVideoDecoderVP9.h",
@@ -447,6 +453,7 @@
     # The applications which only use WebRTC DataChannel can depend on this.
     rtc_static_library("peerconnectionfactory_no_media_objc") {
       visibility = [ "*" ]
+      allow_poison = [ "audio_codecs" ]  # TODO(bugs.webrtc.org/8396): Remove.
       defines = [ "HAVE_NO_MEDIA" ]
 
       sources = [
@@ -500,6 +507,8 @@
     }
 
     rtc_static_library("videorendereradapter_objc") {
+      visibility = [ "*" ]
+      allow_poison = [ "audio_codecs" ]  # TODO(bugs.webrtc.org/8396): Remove.
       sources = [
         "objc/Framework/Classes/PeerConnection/RTCVideoRendererAdapter+Private.h",
         "objc/Framework/Classes/PeerConnection/RTCVideoRendererAdapter.h",
@@ -507,7 +516,6 @@
       ]
 
       configs += [ "..:common_objc" ]
-      visibility = [ "*" ]
       public_configs = [ ":common_config_objc" ]
 
       deps = [
@@ -537,6 +545,8 @@
     }
 
     rtc_static_library("peerconnectionfactory_base_objc") {
+      visibility = [ "*" ]
+      allow_poison = [ "audio_codecs" ]  # TODO(bugs.webrtc.org/8396): Remove.
       sources = [
         "objc/Framework/Classes/PeerConnection/RTCAudioSource+Private.h",
         "objc/Framework/Classes/PeerConnection/RTCAudioSource.mm",
@@ -624,7 +634,6 @@
       ]
 
       configs += [ "..:common_objc" ]
-      visibility = [ "*" ]
       public_configs = [ ":common_config_objc" ]
 
       if (!build_with_chromium && is_clang) {
@@ -958,6 +967,7 @@
     # The native API is currently experimental and may change without notice.
     rtc_static_library("native_api") {
       visibility = [ "*" ]
+      allow_poison = [ "audio_codecs" ]  # TODO(bugs.webrtc.org/8396): Remove.
       sources = [
         "objc/Framework/Native/api/video_capturer.h",
         "objc/Framework/Native/api/video_capturer.mm",
@@ -1067,6 +1077,7 @@
 
     rtc_static_library("videotoolbox_objc") {
       visibility = [ "*" ]
+      allow_poison = [ "audio_codecs" ]  # TODO(bugs.webrtc.org/8396): Remove.
       sources = [
         "objc/Framework/Classes/VideoToolbox/RTCVideoDecoderH264.mm",
         "objc/Framework/Classes/VideoToolbox/RTCVideoEncoderH264.mm",