blob: d222bc7ec95dc021670a85b39a4a8b4d883d6667 [file] [log] [blame]
mbonadei9aa3f0a2017-01-24 06:58:22 -08001# Copyright (c) 2014 The WebRTC project authors. All Rights Reserved.
2#
3# Use of this source code is governed by a BSD-style license
4# that can be found in the LICENSE file in the root of the source
5# tree. An additional intellectual property rights grant can be found
6# in the file PATENTS. All contributing project authors may
7# be found in the AUTHORS file in the root of the source tree.
mbonadei9aa3f0a2017-01-24 06:58:22 -08008import("//build/config/arm.gni")
9import("//build/config/features.gni")
10import("//build/config/mips.gni")
11import("//build/config/sanitizers/sanitizers.gni")
Tomas Popela318da512018-11-13 06:32:23 +010012import("//build/config/sysroot.gni")
ehmaldonado0d729b32017-02-10 01:38:23 -080013import("//build/config/ui.gni")
mbonadei9aa3f0a2017-01-24 06:58:22 -080014import("//build_overrides/build.gni")
mbonadei96606272017-03-03 19:41:59 -080015
16if (!build_with_chromium && is_component_build) {
17 print("The Gn argument `is_component_build` is currently " +
18 "ignored for WebRTC builds.")
19 print("Component builds are supported by Chromium and the argument " +
20 "`is_component_build` makes it possible to create shared libraries " +
21 "instead of static libraries.")
22 print("If an app depends on WebRTC it makes sense to just depend on the " +
23 "WebRTC static library, so there is no difference between " +
24 "`is_component_build=true` and `is_component_build=false`.")
25 print(
26 "More info about component builds at: " + "https://chromium.googlesource.com/chromium/src/+/master/docs/component_build.md")
27 assert(!is_component_build, "Component builds are not supported in WebRTC.")
28}
29
kthelgason4065a572017-02-14 04:58:56 -080030if (is_ios) {
31 import("//build/config/ios/rules.gni")
32}
mbonadei9aa3f0a2017-01-24 06:58:22 -080033
Anders Carlsson37bbf792018-09-05 16:29:27 +020034if (is_mac) {
35 import("//build/config/mac/rules.gni")
36}
37
mbonadei9aa3f0a2017-01-24 06:58:22 -080038declare_args() {
Mirko Bonadei028248c2018-10-10 12:19:02 +020039 # Setting this to true will make RTC_EXPORT (see rtc_base/system/rtc_export.h)
40 # expand to code that will manage symbols visibility.
41 rtc_enable_symbol_export = false
42
Mirko Bonadei31b0b452018-08-22 10:37:11 +020043 # Setting this to true will define WEBRTC_EXCLUDE_FIELD_TRIAL_DEFAULT which
Mirko Bonadei70400902018-08-21 15:44:28 +020044 # will tell the pre-processor to remove the default definition of symbols
45 # needed to use field_trial. In that case a new implementation needs to be
46 # provided.
Mirko Bonadei31b0b452018-08-22 10:37:11 +020047 if (build_with_chromium) {
48 # When WebRTC is built as part of Chromium it should exclude the default
49 # implementation of field_trial unless it is building for NACL or
50 # Chromecast.
51 rtc_exclude_field_trial_default = !is_nacl && !is_chromecast
52 } else {
53 rtc_exclude_field_trial_default = false
54 }
Mirko Bonadei70400902018-08-21 15:44:28 +020055
Mirko Bonadei906add42018-09-05 16:03:16 +020056 # Setting this to true will define WEBRTC_EXCLUDE_METRICS_DEFAULT which
57 # will tell the pre-processor to remove the default definition of symbols
58 # needed to use metrics. In that case a new implementation needs to be
59 # provided.
60 rtc_exclude_metrics_default = build_with_chromium
61
Benjamin Wrightd6f86e82018-05-08 13:12:25 -070062 # Setting this to false will require the API user to pass in their own
63 # SSLCertificateVerifier to verify the certificates presented from a
64 # TLS-TURN server. In return disabling this saves around 100kb in the binary.
65 rtc_builtin_ssl_root_certificates = true
66
Karl Wibergeb254b42017-11-01 15:08:12 +010067 # Include the iLBC audio codec?
68 rtc_include_ilbc = true
69
mbonadei9aa3f0a2017-01-24 06:58:22 -080070 # Disable this to avoid building the Opus audio codec.
71 rtc_include_opus = true
72
minyue2e03c662017-02-01 17:31:11 -080073 # Enable this if the Opus version upon which WebRTC is built supports direct
74 # encoding of 120 ms packets.
minyue-webrtc516711c2017-07-27 17:45:49 +020075 rtc_opus_support_120ms_ptime = true
minyue2e03c662017-02-01 17:31:11 -080076
mbonadei9aa3f0a2017-01-24 06:58:22 -080077 # Enable this to let the Opus audio codec change complexity on the fly.
78 rtc_opus_variable_complexity = false
79
mbonadei9aa3f0a2017-01-24 06:58:22 -080080 # Used to specify an external Jsoncpp include path when not compiling the
81 # library that comes with WebRTC (i.e. rtc_build_json == 0).
82 rtc_jsoncpp_root = "//third_party/jsoncpp/source/include"
83
84 # Used to specify an external OpenSSL include path when not compiling the
85 # library that comes with WebRTC (i.e. rtc_build_ssl == 0).
86 rtc_ssl_root = ""
87
88 # Selects fixed-point code where possible.
89 rtc_prefer_fixed_point = false
90
mbonadei9aa3f0a2017-01-24 06:58:22 -080091 # Enable when an external authentication mechanism is used for performing
92 # packet authentication for RTP packets instead of libsrtp.
93 rtc_enable_external_auth = build_with_chromium
94
95 # Selects whether debug dumps for the audio processing module
96 # should be generated.
97 apm_debug_dump = false
98
Per Åhgrencc73ed32020-04-26 23:56:17 +020099 # Selects whether the audio processing module should be excluded.
100 rtc_exclude_audio_processing_module = false
101
mbonadei9aa3f0a2017-01-24 06:58:22 -0800102 # Set this to true to enable BWE test logging.
103 rtc_enable_bwe_test_logging = false
104
Joachim Bauch93e91342017-12-07 01:25:53 +0100105 # Set this to false to skip building examples.
106 rtc_build_examples = true
107
108 # Set this to false to skip building tools.
109 rtc_build_tools = true
110
Joachim Bauch75f18fc2017-12-20 21:25:47 +0100111 # Set this to false to skip building code that requires X11.
112 rtc_use_x11 = use_x11
113
Tomas Popela318da512018-11-13 06:32:23 +0100114 # Set this to use PipeWire on the Wayland display server.
Tomas Popela762543f2018-12-12 14:37:51 +0100115 # By default it's only enabled on desktop Linux (excludes ChromeOS) and
116 # only when using the sysroot as PipeWire is not available in older and
117 # supported Ubuntu and Debian distributions.
Mirko Bonadei5c1a5652020-05-12 06:14:31 +0000118 rtc_use_pipewire = is_desktop_linux && use_sysroot
Tomas Popela762543f2018-12-12 14:37:51 +0100119
120 # Set this to link PipeWire directly instead of using the dlopen.
121 rtc_link_pipewire = false
Tomas Popela318da512018-11-13 06:32:23 +0100122
mbonadei9aa3f0a2017-01-24 06:58:22 -0800123 # Enable to use the Mozilla internal settings.
124 build_with_mozilla = false
125
henrika883d00f2018-03-16 10:09:49 +0100126 # Enable use of Android AAudio which requires Android SDK 26 or above and
127 # NDK r16 or above.
128 rtc_enable_android_aaudio = false
129
mbonadei9aa3f0a2017-01-24 06:58:22 -0800130 # Set to "func", "block", "edge" for coverage generation.
131 # At unit test runtime set UBSAN_OPTIONS="coverage=1".
132 # It is recommend to set include_examples=0.
133 # Use llvm's sancov -html-report for human readable reports.
134 # See http://clang.llvm.org/docs/SanitizerCoverage.html .
135 rtc_sanitize_coverage = ""
136
mbonadei9aa3f0a2017-01-24 06:58:22 -0800137 if (current_cpu == "arm" || current_cpu == "arm64") {
138 rtc_prefer_fixed_point = true
139 }
140
mbonadei9aa3f0a2017-01-24 06:58:22 -0800141 # Determines whether NEON code will be built.
142 rtc_build_with_neon =
143 (current_cpu == "arm" && arm_use_neon) || current_cpu == "arm64"
144
145 # Enable this to build OpenH264 encoder/FFmpeg decoder. This is supported on
146 # all platforms except Android and iOS. Because FFmpeg can be built
147 # with/without H.264 support, |ffmpeg_branding| has to separately be set to a
148 # value that includes H.264, for example "Chrome". If FFmpeg is built without
Sergey Silkinfe288eb2018-06-25 16:22:38 +0200149 # H.264, compilation succeeds but |H264DecoderImpl| fails to initialize.
mbonadei9aa3f0a2017-01-24 06:58:22 -0800150 # CHECK THE OPENH264, FFMPEG AND H.264 LICENSES/PATENTS BEFORE BUILDING.
151 # http://www.openh264.org, https://www.ffmpeg.org/
Mirko Bonadeiee0a85c2019-01-15 10:47:18 +0100152 #
153 # Enabling H264 when building with MSVC is currently not supported, see
154 # bugs.webrtc.org/9213#c13 for more info.
155 rtc_use_h264 =
156 proprietary_codecs && !is_android && !is_ios && !(is_win && !is_clang)
mbonadei9aa3f0a2017-01-24 06:58:22 -0800157
mbonadei9aa3f0a2017-01-24 06:58:22 -0800158 # By default, use normal platform audio support or dummy audio, but don't
159 # use file-based audio playout and record.
160 rtc_use_dummy_audio_file_devices = false
161
henrika7be78832017-06-13 17:34:16 +0200162 # When set to true, replace the audio output with a sinus tone at 440Hz.
163 # The ADM will ask for audio data from WebRTC but instead of reading real
164 # audio samples from NetEQ, a sinus tone will be generated and replace the
165 # real audio samples.
166 rtc_audio_device_plays_sinus_tone = false
167
Anders Carlsson358f2e02018-06-04 10:24:37 +0200168 if (is_ios) {
169 # Build broadcast extension in AppRTCMobile for iOS. This results in the
170 # binary only running on iOS 11+, which is why it is disabled by default.
171 rtc_apprtcmobile_broadcast_extension = false
172 }
Anders Carlsson7bca8ca2018-08-30 09:30:29 +0200173
174 # Determines whether Metal is available on iOS/macOS.
175 rtc_use_metal_rendering = is_mac || (is_ios && current_cpu == "arm64")
Jiawei Ou08745302019-02-12 11:36:13 -0800176
177 # When set to false, builtin audio encoder/decoder factories and all the
178 # audio codecs they depend on will not be included in libwebrtc.{a|lib}
179 # (they will still be included in libjingle_peerconnection_so.so and
180 # WebRTC.framework)
181 rtc_include_builtin_audio_codecs = true
182
183 # When set to false, builtin video encoder/decoder factories and all the
184 # video codecs they depends on will not be included in libwebrtc.{a|lib}
185 # (they will still be included in libjingle_peerconnection_so.so and
186 # WebRTC.framework)
187 rtc_include_builtin_video_codecs = true
Mirko Bonadei20574f42019-03-28 07:50:07 +0100188
189 # When set to true and in a standalone build, it will undefine UNICODE and
190 # _UNICODE (which are always defined globally by the Chromium Windows
191 # toolchain).
192 # This is only needed for testing purposes, WebRTC wants to be sure it
193 # doesn't assume /DUNICODE and /D_UNICODE but that it explicitly uses
194 # wide character functions.
195 rtc_win_undef_unicode = false
Dan Minor9c686132018-01-15 10:20:00 -0500196}
mbonadei9aa3f0a2017-01-24 06:58:22 -0800197
Dan Minor9c686132018-01-15 10:20:00 -0500198if (!build_with_mozilla) {
199 import("//testing/test.gni")
mbonadei9aa3f0a2017-01-24 06:58:22 -0800200}
201
202# A second declare_args block, so that declarations within it can
203# depend on the possibly overridden variables in the first
204# declare_args block.
205declare_args() {
Dan Minor9c686132018-01-15 10:20:00 -0500206 # Enables the use of protocol buffers for debug recordings.
207 rtc_enable_protobuf = !build_with_mozilla
208
209 # Set this to disable building with support for SCTP data channels.
210 rtc_enable_sctp = !build_with_mozilla
211
212 # Disable these to not build components which can be externally provided.
213 rtc_build_json = !build_with_mozilla
214 rtc_build_libsrtp = !build_with_mozilla
215 rtc_build_libvpx = !build_with_mozilla
216 rtc_libvpx_build_vp9 = !build_with_mozilla
Dan Minor9c686132018-01-15 10:20:00 -0500217 rtc_build_opus = !build_with_mozilla
218 rtc_build_ssl = !build_with_mozilla
219 rtc_build_usrsctp = !build_with_mozilla
220
221 # Enable libevent task queues on platforms that support it.
Mirko Bonadei775c02e2019-06-19 19:05:00 +0200222 if (is_win || is_mac || is_ios || is_nacl || is_fuchsia ||
223 target_cpu == "wasm") {
Dan Minor9c686132018-01-15 10:20:00 -0500224 rtc_enable_libevent = false
225 rtc_build_libevent = false
226 } else {
227 rtc_enable_libevent = true
228 rtc_build_libevent = !build_with_mozilla
229 }
230
Dan Minor9c686132018-01-15 10:20:00 -0500231 # Build sources requiring GTK. NOTICE: This is not present in Chrome OS
232 # build environments, even if available for Chromium builds.
233 rtc_use_gtk = !build_with_chromium && !build_with_mozilla
234
mbonadei9aa3f0a2017-01-24 06:58:22 -0800235 # Excluded in Chromium since its prerequisites don't require Pulse Audio.
236 rtc_include_pulse_audio = !build_with_chromium
237
238 # Chromium uses its own IO handling, so the internal ADM is only built for
239 # standalone WebRTC.
240 rtc_include_internal_audio_device = !build_with_chromium
241
242 # Include tests in standalone checkout.
Dan Minor9c686132018-01-15 10:20:00 -0500243 rtc_include_tests = !build_with_chromium && !build_with_mozilla
Oleh Prypin240b8932019-06-07 13:27:07 +0200244
245 # Set this to false to skip building code that also requires X11 extensions
246 # such as Xdamage, Xfixes.
247 rtc_use_x11_extensions = rtc_use_x11
Artem Titov6a4a1462019-11-26 16:24:46 +0100248
249 # Set this to true to fully remove logging from WebRTC.
250 rtc_disable_logging = false
Doudou Kisabaka2dec4962019-11-28 14:24:31 +0100251
252 # Set this to true to disable trace events.
253 rtc_disable_trace_events = false
Artem Titov9dc209a2019-11-28 17:09:30 +0100254
255 # Set this to true to disable detailed error message and logging for
256 # RTC_CHECKs.
257 rtc_disable_check_msg = false
Ying Wangef3998f2019-12-09 13:06:53 +0100258
259 # Set this to true to disable webrtc metrics.
Mirko Bonadei3c4fda22019-12-10 15:02:53 +0100260 rtc_disable_metrics = false
sazaaa42ecd2020-04-01 15:24:40 +0200261
262 # Set this to true to exclude the transient suppressor in the audio processing
263 # module from the build.
264 rtc_exclude_transient_suppressor = false
mbonadei9aa3f0a2017-01-24 06:58:22 -0800265}
266
267# Make it possible to provide custom locations for some libraries (move these
268# up into declare_args should we need to actually use them for the GN build).
269rtc_libvpx_dir = "//third_party/libvpx"
mbonadei9aa3f0a2017-01-24 06:58:22 -0800270rtc_opus_dir = "//third_party/opus"
271
272# Desktop capturer is supported only on Windows, OSX and Linux.
Oleh Prypin240b8932019-06-07 13:27:07 +0200273rtc_desktop_capture_supported =
274 (is_win && current_os != "winuwp") || is_mac ||
275 (is_linux && (rtc_use_x11_extensions || rtc_use_pipewire))
mbonadei9aa3f0a2017-01-24 06:58:22 -0800276
277###############################################################################
278# Templates
279#
280
Mirko Bonadei92ea95e2017-09-15 06:47:31 +0200281# Points to // in webrtc stand-alone or to //third_party/webrtc/ in
mbonadei9aa3f0a2017-01-24 06:58:22 -0800282# chromium.
283# We need absolute paths for all configs in templates as they are shared in
284# different subdirectories.
285webrtc_root = get_path_info(".", "abspath")
286
287# Global configuration that should be applied to all WebRTC targets.
288# You normally shouldn't need to include this in your target as it's
289# automatically included when using the rtc_* templates.
290# It sets defines, include paths and compilation warnings accordingly,
291# both for WebRTC stand-alone builds and for the scenario when WebRTC
292# native code is built as part of Chromium.
Will Harrisfc173d02018-08-29 13:56:00 -0700293rtc_common_configs = [
294 webrtc_root + ":common_config",
295 "//build/config/compiler:no_size_t_to_int_warning",
296]
mbonadei9aa3f0a2017-01-24 06:58:22 -0800297
kthelgasonc0977102017-04-24 00:57:16 -0700298if (is_mac || is_ios) {
299 rtc_common_configs += [ "//build/config/compiler:enable_arc" ]
300}
301
mbonadei9aa3f0a2017-01-24 06:58:22 -0800302# Global public configuration that should be applied to all WebRTC targets. You
303# normally shouldn't need to include this in your target as it's automatically
304# included when using the rtc_* templates. It set the defines, include paths and
305# compilation warnings that should be propagated to dependents of the targets
306# depending on the target having this config.
307rtc_common_inherited_config = webrtc_root + ":common_inherited_config"
308
309# Common configs to remove or add in all rtc targets.
310rtc_remove_configs = []
Mirko Bonadeifc52b912019-03-01 10:32:56 +0100311if (!build_with_chromium && is_clang) {
312 rtc_remove_configs += [ "//build/config/clang:find_bad_constructs" ]
313}
mbonadei9aa3f0a2017-01-24 06:58:22 -0800314rtc_add_configs = rtc_common_configs
Mirko Bonadei96ede162018-09-06 13:45:44 +0200315rtc_prod_configs = [ webrtc_root + ":rtc_prod_config" ]
Mirko Bonadei32ce18c2018-09-18 13:15:54 +0200316rtc_library_impl_config = [ webrtc_root + ":library_impl_config" ]
mbonadei9aa3f0a2017-01-24 06:58:22 -0800317
318set_defaults("rtc_test") {
319 configs = rtc_add_configs
320 suppressed_configs = []
321}
322
Mirko Bonadei86d053c2019-10-17 21:32:04 +0200323set_defaults("rtc_library") {
324 configs = rtc_add_configs
325 suppressed_configs = []
Mirko Bonadei8b7cfa12020-06-03 21:23:41 +0200326 absl_deps = []
Mirko Bonadei86d053c2019-10-17 21:32:04 +0200327}
328
mbonadei9aa3f0a2017-01-24 06:58:22 -0800329set_defaults("rtc_source_set") {
330 configs = rtc_add_configs
331 suppressed_configs = []
Mirko Bonadei8b7cfa12020-06-03 21:23:41 +0200332 absl_deps = []
mbonadei9aa3f0a2017-01-24 06:58:22 -0800333}
334
Mirko Bonadei86d053c2019-10-17 21:32:04 +0200335set_defaults("rtc_static_library") {
mbonadei9aa3f0a2017-01-24 06:58:22 -0800336 configs = rtc_add_configs
337 suppressed_configs = []
Mirko Bonadei8b7cfa12020-06-03 21:23:41 +0200338 absl_deps = []
mbonadei9aa3f0a2017-01-24 06:58:22 -0800339}
340
Mirko Bonadei86d053c2019-10-17 21:32:04 +0200341set_defaults("rtc_executable") {
mbonadei9aa3f0a2017-01-24 06:58:22 -0800342 configs = rtc_add_configs
343 suppressed_configs = []
344}
345
346set_defaults("rtc_shared_library") {
347 configs = rtc_add_configs
348 suppressed_configs = []
349}
350
Per Kjellandera7f2d842018-01-10 15:54:53 +0000351webrtc_default_visibility = [ webrtc_root + "/*" ]
352if (build_with_chromium) {
353 # Allow Chromium's WebRTC overrides targets to bypass the regular
354 # visibility restrictions.
355 webrtc_default_visibility += [ webrtc_root + "/../webrtc_overrides/*" ]
356}
357
Karl Wibergbb23c832018-04-22 19:55:00 +0200358# ---- Poisons ----
359#
360# The general idea is that some targets declare that they contain some
361# kind of poison, which makes it impossible for other targets to
362# depend on them (even transitively) unless they declare themselves
363# immune to that particular type of poison.
364#
365# Targets that *contain* poison of type foo should contain the line
366#
367# poisonous = [ "foo" ]
368#
369# and targets that *are immune but arent't themselves poisonous*
370# should contain
371#
372# allow_poison = [ "foo" ]
373#
374# This useful in cases where we have some large target or set of
375# targets and want to ensure that most other targets do not
376# transitively depend on them. For example, almost no high-level
377# target should depend on the audio codecs, since we want WebRTC users
378# to be able to inject any subset of them and actually end up with a
379# binary that doesn't include the codecs they didn't inject.
380#
381# Test-only targets (`testonly` set to true) and non-public targets
382# (`visibility` not containing "*") are automatically immune to all
383# types of poison.
384#
385# Here's the complete list of all types of poison. It must be kept in
386# 1:1 correspondence with the set of //:poison_* targets.
387#
388all_poison_types = [
389 # Encoders and decoders for specific audio codecs such as Opus and iSAC.
390 "audio_codecs",
Anders Carlsson1f433e42018-04-24 16:39:05 +0200391
Danil Chapovalov41300af2019-07-10 12:44:43 +0200392 # Default task queue implementation.
393 "default_task_queue",
Sam Zackrisson492fdf42019-10-25 10:45:58 +0200394
395 # JSON parsing should not be needed in the "slim and modular" WebRTC.
396 "rtc_json",
397
398 # Software video codecs (VP8 and VP9 through libvpx).
399 "software_video_codecs",
Karl Wibergbb23c832018-04-22 19:55:00 +0200400]
401
Mirko Bonadei9a89a492018-05-29 14:22:32 +0000402absl_include_config = "//third_party/abseil-cpp:absl_include_config"
403absl_define_config = "//third_party/abseil-cpp:absl_define_config"
404
Mirko Bonadei2ab97f62019-07-18 13:44:12 +0200405# Abseil Flags are testonly, so this config will only be applied to WebRTC targets
406# that are testonly.
407absl_flags_config = webrtc_root + ":absl_flags_configs"
408
mbonadei9aa3f0a2017-01-24 06:58:22 -0800409template("rtc_test") {
410 test(target_name) {
411 forward_variables_from(invoker,
412 "*",
413 [
414 "configs",
415 "public_configs",
416 "suppressed_configs",
Karl Wiberg138d4ac2017-10-16 11:16:19 +0200417 "visibility",
mbonadei9aa3f0a2017-01-24 06:58:22 -0800418 ])
Mirko Bonadeidd411942017-11-21 15:35:27 +0100419
420 # Always override to public because when target_os is Android the `test`
421 # template can override it to [ "*" ] and we want to avoid conditional
422 # visibility.
Mirko Bonadei21558812017-11-21 12:47:34 +0100423 visibility = [ "*" ]
mbonadei9aa3f0a2017-01-24 06:58:22 -0800424 configs += invoker.configs
425 configs -= rtc_remove_configs
426 configs -= invoker.suppressed_configs
Mirko Bonadei9a89a492018-05-29 14:22:32 +0000427 public_configs = [
428 rtc_common_inherited_config,
429 absl_include_config,
430 absl_define_config,
Mirko Bonadei2ab97f62019-07-18 13:44:12 +0200431 absl_flags_config,
Mirko Bonadei9a89a492018-05-29 14:22:32 +0000432 ]
mbonadei9aa3f0a2017-01-24 06:58:22 -0800433 if (defined(invoker.public_configs)) {
434 public_configs += invoker.public_configs
435 }
sakald7fdb802017-05-26 01:51:53 -0700436 if (!build_with_chromium && is_android) {
Jianjun Zhu037f3e42017-08-15 21:48:37 +0800437 android_manifest = webrtc_root + "test/android/AndroidManifest.xml"
Oleh Prypina79abd42019-06-25 23:19:17 +0200438 min_sdk_version = 16
Jianjun Zhu037f3e42017-08-15 21:48:37 +0800439 deps += [ webrtc_root + "test:native_test_java" ]
sakald7fdb802017-05-26 01:51:53 -0700440 }
mbonadei9aa3f0a2017-01-24 06:58:22 -0800441 }
442}
443
444template("rtc_source_set") {
445 source_set(target_name) {
446 forward_variables_from(invoker,
447 "*",
448 [
449 "configs",
450 "public_configs",
451 "suppressed_configs",
Karl Wiberg138d4ac2017-10-16 11:16:19 +0200452 "visibility",
mbonadei9aa3f0a2017-01-24 06:58:22 -0800453 ])
Karl Wiberg138d4ac2017-10-16 11:16:19 +0200454 forward_variables_from(invoker, [ "visibility" ])
Per Kjellandera7f2d842018-01-10 15:54:53 +0000455 if (!defined(visibility)) {
456 visibility = webrtc_default_visibility
457 }
Karl Wibergbb23c832018-04-22 19:55:00 +0200458
459 # What's your poison?
460 if (defined(testonly) && testonly) {
461 assert(!defined(poisonous))
462 assert(!defined(allow_poison))
463 } else {
464 if (!defined(poisonous)) {
465 poisonous = []
466 }
467 if (!defined(allow_poison)) {
468 allow_poison = []
469 }
470 if (!defined(assert_no_deps)) {
471 assert_no_deps = []
472 }
473 if (!defined(deps)) {
474 deps = []
475 }
476 foreach(p, poisonous) {
477 deps += [ webrtc_root + ":poison_" + p ]
478 }
479 foreach(poison_type, all_poison_types) {
480 allow_dep = true
481 foreach(v, visibility) {
482 if (v == "*") {
483 allow_dep = false
484 }
485 }
486 foreach(p, allow_poison + poisonous) {
487 if (p == poison_type) {
488 allow_dep = true
489 }
490 }
491 if (!allow_dep) {
492 assert_no_deps += [ webrtc_root + ":poison_" + poison_type ]
493 }
494 }
495 }
496
Mirko Bonadei92dd35d2019-11-15 16:08:41 +0100497 # Chromium should only depend on the WebRTC component in order to
498 # avoid to statically link WebRTC in a component build.
499 if (build_with_chromium) {
500 publicly_visible = false
501 foreach(v, visibility) {
502 if (v == "*") {
503 publicly_visible = true
504 }
505 }
506 if (publicly_visible) {
507 visibility = []
508 visibility = webrtc_default_visibility
509 }
510 }
511
Mirko Bonadei96ede162018-09-06 13:45:44 +0200512 if (!defined(testonly) || !testonly) {
513 configs += rtc_prod_configs
514 }
515
mbonadei9aa3f0a2017-01-24 06:58:22 -0800516 configs += invoker.configs
Mirko Bonadei32ce18c2018-09-18 13:15:54 +0200517 configs += rtc_library_impl_config
mbonadei9aa3f0a2017-01-24 06:58:22 -0800518 configs -= rtc_remove_configs
519 configs -= invoker.suppressed_configs
Mirko Bonadei9a89a492018-05-29 14:22:32 +0000520 public_configs = [
521 rtc_common_inherited_config,
522 absl_include_config,
523 absl_define_config,
524 ]
Mirko Bonadei2ab97f62019-07-18 13:44:12 +0200525 if (defined(testonly) && testonly) {
526 public_configs += [ absl_flags_config ]
527 }
mbonadei9aa3f0a2017-01-24 06:58:22 -0800528 if (defined(invoker.public_configs)) {
529 public_configs += invoker.public_configs
530 }
Mirko Bonadei8b7cfa12020-06-03 21:23:41 +0200531
532 # If absl_deps if [], no action is needed. If not [], then if needs to be
533 # converted to //third_party/abseil-cpp:absl if is_component_build=true
534 # otherwise it just needs to be added to deps.
535 if (absl_deps != []) {
536 if (is_component_build && build_with_chromium) {
537 # TODO(crbug.com/1046390): Enable when the Abseil component will be
538 # available.
539 # deps += [ "//third_party/abseil-cpp:absl" ]
540 deps += absl_deps # Remove when the line above is enabled.
541 } else {
542 deps += absl_deps
543 }
544 }
mbonadei9aa3f0a2017-01-24 06:58:22 -0800545 }
546}
547
mbonadei9aa3f0a2017-01-24 06:58:22 -0800548template("rtc_static_library") {
549 static_library(target_name) {
550 forward_variables_from(invoker,
551 "*",
552 [
553 "configs",
554 "public_configs",
555 "suppressed_configs",
Karl Wiberg138d4ac2017-10-16 11:16:19 +0200556 "visibility",
mbonadei9aa3f0a2017-01-24 06:58:22 -0800557 ])
Karl Wiberg138d4ac2017-10-16 11:16:19 +0200558 forward_variables_from(invoker, [ "visibility" ])
Per Kjellandera7f2d842018-01-10 15:54:53 +0000559 if (!defined(visibility)) {
560 visibility = webrtc_default_visibility
561 }
Karl Wibergbb23c832018-04-22 19:55:00 +0200562
563 # What's your poison?
564 if (defined(testonly) && testonly) {
565 assert(!defined(poisonous))
566 assert(!defined(allow_poison))
567 } else {
568 if (!defined(poisonous)) {
569 poisonous = []
570 }
571 if (!defined(allow_poison)) {
572 allow_poison = []
573 }
574 if (!defined(assert_no_deps)) {
575 assert_no_deps = []
576 }
577 if (!defined(deps)) {
578 deps = []
579 }
580 foreach(p, poisonous) {
581 deps += [ webrtc_root + ":poison_" + p ]
582 }
583 foreach(poison_type, all_poison_types) {
584 allow_dep = true
585 foreach(v, visibility) {
586 if (v == "*") {
587 allow_dep = false
588 }
589 }
590 foreach(p, allow_poison + poisonous) {
591 if (p == poison_type) {
592 allow_dep = true
593 }
594 }
595 if (!allow_dep) {
596 assert_no_deps += [ webrtc_root + ":poison_" + poison_type ]
597 }
598 }
599 }
600
Mirko Bonadei96ede162018-09-06 13:45:44 +0200601 if (!defined(testonly) || !testonly) {
602 configs += rtc_prod_configs
603 }
604
mbonadei9aa3f0a2017-01-24 06:58:22 -0800605 configs += invoker.configs
Mirko Bonadei32ce18c2018-09-18 13:15:54 +0200606 configs += rtc_library_impl_config
mbonadei9aa3f0a2017-01-24 06:58:22 -0800607 configs -= rtc_remove_configs
608 configs -= invoker.suppressed_configs
Mirko Bonadei9a89a492018-05-29 14:22:32 +0000609 public_configs = [
610 rtc_common_inherited_config,
611 absl_include_config,
612 absl_define_config,
613 ]
Mirko Bonadei2ab97f62019-07-18 13:44:12 +0200614 if (defined(testonly) && testonly) {
615 public_configs += [ absl_flags_config ]
616 }
mbonadei9aa3f0a2017-01-24 06:58:22 -0800617 if (defined(invoker.public_configs)) {
618 public_configs += invoker.public_configs
619 }
Mirko Bonadei8b7cfa12020-06-03 21:23:41 +0200620
621 # If absl_deps if [], no action is needed. If not [], then if needs to be
622 # converted to //third_party/abseil-cpp:absl if is_component_build=true
623 # otherwise it just needs to be added to deps.
624 if (absl_deps != []) {
625 if (is_component_build && build_with_chromium) {
626 # TODO(crbug.com/1046390): Enable when the Abseil component will be
627 # available.
628 # deps += [ "//third_party/abseil-cpp:absl" ]
629 deps += absl_deps # Remove when the line above is enabled.
630 } else {
631 deps += absl_deps
632 }
633 }
mbonadei9aa3f0a2017-01-24 06:58:22 -0800634 }
635}
636
Mirko Bonadei86d053c2019-10-17 21:32:04 +0200637# This template automatically switches the target type between source_set
638# and static_library.
639#
640# This should be the default target type for all the WebRTC targets with
641# one exception. Do not use this template for header only targets, in that case
642# rtc_source_set must be used in order to avoid build errors (e.g. libtool
643# complains if the output .a file is empty).
644#
645# How does it work:
646# Since all files in a source_set are linked into a final binary, while files
647# in a static library are only linked in if at least one symbol in them is
648# referenced, in component builds source_sets are easy to deal with because
649# all their object files are passed to the linker to create a shared library.
650# In release builds instead, static_libraries are preferred since they allow
651# the linker to discard dead code.
652# For the same reason, testonly targets will always be expanded to
653# source_set in order to be sure that tests are present in the test binary.
654template("rtc_library") {
655 if (is_component_build || (defined(invoker.testonly) && invoker.testonly)) {
656 target_type = "source_set"
657 } else {
658 target_type = "static_library"
659 }
660 target(target_type, target_name) {
661 forward_variables_from(invoker,
662 "*",
663 [
664 "configs",
665 "public_configs",
666 "suppressed_configs",
667 "visibility",
668 ])
669 forward_variables_from(invoker, [ "visibility" ])
670 if (!defined(visibility)) {
671 visibility = webrtc_default_visibility
672 }
673
674 # What's your poison?
675 if (defined(testonly) && testonly) {
676 assert(!defined(poisonous))
677 assert(!defined(allow_poison))
678 } else {
679 if (!defined(poisonous)) {
680 poisonous = []
681 }
682 if (!defined(allow_poison)) {
683 allow_poison = []
684 }
685 if (!defined(assert_no_deps)) {
686 assert_no_deps = []
687 }
688 if (!defined(deps)) {
689 deps = []
690 }
691 foreach(p, poisonous) {
692 deps += [ webrtc_root + ":poison_" + p ]
693 }
694 foreach(poison_type, all_poison_types) {
695 allow_dep = true
696 foreach(v, visibility) {
697 if (v == "*") {
698 allow_dep = false
699 }
700 }
701 foreach(p, allow_poison + poisonous) {
702 if (p == poison_type) {
703 allow_dep = true
704 }
705 }
706 if (!allow_dep) {
707 assert_no_deps += [ webrtc_root + ":poison_" + poison_type ]
708 }
709 }
710 }
711
Mirko Bonadei92dd35d2019-11-15 16:08:41 +0100712 # Chromium should only depend on the WebRTC component in order to
713 # avoid to statically link WebRTC in a component build.
714 if (build_with_chromium) {
715 publicly_visible = false
716 foreach(v, visibility) {
717 if (v == "*") {
718 publicly_visible = true
719 }
720 }
721 if (publicly_visible) {
722 visibility = []
723 visibility = webrtc_default_visibility
724 }
725 }
726
Mirko Bonadei86d053c2019-10-17 21:32:04 +0200727 if (!defined(testonly) || !testonly) {
728 configs += rtc_prod_configs
729 }
730
731 configs += invoker.configs
732 configs += rtc_library_impl_config
733 configs -= rtc_remove_configs
734 configs -= invoker.suppressed_configs
735 public_configs = [
736 rtc_common_inherited_config,
737 absl_include_config,
738 absl_define_config,
739 ]
740 if (defined(testonly) && testonly) {
741 public_configs += [ absl_flags_config ]
742 }
743 if (defined(invoker.public_configs)) {
744 public_configs += invoker.public_configs
745 }
Mirko Bonadei8b7cfa12020-06-03 21:23:41 +0200746
747 # If absl_deps if [], no action is needed. If not [], then if needs to be
748 # converted to //third_party/abseil-cpp:absl if is_component_build=true
749 # otherwise it just needs to be added to deps.
750 if (absl_deps != []) {
751 if (is_component_build && build_with_chromium) {
752 # TODO(crbug.com/1046390): Enable when the Abseil component will be
753 # available.
754 # deps += [ "//third_party/abseil-cpp:absl" ]
755 deps += absl_deps # Remove when the line above is enabled.
756 } else {
757 deps += absl_deps
758 }
759 }
Mirko Bonadei86d053c2019-10-17 21:32:04 +0200760 }
761}
762
763template("rtc_executable") {
764 executable(target_name) {
765 forward_variables_from(invoker,
766 "*",
767 [
768 "deps",
769 "configs",
770 "public_configs",
771 "suppressed_configs",
772 "visibility",
773 ])
774 forward_variables_from(invoker, [ "visibility" ])
775 if (!defined(visibility)) {
776 visibility = webrtc_default_visibility
777 }
778 configs += invoker.configs
779 configs -= rtc_remove_configs
780 configs -= invoker.suppressed_configs
781 deps = invoker.deps
782
783 public_configs = [
784 rtc_common_inherited_config,
785 absl_include_config,
786 absl_define_config,
787 ]
788 if (defined(testonly) && testonly) {
789 public_configs += [ absl_flags_config ]
790 }
791 if (defined(invoker.public_configs)) {
792 public_configs += invoker.public_configs
793 }
794 if (is_win) {
795 deps += [
796 # Give executables the default manifest on Windows (a no-op elsewhere).
797 "//build/win:default_exe_manifest",
798 ]
799 }
800 }
801}
802
mbonadei9aa3f0a2017-01-24 06:58:22 -0800803template("rtc_shared_library") {
804 shared_library(target_name) {
805 forward_variables_from(invoker,
806 "*",
807 [
808 "configs",
809 "public_configs",
810 "suppressed_configs",
Karl Wiberg138d4ac2017-10-16 11:16:19 +0200811 "visibility",
mbonadei9aa3f0a2017-01-24 06:58:22 -0800812 ])
Karl Wiberg138d4ac2017-10-16 11:16:19 +0200813 forward_variables_from(invoker, [ "visibility" ])
Per Kjellandera7f2d842018-01-10 15:54:53 +0000814 if (!defined(visibility)) {
815 visibility = webrtc_default_visibility
816 }
Karl Wibergbb23c832018-04-22 19:55:00 +0200817
818 # What's your poison?
819 if (defined(testonly) && testonly) {
820 assert(!defined(poisonous))
821 assert(!defined(allow_poison))
822 } else {
823 if (!defined(poisonous)) {
824 poisonous = []
825 }
826 if (!defined(allow_poison)) {
827 allow_poison = []
828 }
829 if (!defined(assert_no_deps)) {
830 assert_no_deps = []
831 }
832 if (!defined(deps)) {
833 deps = []
834 }
835 foreach(p, poisonous) {
836 deps += [ webrtc_root + ":poison_" + p ]
837 }
838 foreach(poison_type, all_poison_types) {
839 allow_dep = true
840 foreach(v, visibility) {
841 if (v == "*") {
842 allow_dep = false
843 }
844 }
845 foreach(p, allow_poison + poisonous) {
846 if (p == poison_type) {
847 allow_dep = true
848 }
849 }
850 if (!allow_dep) {
851 assert_no_deps += [ webrtc_root + ":poison_" + poison_type ]
852 }
853 }
854 }
855
mbonadei9aa3f0a2017-01-24 06:58:22 -0800856 configs += invoker.configs
857 configs -= rtc_remove_configs
858 configs -= invoker.suppressed_configs
Mirko Bonadei9a89a492018-05-29 14:22:32 +0000859 public_configs = [
860 rtc_common_inherited_config,
861 absl_include_config,
862 absl_define_config,
863 ]
Mirko Bonadei2ab97f62019-07-18 13:44:12 +0200864 if (defined(testonly) && testonly) {
865 public_configs += [ absl_flags_config ]
866 }
mbonadei9aa3f0a2017-01-24 06:58:22 -0800867 if (defined(invoker.public_configs)) {
868 public_configs += invoker.public_configs
869 }
870 }
871}
kthelgason4065a572017-02-14 04:58:56 -0800872
873if (is_ios) {
874 set_defaults("rtc_ios_xctest_test") {
875 configs = rtc_add_configs
876 suppressed_configs = []
877 }
878
879 template("rtc_ios_xctest_test") {
880 ios_xctest_test(target_name) {
881 forward_variables_from(invoker,
882 "*",
883 [
884 "configs",
885 "public_configs",
886 "suppressed_configs",
Karl Wiberg138d4ac2017-10-16 11:16:19 +0200887 "visibility",
kthelgason4065a572017-02-14 04:58:56 -0800888 ])
Karl Wiberg138d4ac2017-10-16 11:16:19 +0200889 forward_variables_from(invoker, [ "visibility" ])
Per Kjellandera7f2d842018-01-10 15:54:53 +0000890 if (!defined(visibility)) {
891 visibility = webrtc_default_visibility
892 }
kthelgason4065a572017-02-14 04:58:56 -0800893 configs += invoker.configs
894 configs -= rtc_remove_configs
895 configs -= invoker.suppressed_configs
896 public_configs = [ rtc_common_inherited_config ]
897 if (defined(invoker.public_configs)) {
898 public_configs += invoker.public_configs
899 }
900 }
901 }
Anders Carlssondc6b4772018-01-15 13:31:03 +0100902
Joel Sutherlandd2fb1bf2018-10-02 16:08:25 -0400903 # TODO: Generate module.modulemap file to enable use in Swift
904 # projects. See "mac_framework_bundle_with_umbrella_header".
Anders Carlssondc6b4772018-01-15 13:31:03 +0100905 template("ios_framework_bundle_with_umbrella_header") {
906 forward_variables_from(invoker, [ "output_name" ])
907 umbrella_header_path =
908 "$target_gen_dir/$output_name.framework/Headers/$output_name.h"
909
910 ios_framework_bundle(target_name) {
911 forward_variables_from(invoker, "*", [])
912
913 deps += [ ":copy_umbrella_header_$target_name" ]
914 }
915
916 action("umbrella_header_$target_name") {
917 forward_variables_from(invoker, [ "public_headers" ])
918
919 script = "//tools_webrtc/ios/generate_umbrella_header.py"
920
Mirko Bonadeiccbe95f2020-01-21 12:10:10 +0100921 outputs = [ umbrella_header_path ]
Anders Carlssondc6b4772018-01-15 13:31:03 +0100922 args = [
923 "--out",
924 rebase_path(umbrella_header_path, root_build_dir),
925 "--sources",
Anders Carlsson7bca8ca2018-08-30 09:30:29 +0200926 ] + public_headers
Anders Carlssondc6b4772018-01-15 13:31:03 +0100927 }
928
929 copy("copy_umbrella_header_$target_name") {
Mirko Bonadeiccbe95f2020-01-21 12:10:10 +0100930 sources = [ umbrella_header_path ]
931 outputs =
932 [ "$root_out_dir/$output_name.framework/Headers/$output_name.h" ]
Anders Carlssondc6b4772018-01-15 13:31:03 +0100933
Mirko Bonadeiccbe95f2020-01-21 12:10:10 +0100934 deps = [ ":umbrella_header_$target_name" ]
Anders Carlssondc6b4772018-01-15 13:31:03 +0100935 }
936 }
937
938 set_defaults("ios_framework_bundle_with_umbrella_header") {
939 configs = default_shared_library_configs
940 }
kthelgason4065a572017-02-14 04:58:56 -0800941}
Mirko Bonadeifbb3b7d2017-11-07 15:36:33 +0000942
Anders Carlsson37bbf792018-09-05 16:29:27 +0200943if (is_mac) {
944 template("mac_framework_bundle_with_umbrella_header") {
945 forward_variables_from(invoker, [ "output_name" ])
Anders Carlsson95c56ee2018-09-06 15:48:17 +0200946 this_target_name = target_name
947 umbrella_header_path = "$target_gen_dir/umbrella_header/$output_name.h"
Joel Sutherlandd2fb1bf2018-10-02 16:08:25 -0400948 modulemap_path = "$target_gen_dir/Modules/module.modulemap"
Anders Carlsson37bbf792018-09-05 16:29:27 +0200949
950 mac_framework_bundle(target_name) {
Thomas Anderson6fde78c2019-01-23 10:40:29 -0800951 forward_variables_from(invoker, "*", [ "configs" ])
952 if (defined(invoker.configs)) {
953 configs += invoker.configs
954 }
Anders Carlsson37bbf792018-09-05 16:29:27 +0200955
956 framework_version = "A"
Joel Sutherlandd2fb1bf2018-10-02 16:08:25 -0400957 framework_contents = [
958 "Headers",
959 "Modules",
960 "Resources",
961 ]
Anders Carlsson37bbf792018-09-05 16:29:27 +0200962
963 ldflags = [
964 "-all_load",
965 "-install_name",
966 "@rpath/$output_name.framework/$output_name",
967 ]
968
969 deps += [
Anders Carlsson95c56ee2018-09-06 15:48:17 +0200970 ":copy_framework_headers_$this_target_name",
Joel Sutherlandd2fb1bf2018-10-02 16:08:25 -0400971 ":copy_modulemap_$this_target_name",
Anders Carlsson95c56ee2018-09-06 15:48:17 +0200972 ":copy_umbrella_header_$this_target_name",
Joel Sutherlandd2fb1bf2018-10-02 16:08:25 -0400973 ":modulemap_$this_target_name",
Anders Carlsson95c56ee2018-09-06 15:48:17 +0200974 ":umbrella_header_$this_target_name",
Anders Carlsson37bbf792018-09-05 16:29:27 +0200975 ]
976 }
977
Anders Carlsson95c56ee2018-09-06 15:48:17 +0200978 bundle_data("copy_framework_headers_$this_target_name") {
Anders Carlsson37bbf792018-09-05 16:29:27 +0200979 forward_variables_from(invoker, [ "sources" ])
980
Mirko Bonadeiccbe95f2020-01-21 12:10:10 +0100981 outputs = [ "{{bundle_contents_dir}}/Headers/{{source_file_part}}" ]
Anders Carlsson37bbf792018-09-05 16:29:27 +0200982 }
983
Joel Sutherlandd2fb1bf2018-10-02 16:08:25 -0400984 action("modulemap_$this_target_name") {
985 script = "//tools_webrtc/ios/generate_modulemap.py"
986 args = [
987 "--out",
988 rebase_path(modulemap_path, root_build_dir),
989 "--name",
990 output_name,
991 ]
Mirko Bonadeiccbe95f2020-01-21 12:10:10 +0100992 outputs = [ modulemap_path ]
Joel Sutherlandd2fb1bf2018-10-02 16:08:25 -0400993 }
994
995 bundle_data("copy_modulemap_$this_target_name") {
Mirko Bonadeiccbe95f2020-01-21 12:10:10 +0100996 sources = [ modulemap_path ]
997 outputs = [ "{{bundle_contents_dir}}/Modules/module.modulemap" ]
998 deps = [ ":modulemap_$this_target_name" ]
Joel Sutherlandd2fb1bf2018-10-02 16:08:25 -0400999 }
1000
Anders Carlsson95c56ee2018-09-06 15:48:17 +02001001 action("umbrella_header_$this_target_name") {
Anders Carlsson37bbf792018-09-05 16:29:27 +02001002 forward_variables_from(invoker, [ "sources" ])
1003
1004 script = "//tools_webrtc/ios/generate_umbrella_header.py"
1005
Mirko Bonadeiccbe95f2020-01-21 12:10:10 +01001006 outputs = [ umbrella_header_path ]
Anders Carlsson37bbf792018-09-05 16:29:27 +02001007 args = [
1008 "--out",
1009 rebase_path(umbrella_header_path, root_build_dir),
1010 "--sources",
1011 ] + sources
1012 }
1013
Anders Carlsson95c56ee2018-09-06 15:48:17 +02001014 bundle_data("copy_umbrella_header_$this_target_name") {
Mirko Bonadeiccbe95f2020-01-21 12:10:10 +01001015 sources = [ umbrella_header_path ]
1016 outputs = [ "{{bundle_contents_dir}}/Headers/$output_name.h" ]
Anders Carlsson37bbf792018-09-05 16:29:27 +02001017
Mirko Bonadeiccbe95f2020-01-21 12:10:10 +01001018 deps = [ ":umbrella_header_$this_target_name" ]
Anders Carlsson37bbf792018-09-05 16:29:27 +02001019 }
1020 }
1021}
1022
Mirko Bonadeifbb3b7d2017-11-07 15:36:33 +00001023if (is_android) {
1024 template("rtc_android_library") {
1025 android_library(target_name) {
1026 forward_variables_from(invoker,
1027 "*",
1028 [
1029 "configs",
1030 "public_configs",
1031 "suppressed_configs",
1032 "visibility",
1033 ])
1034
Oleh Prypin05aee742018-11-23 17:29:44 +01001035 errorprone_args = []
Sami Kalliomäkie7fac682018-03-20 16:32:49 +01001036
Mirko Bonadeifbb3b7d2017-11-07 15:36:33 +00001037 # Treat warnings as errors.
Oleh Prypin05aee742018-11-23 17:29:44 +01001038 errorprone_args += [ "-Werror" ]
Sami Kalliomäkie7fac682018-03-20 16:32:49 +01001039
1040 # Add any arguments defined by the invoker.
Oleh Prypin05aee742018-11-23 17:29:44 +01001041 if (defined(invoker.errorprone_args)) {
1042 errorprone_args += invoker.errorprone_args
Sami Kalliomäkie7fac682018-03-20 16:32:49 +01001043 }
Mirko Bonadeifbb3b7d2017-11-07 15:36:33 +00001044
Sami Kalliomäkidc526512018-03-27 17:07:27 +02001045 if (!defined(deps)) {
1046 deps = []
1047 }
Sami Kalliomäkidc526512018-03-27 17:07:27 +02001048
Mirko Bonadeifbb3b7d2017-11-07 15:36:33 +00001049 no_build_hooks = true
Mirko Bonadei8b7cfa12020-06-03 21:23:41 +02001050 not_needed([ "android_manifest" ])
Mirko Bonadeifbb3b7d2017-11-07 15:36:33 +00001051 }
1052 }
1053
1054 template("rtc_android_apk") {
1055 android_apk(target_name) {
1056 forward_variables_from(invoker,
1057 "*",
1058 [
1059 "configs",
1060 "public_configs",
1061 "suppressed_configs",
1062 "visibility",
1063 ])
1064
1065 # Treat warnings as errors.
Yves Gerey2f385d22019-11-20 12:10:08 +01001066 errorprone_args = []
1067 errorprone_args += [ "-Werror" ]
Sami Kalliomäkidc526512018-03-27 17:07:27 +02001068
1069 if (!defined(deps)) {
1070 deps = []
1071 }
Sami Kalliomäkidc526512018-03-27 17:07:27 +02001072
Mirko Bonadeifbb3b7d2017-11-07 15:36:33 +00001073 no_build_hooks = true
1074 }
1075 }
1076
1077 template("rtc_instrumentation_test_apk") {
1078 instrumentation_test_apk(target_name) {
1079 forward_variables_from(invoker,
1080 "*",
1081 [
1082 "configs",
1083 "public_configs",
1084 "suppressed_configs",
1085 "visibility",
1086 ])
1087
1088 # Treat warnings as errors.
Yves Gerey2f385d22019-11-20 12:10:08 +01001089 errorprone_args = []
1090 errorprone_args += [ "-Werror" ]
Sami Kalliomäkidc526512018-03-27 17:07:27 +02001091
1092 if (!defined(deps)) {
1093 deps = []
1094 }
Sami Kalliomäkidc526512018-03-27 17:07:27 +02001095
Mirko Bonadeifbb3b7d2017-11-07 15:36:33 +00001096 no_build_hooks = true
1097 }
1098 }
1099}