From 0874530b78cbd4a55d16067186ed6b4dc6429c06 Mon Sep 17 00:00:00 2001 From: Jiawei Ou Date: Tue, 12 Feb 2019 11:36:13 -0800 Subject: [PATCH] Add gn configs to remove the dependency to audio and video codecs. Actually, I don't think there is any strong reason to keep these deps in `webrtc` target except some downstream projects need it. Making a GN config for now. Bug: webrtc:10306 Change-Id: Id714faeabf4daaf3cc88d1f6224ae89ca8715e48 Reviewed-on: https://webrtc-review.googlesource.com/c/122420 Commit-Queue: Jiawei Ou Reviewed-by: Niels Moller Reviewed-by: Mirko Bonadei Cr-Commit-Position: refs/heads/master@{#26653} --- BUILD.gn | 20 +++++++++++++------- webrtc.gni | 12 ++++++++++++ 2 files changed, 25 insertions(+), 7 deletions(-) diff --git a/BUILD.gn b/BUILD.gn index 1cb920e9ec..a62bb028d1 100644 --- a/BUILD.gn +++ b/BUILD.gn @@ -406,13 +406,19 @@ if (!build_with_chromium) { "video", ] - # Include audio and video codecs by default. - deps += [ - "api/audio_codecs:builtin_audio_decoder_factory", - "api/audio_codecs:builtin_audio_encoder_factory", - "api/video_codecs:builtin_video_decoder_factory", - "api/video_codecs:builtin_video_encoder_factory", - ] + if (rtc_include_builtin_audio_codecs) { + deps += [ + "api/audio_codecs:builtin_audio_decoder_factory", + "api/audio_codecs:builtin_audio_encoder_factory", + ] + } + + if (rtc_include_builtin_video_codecs) { + deps += [ + "api/video_codecs:builtin_video_decoder_factory", + "api/video_codecs:builtin_video_encoder_factory", + ] + } if (build_with_mozilla) { deps += [ "api/video:video_frame" ] diff --git a/webrtc.gni b/webrtc.gni index 2239d61eba..d716d7d2d1 100644 --- a/webrtc.gni +++ b/webrtc.gni @@ -180,6 +180,18 @@ declare_args() { # Determines whether Metal is available on iOS/macOS. rtc_use_metal_rendering = is_mac || (is_ios && current_cpu == "arm64") + + # When set to false, builtin audio encoder/decoder factories and all the + # audio codecs they depend on will not be included in libwebrtc.{a|lib} + # (they will still be included in libjingle_peerconnection_so.so and + # WebRTC.framework) + rtc_include_builtin_audio_codecs = true + + # When set to false, builtin video encoder/decoder factories and all the + # video codecs they depends on will not be included in libwebrtc.{a|lib} + # (they will still be included in libjingle_peerconnection_so.so and + # WebRTC.framework) + rtc_include_builtin_video_codecs = true } if (!build_with_mozilla) {