blob: d57e1bf98d8052cf825c51318fc404379e856de3 [file] [log] [blame]
mbonadei9aa3f0a2017-01-24 14:58:221# 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 14:58:228import("//build/config/arm.gni")
9import("//build/config/features.gni")
10import("//build/config/mips.gni")
11import("//build/config/sanitizers/sanitizers.gni")
Tomas Popela318da512018-11-13 05:32:2312import("//build/config/sysroot.gni")
ehmaldonado0d729b32017-02-10 09:38:2313import("//build/config/ui.gni")
mbonadei9aa3f0a2017-01-24 14:58:2214import("//build_overrides/build.gni")
mbonadei96606272017-03-04 03:41:5915
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
kthelgason4065a5762017-02-14 12:58:5630if (is_ios) {
31 import("//build/config/ios/rules.gni")
32}
mbonadei9aa3f0a2017-01-24 14:58:2233
Anders Carlsson37bbf792018-09-05 14:29:2734if (is_mac) {
35 import("//build/config/mac/rules.gni")
36}
37
mbonadei9aa3f0a2017-01-24 14:58:2238declare_args() {
Mirko Bonadei028248c2018-10-10 10:19:0239 # 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 08:37:1143 # Setting this to true will define WEBRTC_EXCLUDE_FIELD_TRIAL_DEFAULT which
Mirko Bonadei70400902018-08-21 13:44:2844 # 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 08:37:1147 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 13:44:2855
Mirko Bonadei906add42018-09-05 14:03:1656 # 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 20:12:2562 # 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 14:08:1267 # Include the iLBC audio codec?
Olga Sharonova5fbd7582020-07-09 09:50:4268 rtc_include_ilbc = true
Karl Wibergeb254b42017-11-01 14:08:1269
mbonadei9aa3f0a2017-01-24 14:58:2270 # Disable this to avoid building the Opus audio codec.
71 rtc_include_opus = true
72
minyue2e03c662017-02-02 01:31:1173 # Enable this if the Opus version upon which WebRTC is built supports direct
74 # encoding of 120 ms packets.
minyue-webrtc516711c2017-07-27 15:45:4975 rtc_opus_support_120ms_ptime = true
minyue2e03c662017-02-02 01:31:1176
mbonadei9aa3f0a2017-01-24 14:58:2277 # Enable this to let the Opus audio codec change complexity on the fly.
78 rtc_opus_variable_complexity = false
79
mbonadei9aa3f0a2017-01-24 14:58:2280 # 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
mbonadei9aa3f0a2017-01-24 14:58:2288 # Enable when an external authentication mechanism is used for performing
89 # packet authentication for RTP packets instead of libsrtp.
90 rtc_enable_external_auth = build_with_chromium
91
92 # Selects whether debug dumps for the audio processing module
93 # should be generated.
94 apm_debug_dump = false
95
Per Åhgrencc73ed32020-04-26 21:56:1796 # Selects whether the audio processing module should be excluded.
97 rtc_exclude_audio_processing_module = false
98
mbonadei9aa3f0a2017-01-24 14:58:2299 # Set this to true to enable BWE test logging.
100 rtc_enable_bwe_test_logging = false
101
Joachim Bauch93e91342017-12-07 00:25:53102 # Set this to false to skip building examples.
103 rtc_build_examples = true
104
105 # Set this to false to skip building tools.
106 rtc_build_tools = true
107
Joachim Bauch75f18fc2017-12-20 20:25:47108 # Set this to false to skip building code that requires X11.
109 rtc_use_x11 = use_x11
110
Tomas Popela318da512018-11-13 05:32:23111 # Set this to use PipeWire on the Wayland display server.
Tomas Popela762543f2018-12-12 13:37:51112 # By default it's only enabled on desktop Linux (excludes ChromeOS) and
113 # only when using the sysroot as PipeWire is not available in older and
114 # supported Ubuntu and Debian distributions.
Xiaohan Wang9f32f3b2020-10-01 21:46:54115 rtc_use_pipewire = is_linux && use_sysroot
Tomas Popela762543f2018-12-12 13:37:51116
117 # Set this to link PipeWire directly instead of using the dlopen.
118 rtc_link_pipewire = false
Tomas Popela318da512018-11-13 05:32:23119
Jan Grulichc3c81292020-12-02 08:03:34120 # Set this to use certain PipeWire version
121 # Currently we support PipeWire 0.2 (default) and PipeWire 0.3
122 rtc_pipewire_version = "0.2"
123
mbonadei9aa3f0a2017-01-24 14:58:22124 # Enable to use the Mozilla internal settings.
125 build_with_mozilla = false
126
Philipp Hanckee95ebda2020-09-17 14:13:20127 # Experimental: enable use of Android AAudio which requires Android SDK 26 or above
128 # and NDK r16 or above.
henrika883d00f2018-03-16 09:09:49129 rtc_enable_android_aaudio = false
130
mbonadei9aa3f0a2017-01-24 14:58:22131 # Set to "func", "block", "edge" for coverage generation.
132 # At unit test runtime set UBSAN_OPTIONS="coverage=1".
133 # It is recommend to set include_examples=0.
134 # Use llvm's sancov -html-report for human readable reports.
135 # See http://clang.llvm.org/docs/SanitizerCoverage.html .
136 rtc_sanitize_coverage = ""
137
Philipp Hanckeaeac9f82020-09-11 09:58:18138 # Selects fixed-point code where possible.
139 rtc_prefer_fixed_point = false
mbonadei9aa3f0a2017-01-24 14:58:22140 if (current_cpu == "arm" || current_cpu == "arm64") {
141 rtc_prefer_fixed_point = true
142 }
143
mbonadei9aa3f0a2017-01-24 14:58:22144 # Determines whether NEON code will be built.
145 rtc_build_with_neon =
146 (current_cpu == "arm" && arm_use_neon) || current_cpu == "arm64"
147
148 # Enable this to build OpenH264 encoder/FFmpeg decoder. This is supported on
149 # all platforms except Android and iOS. Because FFmpeg can be built
150 # with/without H.264 support, |ffmpeg_branding| has to separately be set to a
151 # value that includes H.264, for example "Chrome". If FFmpeg is built without
Sergey Silkinfe288eb2018-06-25 14:22:38152 # H.264, compilation succeeds but |H264DecoderImpl| fails to initialize.
mbonadei9aa3f0a2017-01-24 14:58:22153 # CHECK THE OPENH264, FFMPEG AND H.264 LICENSES/PATENTS BEFORE BUILDING.
154 # http://www.openh264.org, https://www.ffmpeg.org/
Mirko Bonadeiee0a85c2019-01-15 09:47:18155 #
156 # Enabling H264 when building with MSVC is currently not supported, see
157 # bugs.webrtc.org/9213#c13 for more info.
158 rtc_use_h264 =
159 proprietary_codecs && !is_android && !is_ios && !(is_win && !is_clang)
mbonadei9aa3f0a2017-01-24 14:58:22160
Markus Handell8e75bd42020-06-05 09:47:40161 # Enable this flag to make webrtc::Mutex be implemented by absl::Mutex.
162 rtc_use_absl_mutex = false
163
mbonadei9aa3f0a2017-01-24 14:58:22164 # By default, use normal platform audio support or dummy audio, but don't
165 # use file-based audio playout and record.
166 rtc_use_dummy_audio_file_devices = false
167
henrika7be78832017-06-13 15:34:16168 # When set to true, replace the audio output with a sinus tone at 440Hz.
169 # The ADM will ask for audio data from WebRTC but instead of reading real
170 # audio samples from NetEQ, a sinus tone will be generated and replace the
171 # real audio samples.
172 rtc_audio_device_plays_sinus_tone = false
173
Anders Carlsson358f2e02018-06-04 08:24:37174 if (is_ios) {
175 # Build broadcast extension in AppRTCMobile for iOS. This results in the
176 # binary only running on iOS 11+, which is why it is disabled by default.
177 rtc_apprtcmobile_broadcast_extension = false
178 }
Anders Carlsson7bca8ca2018-08-30 07:30:29179
180 # Determines whether Metal is available on iOS/macOS.
181 rtc_use_metal_rendering = is_mac || (is_ios && current_cpu == "arm64")
Jiawei Ou08745302019-02-12 19:36:13182
183 # When set to false, builtin audio encoder/decoder factories and all the
184 # audio codecs they depend 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_audio_codecs = true
188
189 # When set to false, builtin video encoder/decoder factories and all the
190 # video codecs they depends on will not be included in libwebrtc.{a|lib}
191 # (they will still be included in libjingle_peerconnection_so.so and
192 # WebRTC.framework)
193 rtc_include_builtin_video_codecs = true
Mirko Bonadei20574f42019-03-28 06:50:07194
195 # When set to true and in a standalone build, it will undefine UNICODE and
196 # _UNICODE (which are always defined globally by the Chromium Windows
197 # toolchain).
198 # This is only needed for testing purposes, WebRTC wants to be sure it
199 # doesn't assume /DUNICODE and /D_UNICODE but that it explicitly uses
200 # wide character functions.
201 rtc_win_undef_unicode = false
Austin Orion25b0dee2020-10-01 20:47:54202
203 # When set to true, a capturer implementation that uses the
204 # Windows.Graphics.Capture APIs will be available for use. These APIs are
205 # available in the Win 10 SDK v10.0.19041.
206 rtc_enable_win_wgc = false
Dan Minor9c686132018-01-15 15:20:00207}
mbonadei9aa3f0a2017-01-24 14:58:22208
Dan Minor9c686132018-01-15 15:20:00209if (!build_with_mozilla) {
210 import("//testing/test.gni")
mbonadei9aa3f0a2017-01-24 14:58:22211}
212
213# A second declare_args block, so that declarations within it can
214# depend on the possibly overridden variables in the first
215# declare_args block.
216declare_args() {
Dan Minor9c686132018-01-15 15:20:00217 # Enables the use of protocol buffers for debug recordings.
218 rtc_enable_protobuf = !build_with_mozilla
219
220 # Set this to disable building with support for SCTP data channels.
221 rtc_enable_sctp = !build_with_mozilla
222
223 # Disable these to not build components which can be externally provided.
224 rtc_build_json = !build_with_mozilla
225 rtc_build_libsrtp = !build_with_mozilla
226 rtc_build_libvpx = !build_with_mozilla
227 rtc_libvpx_build_vp9 = !build_with_mozilla
Dan Minor9c686132018-01-15 15:20:00228 rtc_build_opus = !build_with_mozilla
229 rtc_build_ssl = !build_with_mozilla
230 rtc_build_usrsctp = !build_with_mozilla
231
232 # Enable libevent task queues on platforms that support it.
Mirko Bonadei775c02e2019-06-19 17:05:00233 if (is_win || is_mac || is_ios || is_nacl || is_fuchsia ||
234 target_cpu == "wasm") {
Dan Minor9c686132018-01-15 15:20:00235 rtc_enable_libevent = false
236 rtc_build_libevent = false
237 } else {
238 rtc_enable_libevent = true
239 rtc_build_libevent = !build_with_mozilla
240 }
241
Dan Minor9c686132018-01-15 15:20:00242 # Build sources requiring GTK. NOTICE: This is not present in Chrome OS
243 # build environments, even if available for Chromium builds.
244 rtc_use_gtk = !build_with_chromium && !build_with_mozilla
245
mbonadei9aa3f0a2017-01-24 14:58:22246 # Excluded in Chromium since its prerequisites don't require Pulse Audio.
247 rtc_include_pulse_audio = !build_with_chromium
248
249 # Chromium uses its own IO handling, so the internal ADM is only built for
250 # standalone WebRTC.
251 rtc_include_internal_audio_device = !build_with_chromium
252
Zhaoliang Ma72e43212020-08-17 09:13:41253 # Set this to true to enable the avx2 support in webrtc.
Per Åhgrena43178c2020-09-25 10:02:32254 # TODO: Make sure that AVX2 works also for non-clang compilers.
255 if (is_clang == true) {
256 rtc_enable_avx2 = true
257 } else {
258 rtc_enable_avx2 = false
259 }
Zhaoliang Ma72e43212020-08-17 09:13:41260
mbonadei9aa3f0a2017-01-24 14:58:22261 # Include tests in standalone checkout.
Dan Minor9c686132018-01-15 15:20:00262 rtc_include_tests = !build_with_chromium && !build_with_mozilla
Oleh Prypin240b8932019-06-07 11:27:07263
264 # Set this to false to skip building code that also requires X11 extensions
265 # such as Xdamage, Xfixes.
266 rtc_use_x11_extensions = rtc_use_x11
Artem Titov6a4a1462019-11-26 15:24:46267
268 # Set this to true to fully remove logging from WebRTC.
269 rtc_disable_logging = false
Doudou Kisabaka2dec4962019-11-28 13:24:31270
271 # Set this to true to disable trace events.
272 rtc_disable_trace_events = false
Artem Titov9dc209a2019-11-28 16:09:30273
274 # Set this to true to disable detailed error message and logging for
275 # RTC_CHECKs.
276 rtc_disable_check_msg = false
Ying Wangef3998f2019-12-09 12:06:53277
278 # Set this to true to disable webrtc metrics.
Mirko Bonadei3c4fda22019-12-10 14:02:53279 rtc_disable_metrics = false
sazaaa42ecd2020-04-01 13:24:40280
281 # Set this to true to exclude the transient suppressor in the audio processing
282 # module from the build.
283 rtc_exclude_transient_suppressor = false
mbonadei9aa3f0a2017-01-24 14:58:22284}
285
286# Make it possible to provide custom locations for some libraries (move these
287# up into declare_args should we need to actually use them for the GN build).
288rtc_libvpx_dir = "//third_party/libvpx"
mbonadei9aa3f0a2017-01-24 14:58:22289rtc_opus_dir = "//third_party/opus"
290
291# Desktop capturer is supported only on Windows, OSX and Linux.
Oleh Prypin240b8932019-06-07 11:27:07292rtc_desktop_capture_supported =
293 (is_win && current_os != "winuwp") || is_mac ||
Hidehiko Abef264e702020-09-10 09:10:11294 ((is_linux || is_chromeos) && (rtc_use_x11_extensions || rtc_use_pipewire))
mbonadei9aa3f0a2017-01-24 14:58:22295
296###############################################################################
297# Templates
298#
299
Mirko Bonadei92ea95e2017-09-15 04:47:31300# Points to // in webrtc stand-alone or to //third_party/webrtc/ in
mbonadei9aa3f0a2017-01-24 14:58:22301# chromium.
302# We need absolute paths for all configs in templates as they are shared in
303# different subdirectories.
304webrtc_root = get_path_info(".", "abspath")
305
306# Global configuration that should be applied to all WebRTC targets.
307# You normally shouldn't need to include this in your target as it's
308# automatically included when using the rtc_* templates.
309# It sets defines, include paths and compilation warnings accordingly,
310# both for WebRTC stand-alone builds and for the scenario when WebRTC
311# native code is built as part of Chromium.
Will Harrisfc173d02018-08-29 20:56:00312rtc_common_configs = [
313 webrtc_root + ":common_config",
314 "//build/config/compiler:no_size_t_to_int_warning",
315]
mbonadei9aa3f0a2017-01-24 14:58:22316
kthelgasonc0977102017-04-24 07:57:16317if (is_mac || is_ios) {
318 rtc_common_configs += [ "//build/config/compiler:enable_arc" ]
319}
320
mbonadei9aa3f0a2017-01-24 14:58:22321# Global public configuration that should be applied to all WebRTC targets. You
322# normally shouldn't need to include this in your target as it's automatically
323# included when using the rtc_* templates. It set the defines, include paths and
324# compilation warnings that should be propagated to dependents of the targets
325# depending on the target having this config.
326rtc_common_inherited_config = webrtc_root + ":common_inherited_config"
327
328# Common configs to remove or add in all rtc targets.
329rtc_remove_configs = []
Mirko Bonadeifc52b912019-03-01 09:32:56330if (!build_with_chromium && is_clang) {
331 rtc_remove_configs += [ "//build/config/clang:find_bad_constructs" ]
332}
mbonadei9aa3f0a2017-01-24 14:58:22333rtc_add_configs = rtc_common_configs
Mirko Bonadei96ede16a2018-09-06 11:45:44334rtc_prod_configs = [ webrtc_root + ":rtc_prod_config" ]
Mirko Bonadei32ce18c2018-09-18 11:15:54335rtc_library_impl_config = [ webrtc_root + ":library_impl_config" ]
mbonadei9aa3f0a2017-01-24 14:58:22336
337set_defaults("rtc_test") {
338 configs = rtc_add_configs
339 suppressed_configs = []
340}
341
Mirko Bonadei86d053c2019-10-17 19:32:04342set_defaults("rtc_library") {
343 configs = rtc_add_configs
344 suppressed_configs = []
Mirko Bonadei8b7cfa12020-06-03 19:23:41345 absl_deps = []
Mirko Bonadei86d053c2019-10-17 19:32:04346}
347
mbonadei9aa3f0a2017-01-24 14:58:22348set_defaults("rtc_source_set") {
349 configs = rtc_add_configs
350 suppressed_configs = []
Mirko Bonadei8b7cfa12020-06-03 19:23:41351 absl_deps = []
mbonadei9aa3f0a2017-01-24 14:58:22352}
353
Mirko Bonadei86d053c2019-10-17 19:32:04354set_defaults("rtc_static_library") {
mbonadei9aa3f0a2017-01-24 14:58:22355 configs = rtc_add_configs
356 suppressed_configs = []
Mirko Bonadei8b7cfa12020-06-03 19:23:41357 absl_deps = []
mbonadei9aa3f0a2017-01-24 14:58:22358}
359
Mirko Bonadei86d053c2019-10-17 19:32:04360set_defaults("rtc_executable") {
mbonadei9aa3f0a2017-01-24 14:58:22361 configs = rtc_add_configs
362 suppressed_configs = []
363}
364
365set_defaults("rtc_shared_library") {
366 configs = rtc_add_configs
367 suppressed_configs = []
368}
369
Per Kjellandera7f2d842018-01-10 15:54:53370webrtc_default_visibility = [ webrtc_root + "/*" ]
371if (build_with_chromium) {
372 # Allow Chromium's WebRTC overrides targets to bypass the regular
373 # visibility restrictions.
374 webrtc_default_visibility += [ webrtc_root + "/../webrtc_overrides/*" ]
375}
376
Karl Wibergbb23c832018-04-22 17:55:00377# ---- Poisons ----
378#
379# The general idea is that some targets declare that they contain some
380# kind of poison, which makes it impossible for other targets to
381# depend on them (even transitively) unless they declare themselves
382# immune to that particular type of poison.
383#
384# Targets that *contain* poison of type foo should contain the line
385#
386# poisonous = [ "foo" ]
387#
388# and targets that *are immune but arent't themselves poisonous*
389# should contain
390#
391# allow_poison = [ "foo" ]
392#
393# This useful in cases where we have some large target or set of
394# targets and want to ensure that most other targets do not
395# transitively depend on them. For example, almost no high-level
396# target should depend on the audio codecs, since we want WebRTC users
397# to be able to inject any subset of them and actually end up with a
398# binary that doesn't include the codecs they didn't inject.
399#
400# Test-only targets (`testonly` set to true) and non-public targets
401# (`visibility` not containing "*") are automatically immune to all
402# types of poison.
403#
404# Here's the complete list of all types of poison. It must be kept in
405# 1:1 correspondence with the set of //:poison_* targets.
406#
407all_poison_types = [
408 # Encoders and decoders for specific audio codecs such as Opus and iSAC.
409 "audio_codecs",
Anders Carlsson1f433e42018-04-24 14:39:05410
Danil Chapovalov41300af2019-07-10 10:44:43411 # Default task queue implementation.
412 "default_task_queue",
Sam Zackrisson492fdf42019-10-25 08:45:58413
414 # JSON parsing should not be needed in the "slim and modular" WebRTC.
415 "rtc_json",
416
417 # Software video codecs (VP8 and VP9 through libvpx).
418 "software_video_codecs",
Karl Wibergbb23c832018-04-22 17:55:00419]
420
Mirko Bonadei9a89a492018-05-29 14:22:32421absl_include_config = "//third_party/abseil-cpp:absl_include_config"
422absl_define_config = "//third_party/abseil-cpp:absl_define_config"
423
Mirko Bonadei2ab97f62019-07-18 11:44:12424# Abseil Flags are testonly, so this config will only be applied to WebRTC targets
425# that are testonly.
426absl_flags_config = webrtc_root + ":absl_flags_configs"
427
Mirko Bonadeie99b6cc2020-11-25 15:41:37428# WebRTC wrapper of Chromium's test() template. This template just adds some
429# WebRTC only configuration in order to avoid to duplicate it for every WebRTC
430# target.
431# The parameter `is_xctest` is different from the one in the Chromium's test()
432# template (and it is not forwarded to it). In rtc_test(), the argument
433# `is_xctest` is used to avoid to take dependencies that are not needed
434# in case the test is a real XCTest (using the XCTest framework).
mbonadei9aa3f0a2017-01-24 14:58:22435template("rtc_test") {
436 test(target_name) {
437 forward_variables_from(invoker,
438 "*",
439 [
440 "configs",
Mirko Bonadeie99b6cc2020-11-25 15:41:37441 "is_xctest",
mbonadei9aa3f0a2017-01-24 14:58:22442 "public_configs",
443 "suppressed_configs",
Karl Wiberg138d4ac2017-10-16 09:16:19444 "visibility",
mbonadei9aa3f0a2017-01-24 14:58:22445 ])
Mirko Bonadeidd411942017-11-21 14:35:27446
447 # Always override to public because when target_os is Android the `test`
448 # template can override it to [ "*" ] and we want to avoid conditional
449 # visibility.
Mirko Bonadei21558812017-11-21 11:47:34450 visibility = [ "*" ]
mbonadei9aa3f0a2017-01-24 14:58:22451 configs += invoker.configs
452 configs -= rtc_remove_configs
453 configs -= invoker.suppressed_configs
Mirko Bonadei9a89a492018-05-29 14:22:32454 public_configs = [
455 rtc_common_inherited_config,
456 absl_include_config,
457 absl_define_config,
Mirko Bonadei2ab97f62019-07-18 11:44:12458 absl_flags_config,
Mirko Bonadei9a89a492018-05-29 14:22:32459 ]
mbonadei9aa3f0a2017-01-24 14:58:22460 if (defined(invoker.public_configs)) {
461 public_configs += invoker.public_configs
462 }
sakald7fdb802017-05-26 08:51:53463 if (!build_with_chromium && is_android) {
Jianjun Zhu037f3e42017-08-15 13:48:37464 android_manifest = webrtc_root + "test/android/AndroidManifest.xml"
Jeremy Leconteb19cfee2020-06-25 20:57:49465 min_sdk_version = 21
Mirko Bonadeibd393b22020-07-10 21:00:41466 target_sdk_version = 23
Jianjun Zhu037f3e42017-08-15 13:48:37467 deps += [ webrtc_root + "test:native_test_java" ]
sakald7fdb802017-05-26 08:51:53468 }
Mirko Bonadeie99b6cc2020-11-25 15:41:37469
470 # When not targeting a simulator, building //base/test:google_test_runner
471 # fails, so it is added only when the test is not a real XCTest and when
472 # targeting a simulator.
Mirko Bonadei58678a02020-12-01 09:54:40473 if (is_ios && target_cpu == "x64" && rtc_include_tests) {
Mirko Bonadeie99b6cc2020-11-25 15:41:37474 if (!defined(invoker.is_xctest) || !invoker.is_xctest) {
475 xctest_module_target = "//base/test:google_test_runner"
476 }
477 }
Andrey Logvin78646002021-01-29 10:50:19478
479 # If absl_deps is [], no action is needed. If not [], then it needs to be
480 # converted to //third_party/abseil-cpp:absl when build_with_chromium=true
481 # otherwise it just needs to be added to deps.
482 if (defined(absl_deps) && absl_deps != []) {
483 if (!defined(deps)) {
484 deps = []
485 }
486 if (build_with_chromium) {
487 deps += [ "//third_party/abseil-cpp:absl" ]
488 } else {
489 deps += absl_deps
490 }
491 }
492
Mirko Bonadei1d77c3e2021-01-26 16:10:04493 if (using_sanitizer) {
494 if (is_linux) {
495 if (!defined(invoker.data)) {
496 data = []
497 }
498 data +=
499 [ "//third_party/llvm-build/Release+Asserts/lib/libstdc++.so.6" ]
500 }
501 }
mbonadei9aa3f0a2017-01-24 14:58:22502 }
503}
504
505template("rtc_source_set") {
506 source_set(target_name) {
507 forward_variables_from(invoker,
508 "*",
509 [
510 "configs",
511 "public_configs",
512 "suppressed_configs",
Karl Wiberg138d4ac2017-10-16 09:16:19513 "visibility",
mbonadei9aa3f0a2017-01-24 14:58:22514 ])
Karl Wiberg138d4ac2017-10-16 09:16:19515 forward_variables_from(invoker, [ "visibility" ])
Per Kjellandera7f2d842018-01-10 15:54:53516 if (!defined(visibility)) {
517 visibility = webrtc_default_visibility
518 }
Karl Wibergbb23c832018-04-22 17:55:00519
520 # What's your poison?
521 if (defined(testonly) && testonly) {
522 assert(!defined(poisonous))
523 assert(!defined(allow_poison))
524 } else {
525 if (!defined(poisonous)) {
526 poisonous = []
527 }
528 if (!defined(allow_poison)) {
529 allow_poison = []
530 }
531 if (!defined(assert_no_deps)) {
532 assert_no_deps = []
533 }
534 if (!defined(deps)) {
535 deps = []
536 }
537 foreach(p, poisonous) {
538 deps += [ webrtc_root + ":poison_" + p ]
539 }
540 foreach(poison_type, all_poison_types) {
541 allow_dep = true
542 foreach(v, visibility) {
543 if (v == "*") {
544 allow_dep = false
545 }
546 }
547 foreach(p, allow_poison + poisonous) {
548 if (p == poison_type) {
549 allow_dep = true
550 }
551 }
552 if (!allow_dep) {
553 assert_no_deps += [ webrtc_root + ":poison_" + poison_type ]
554 }
555 }
556 }
557
Mirko Bonadei92dd35d2019-11-15 15:08:41558 # Chromium should only depend on the WebRTC component in order to
559 # avoid to statically link WebRTC in a component build.
560 if (build_with_chromium) {
561 publicly_visible = false
562 foreach(v, visibility) {
563 if (v == "*") {
564 publicly_visible = true
565 }
566 }
567 if (publicly_visible) {
568 visibility = []
569 visibility = webrtc_default_visibility
570 }
571 }
572
Mirko Bonadei96ede16a2018-09-06 11:45:44573 if (!defined(testonly) || !testonly) {
574 configs += rtc_prod_configs
575 }
576
mbonadei9aa3f0a2017-01-24 14:58:22577 configs += invoker.configs
Mirko Bonadei32ce18c2018-09-18 11:15:54578 configs += rtc_library_impl_config
mbonadei9aa3f0a2017-01-24 14:58:22579 configs -= rtc_remove_configs
580 configs -= invoker.suppressed_configs
Mirko Bonadei9a89a492018-05-29 14:22:32581 public_configs = [
582 rtc_common_inherited_config,
583 absl_include_config,
584 absl_define_config,
585 ]
Mirko Bonadei2ab97f62019-07-18 11:44:12586 if (defined(testonly) && testonly) {
587 public_configs += [ absl_flags_config ]
588 }
mbonadei9aa3f0a2017-01-24 14:58:22589 if (defined(invoker.public_configs)) {
590 public_configs += invoker.public_configs
591 }
Mirko Bonadei8b7cfa12020-06-03 19:23:41592
Mirko Bonadei96115cf2020-06-23 21:39:56593 # If absl_deps is [], no action is needed. If not [], then it needs to be
594 # converted to //third_party/abseil-cpp:absl when build_with_chromium=true
Mirko Bonadei8b7cfa12020-06-03 19:23:41595 # otherwise it just needs to be added to deps.
596 if (absl_deps != []) {
Mirko Bonadei2dcf3482020-06-05 12:30:41597 if (!defined(deps)) {
598 deps = []
599 }
Mirko Bonadei08ce9862020-06-11 09:25:32600 if (build_with_chromium) {
601 deps += [ "//third_party/abseil-cpp:absl" ]
Mirko Bonadei8b7cfa12020-06-03 19:23:41602 } else {
603 deps += absl_deps
604 }
605 }
mbonadei9aa3f0a2017-01-24 14:58:22606 }
607}
608
mbonadei9aa3f0a2017-01-24 14:58:22609template("rtc_static_library") {
610 static_library(target_name) {
611 forward_variables_from(invoker,
612 "*",
613 [
614 "configs",
615 "public_configs",
616 "suppressed_configs",
Karl Wiberg138d4ac2017-10-16 09:16:19617 "visibility",
mbonadei9aa3f0a2017-01-24 14:58:22618 ])
Karl Wiberg138d4ac2017-10-16 09:16:19619 forward_variables_from(invoker, [ "visibility" ])
Per Kjellandera7f2d842018-01-10 15:54:53620 if (!defined(visibility)) {
621 visibility = webrtc_default_visibility
622 }
Karl Wibergbb23c832018-04-22 17:55:00623
624 # What's your poison?
625 if (defined(testonly) && testonly) {
626 assert(!defined(poisonous))
627 assert(!defined(allow_poison))
628 } else {
629 if (!defined(poisonous)) {
630 poisonous = []
631 }
632 if (!defined(allow_poison)) {
633 allow_poison = []
634 }
635 if (!defined(assert_no_deps)) {
636 assert_no_deps = []
637 }
638 if (!defined(deps)) {
639 deps = []
640 }
641 foreach(p, poisonous) {
642 deps += [ webrtc_root + ":poison_" + p ]
643 }
644 foreach(poison_type, all_poison_types) {
645 allow_dep = true
646 foreach(v, visibility) {
647 if (v == "*") {
648 allow_dep = false
649 }
650 }
651 foreach(p, allow_poison + poisonous) {
652 if (p == poison_type) {
653 allow_dep = true
654 }
655 }
656 if (!allow_dep) {
657 assert_no_deps += [ webrtc_root + ":poison_" + poison_type ]
658 }
659 }
660 }
661
Mirko Bonadei96ede16a2018-09-06 11:45:44662 if (!defined(testonly) || !testonly) {
663 configs += rtc_prod_configs
664 }
665
mbonadei9aa3f0a2017-01-24 14:58:22666 configs += invoker.configs
Mirko Bonadei32ce18c2018-09-18 11:15:54667 configs += rtc_library_impl_config
mbonadei9aa3f0a2017-01-24 14:58:22668 configs -= rtc_remove_configs
669 configs -= invoker.suppressed_configs
Mirko Bonadei9a89a492018-05-29 14:22:32670 public_configs = [
671 rtc_common_inherited_config,
672 absl_include_config,
673 absl_define_config,
674 ]
Mirko Bonadei2ab97f62019-07-18 11:44:12675 if (defined(testonly) && testonly) {
676 public_configs += [ absl_flags_config ]
677 }
mbonadei9aa3f0a2017-01-24 14:58:22678 if (defined(invoker.public_configs)) {
679 public_configs += invoker.public_configs
680 }
Mirko Bonadei8b7cfa12020-06-03 19:23:41681
Mirko Bonadei96115cf2020-06-23 21:39:56682 # If absl_deps is [], no action is needed. If not [], then it needs to be
683 # converted to //third_party/abseil-cpp:absl when build_with_chromium=true
Mirko Bonadei8b7cfa12020-06-03 19:23:41684 # otherwise it just needs to be added to deps.
685 if (absl_deps != []) {
Mirko Bonadei2dcf3482020-06-05 12:30:41686 if (!defined(deps)) {
687 deps = []
688 }
Mirko Bonadei08ce9862020-06-11 09:25:32689 if (build_with_chromium) {
690 deps += [ "//third_party/abseil-cpp:absl" ]
Mirko Bonadei8b7cfa12020-06-03 19:23:41691 } else {
692 deps += absl_deps
693 }
694 }
mbonadei9aa3f0a2017-01-24 14:58:22695 }
696}
697
Mirko Bonadei86d053c2019-10-17 19:32:04698# This template automatically switches the target type between source_set
699# and static_library.
700#
701# This should be the default target type for all the WebRTC targets with
702# one exception. Do not use this template for header only targets, in that case
703# rtc_source_set must be used in order to avoid build errors (e.g. libtool
704# complains if the output .a file is empty).
705#
706# How does it work:
707# Since all files in a source_set are linked into a final binary, while files
708# in a static library are only linked in if at least one symbol in them is
709# referenced, in component builds source_sets are easy to deal with because
710# all their object files are passed to the linker to create a shared library.
711# In release builds instead, static_libraries are preferred since they allow
712# the linker to discard dead code.
713# For the same reason, testonly targets will always be expanded to
714# source_set in order to be sure that tests are present in the test binary.
715template("rtc_library") {
716 if (is_component_build || (defined(invoker.testonly) && invoker.testonly)) {
717 target_type = "source_set"
718 } else {
719 target_type = "static_library"
720 }
721 target(target_type, target_name) {
722 forward_variables_from(invoker,
723 "*",
724 [
725 "configs",
726 "public_configs",
727 "suppressed_configs",
728 "visibility",
729 ])
730 forward_variables_from(invoker, [ "visibility" ])
731 if (!defined(visibility)) {
732 visibility = webrtc_default_visibility
733 }
734
735 # What's your poison?
736 if (defined(testonly) && testonly) {
737 assert(!defined(poisonous))
738 assert(!defined(allow_poison))
739 } else {
740 if (!defined(poisonous)) {
741 poisonous = []
742 }
743 if (!defined(allow_poison)) {
744 allow_poison = []
745 }
746 if (!defined(assert_no_deps)) {
747 assert_no_deps = []
748 }
749 if (!defined(deps)) {
750 deps = []
751 }
752 foreach(p, poisonous) {
753 deps += [ webrtc_root + ":poison_" + p ]
754 }
755 foreach(poison_type, all_poison_types) {
756 allow_dep = true
757 foreach(v, visibility) {
758 if (v == "*") {
759 allow_dep = false
760 }
761 }
762 foreach(p, allow_poison + poisonous) {
763 if (p == poison_type) {
764 allow_dep = true
765 }
766 }
767 if (!allow_dep) {
768 assert_no_deps += [ webrtc_root + ":poison_" + poison_type ]
769 }
770 }
771 }
772
Mirko Bonadei92dd35d2019-11-15 15:08:41773 # Chromium should only depend on the WebRTC component in order to
774 # avoid to statically link WebRTC in a component build.
775 if (build_with_chromium) {
776 publicly_visible = false
777 foreach(v, visibility) {
778 if (v == "*") {
779 publicly_visible = true
780 }
781 }
782 if (publicly_visible) {
783 visibility = []
784 visibility = webrtc_default_visibility
785 }
786 }
787
Mirko Bonadei86d053c2019-10-17 19:32:04788 if (!defined(testonly) || !testonly) {
789 configs += rtc_prod_configs
790 }
791
792 configs += invoker.configs
793 configs += rtc_library_impl_config
794 configs -= rtc_remove_configs
795 configs -= invoker.suppressed_configs
796 public_configs = [
797 rtc_common_inherited_config,
798 absl_include_config,
799 absl_define_config,
800 ]
801 if (defined(testonly) && testonly) {
802 public_configs += [ absl_flags_config ]
803 }
804 if (defined(invoker.public_configs)) {
805 public_configs += invoker.public_configs
806 }
Mirko Bonadei8b7cfa12020-06-03 19:23:41807
Mirko Bonadei96115cf2020-06-23 21:39:56808 # If absl_deps is [], no action is needed. If not [], then it needs to be
809 # converted to //third_party/abseil-cpp:absl when build_with_chromium=true
Mirko Bonadei8b7cfa12020-06-03 19:23:41810 # otherwise it just needs to be added to deps.
811 if (absl_deps != []) {
Mirko Bonadei2dcf3482020-06-05 12:30:41812 if (!defined(deps)) {
813 deps = []
814 }
Mirko Bonadei08ce9862020-06-11 09:25:32815 if (build_with_chromium) {
816 deps += [ "//third_party/abseil-cpp:absl" ]
Mirko Bonadei8b7cfa12020-06-03 19:23:41817 } else {
818 deps += absl_deps
819 }
820 }
Mirko Bonadei86d053c2019-10-17 19:32:04821 }
822}
823
824template("rtc_executable") {
825 executable(target_name) {
826 forward_variables_from(invoker,
827 "*",
828 [
829 "deps",
830 "configs",
831 "public_configs",
832 "suppressed_configs",
833 "visibility",
834 ])
835 forward_variables_from(invoker, [ "visibility" ])
836 if (!defined(visibility)) {
837 visibility = webrtc_default_visibility
838 }
839 configs += invoker.configs
840 configs -= rtc_remove_configs
841 configs -= invoker.suppressed_configs
842 deps = invoker.deps
843
844 public_configs = [
845 rtc_common_inherited_config,
846 absl_include_config,
847 absl_define_config,
848 ]
849 if (defined(testonly) && testonly) {
850 public_configs += [ absl_flags_config ]
851 }
852 if (defined(invoker.public_configs)) {
853 public_configs += invoker.public_configs
854 }
855 if (is_win) {
856 deps += [
857 # Give executables the default manifest on Windows (a no-op elsewhere).
858 "//build/win:default_exe_manifest",
859 ]
860 }
861 }
862}
863
mbonadei9aa3f0a2017-01-24 14:58:22864template("rtc_shared_library") {
865 shared_library(target_name) {
866 forward_variables_from(invoker,
867 "*",
868 [
869 "configs",
870 "public_configs",
871 "suppressed_configs",
Karl Wiberg138d4ac2017-10-16 09:16:19872 "visibility",
mbonadei9aa3f0a2017-01-24 14:58:22873 ])
Karl Wiberg138d4ac2017-10-16 09:16:19874 forward_variables_from(invoker, [ "visibility" ])
Per Kjellandera7f2d842018-01-10 15:54:53875 if (!defined(visibility)) {
876 visibility = webrtc_default_visibility
877 }
Karl Wibergbb23c832018-04-22 17:55:00878
879 # What's your poison?
880 if (defined(testonly) && testonly) {
881 assert(!defined(poisonous))
882 assert(!defined(allow_poison))
883 } else {
884 if (!defined(poisonous)) {
885 poisonous = []
886 }
887 if (!defined(allow_poison)) {
888 allow_poison = []
889 }
890 if (!defined(assert_no_deps)) {
891 assert_no_deps = []
892 }
893 if (!defined(deps)) {
894 deps = []
895 }
896 foreach(p, poisonous) {
897 deps += [ webrtc_root + ":poison_" + p ]
898 }
899 foreach(poison_type, all_poison_types) {
900 allow_dep = true
901 foreach(v, visibility) {
902 if (v == "*") {
903 allow_dep = false
904 }
905 }
906 foreach(p, allow_poison + poisonous) {
907 if (p == poison_type) {
908 allow_dep = true
909 }
910 }
911 if (!allow_dep) {
912 assert_no_deps += [ webrtc_root + ":poison_" + poison_type ]
913 }
914 }
915 }
916
mbonadei9aa3f0a2017-01-24 14:58:22917 configs += invoker.configs
918 configs -= rtc_remove_configs
919 configs -= invoker.suppressed_configs
Mirko Bonadei9a89a492018-05-29 14:22:32920 public_configs = [
921 rtc_common_inherited_config,
922 absl_include_config,
923 absl_define_config,
924 ]
Mirko Bonadei2ab97f62019-07-18 11:44:12925 if (defined(testonly) && testonly) {
926 public_configs += [ absl_flags_config ]
927 }
mbonadei9aa3f0a2017-01-24 14:58:22928 if (defined(invoker.public_configs)) {
929 public_configs += invoker.public_configs
930 }
931 }
932}
kthelgason4065a5762017-02-14 12:58:56933
934if (is_ios) {
Joel Sutherlandd2fb1bf2018-10-02 20:08:25935 # TODO: Generate module.modulemap file to enable use in Swift
936 # projects. See "mac_framework_bundle_with_umbrella_header".
Anders Carlssondc6b4772018-01-15 12:31:03937 template("ios_framework_bundle_with_umbrella_header") {
938 forward_variables_from(invoker, [ "output_name" ])
Daniel.L (Byoungchan Lee)32026ed2020-10-16 22:49:28939 this_target_name = target_name
Anders Carlssondc6b4772018-01-15 12:31:03940 umbrella_header_path =
Daniel.L (Byoungchan Lee)32026ed2020-10-16 22:49:28941 "$target_gen_dir/$output_name.framework/WebRTC/$output_name.h"
942
943 action_foreach("create_bracket_include_headers_$target_name") {
944 script = "//tools_webrtc/apple/copy_framework_header.py"
945 sources = invoker.sources
946 output_name = invoker.output_name
947 outputs = [
948 "$target_gen_dir/$output_name.framework/WebRTC/{{source_file_part}}",
949 ]
950 args = [
951 "--input",
952 "{{source}}",
953 "--output",
954 rebase_path(target_gen_dir, root_build_dir) +
955 "/$output_name.framework/WebRTC/{{source_file_part}}",
956 ]
957 }
Anders Carlssondc6b4772018-01-15 12:31:03958
959 ios_framework_bundle(target_name) {
Daniel.L (Byoungchan Lee)32026ed2020-10-16 22:49:28960 forward_variables_from(invoker, "*", [ "public_headers" ])
961 public_headers = get_target_outputs(
962 ":create_bracket_include_headers_$this_target_name")
963 deps += [
964 ":copy_umbrella_header_$target_name",
965 ":create_bracket_include_headers_$target_name",
966 ]
Anders Carlssondc6b4772018-01-15 12:31:03967 }
968
969 action("umbrella_header_$target_name") {
Daniel.L (Byoungchan Lee)32026ed2020-10-16 22:49:28970 public_headers = get_target_outputs(
971 ":create_bracket_include_headers_$this_target_name")
Anders Carlssondc6b4772018-01-15 12:31:03972
973 script = "//tools_webrtc/ios/generate_umbrella_header.py"
974
Mirko Bonadeiccbe95f2020-01-21 11:10:10975 outputs = [ umbrella_header_path ]
Anders Carlssondc6b4772018-01-15 12:31:03976 args = [
977 "--out",
978 rebase_path(umbrella_header_path, root_build_dir),
979 "--sources",
Anders Carlsson7bca8ca2018-08-30 07:30:29980 ] + public_headers
Daniel.L (Byoungchan Lee)32026ed2020-10-16 22:49:28981 deps = [ ":create_bracket_include_headers_$this_target_name" ]
Anders Carlssondc6b4772018-01-15 12:31:03982 }
983
984 copy("copy_umbrella_header_$target_name") {
Mirko Bonadeiccbe95f2020-01-21 11:10:10985 sources = [ umbrella_header_path ]
986 outputs =
987 [ "$root_out_dir/$output_name.framework/Headers/$output_name.h" ]
Anders Carlssondc6b4772018-01-15 12:31:03988
Mirko Bonadeiccbe95f2020-01-21 11:10:10989 deps = [ ":umbrella_header_$target_name" ]
Anders Carlssondc6b4772018-01-15 12:31:03990 }
991 }
992
993 set_defaults("ios_framework_bundle_with_umbrella_header") {
994 configs = default_shared_library_configs
995 }
kthelgason4065a5762017-02-14 12:58:56996}
Mirko Bonadeifbb3b7d2017-11-07 15:36:33997
Anders Carlsson37bbf792018-09-05 14:29:27998if (is_mac) {
999 template("mac_framework_bundle_with_umbrella_header") {
1000 forward_variables_from(invoker, [ "output_name" ])
Anders Carlsson95c56ee2018-09-06 13:48:171001 this_target_name = target_name
1002 umbrella_header_path = "$target_gen_dir/umbrella_header/$output_name.h"
Joel Sutherlandd2fb1bf2018-10-02 20:08:251003 modulemap_path = "$target_gen_dir/Modules/module.modulemap"
Anders Carlsson37bbf792018-09-05 14:29:271004
1005 mac_framework_bundle(target_name) {
Thomas Anderson6fde78c2019-01-23 18:40:291006 forward_variables_from(invoker, "*", [ "configs" ])
1007 if (defined(invoker.configs)) {
1008 configs += invoker.configs
1009 }
Anders Carlsson37bbf792018-09-05 14:29:271010
1011 framework_version = "A"
Joel Sutherlandd2fb1bf2018-10-02 20:08:251012 framework_contents = [
1013 "Headers",
1014 "Modules",
1015 "Resources",
1016 ]
Anders Carlsson37bbf792018-09-05 14:29:271017
1018 ldflags = [
1019 "-all_load",
1020 "-install_name",
1021 "@rpath/$output_name.framework/$output_name",
1022 ]
1023
1024 deps += [
Anders Carlsson95c56ee2018-09-06 13:48:171025 ":copy_framework_headers_$this_target_name",
Joel Sutherlandd2fb1bf2018-10-02 20:08:251026 ":copy_modulemap_$this_target_name",
Anders Carlsson95c56ee2018-09-06 13:48:171027 ":copy_umbrella_header_$this_target_name",
Daniel.L (Byoungchan Lee)32026ed2020-10-16 22:49:281028 ":create_bracket_include_headers_$this_target_name",
Joel Sutherlandd2fb1bf2018-10-02 20:08:251029 ":modulemap_$this_target_name",
Anders Carlsson95c56ee2018-09-06 13:48:171030 ":umbrella_header_$this_target_name",
Anders Carlsson37bbf792018-09-05 14:29:271031 ]
1032 }
1033
Daniel.L (Byoungchan Lee)32026ed2020-10-16 22:49:281034 action_foreach("create_bracket_include_headers_$this_target_name") {
1035 script = "//tools_webrtc/apple/copy_framework_header.py"
1036 sources = invoker.sources
1037 output_name = invoker.output_name
1038 outputs = [
1039 "$target_gen_dir/$output_name.framework/WebRTC/{{source_file_part}}",
1040 ]
1041 args = [
1042 "--input",
1043 "{{source}}",
1044 "--output",
1045 rebase_path(target_gen_dir, root_build_dir) +
1046 "/$output_name.framework/WebRTC/{{source_file_part}}",
1047 ]
1048 }
1049
Anders Carlsson95c56ee2018-09-06 13:48:171050 bundle_data("copy_framework_headers_$this_target_name") {
Daniel.L (Byoungchan Lee)32026ed2020-10-16 22:49:281051 sources = get_target_outputs(
1052 ":create_bracket_include_headers_$this_target_name")
Anders Carlsson37bbf792018-09-05 14:29:271053
Mirko Bonadeiccbe95f2020-01-21 11:10:101054 outputs = [ "{{bundle_contents_dir}}/Headers/{{source_file_part}}" ]
Daniel.L (Byoungchan Lee)32026ed2020-10-16 22:49:281055 deps = [ ":create_bracket_include_headers_$this_target_name" ]
Anders Carlsson37bbf792018-09-05 14:29:271056 }
1057
Joel Sutherlandd2fb1bf2018-10-02 20:08:251058 action("modulemap_$this_target_name") {
1059 script = "//tools_webrtc/ios/generate_modulemap.py"
1060 args = [
1061 "--out",
1062 rebase_path(modulemap_path, root_build_dir),
1063 "--name",
1064 output_name,
1065 ]
Mirko Bonadeiccbe95f2020-01-21 11:10:101066 outputs = [ modulemap_path ]
Joel Sutherlandd2fb1bf2018-10-02 20:08:251067 }
1068
1069 bundle_data("copy_modulemap_$this_target_name") {
Mirko Bonadeiccbe95f2020-01-21 11:10:101070 sources = [ modulemap_path ]
1071 outputs = [ "{{bundle_contents_dir}}/Modules/module.modulemap" ]
1072 deps = [ ":modulemap_$this_target_name" ]
Joel Sutherlandd2fb1bf2018-10-02 20:08:251073 }
1074
Anders Carlsson95c56ee2018-09-06 13:48:171075 action("umbrella_header_$this_target_name") {
Daniel.L (Byoungchan Lee)32026ed2020-10-16 22:49:281076 sources = get_target_outputs(
1077 ":create_bracket_include_headers_$this_target_name")
Anders Carlsson37bbf792018-09-05 14:29:271078
1079 script = "//tools_webrtc/ios/generate_umbrella_header.py"
1080
Mirko Bonadeiccbe95f2020-01-21 11:10:101081 outputs = [ umbrella_header_path ]
Anders Carlsson37bbf792018-09-05 14:29:271082 args = [
1083 "--out",
1084 rebase_path(umbrella_header_path, root_build_dir),
1085 "--sources",
1086 ] + sources
Daniel.L (Byoungchan Lee)32026ed2020-10-16 22:49:281087 deps = [ ":create_bracket_include_headers_$this_target_name" ]
Anders Carlsson37bbf792018-09-05 14:29:271088 }
1089
Anders Carlsson95c56ee2018-09-06 13:48:171090 bundle_data("copy_umbrella_header_$this_target_name") {
Mirko Bonadeiccbe95f2020-01-21 11:10:101091 sources = [ umbrella_header_path ]
1092 outputs = [ "{{bundle_contents_dir}}/Headers/$output_name.h" ]
Anders Carlsson37bbf792018-09-05 14:29:271093
Mirko Bonadeiccbe95f2020-01-21 11:10:101094 deps = [ ":umbrella_header_$this_target_name" ]
Anders Carlsson37bbf792018-09-05 14:29:271095 }
1096 }
1097}
1098
Mirko Bonadeifbb3b7d2017-11-07 15:36:331099if (is_android) {
1100 template("rtc_android_library") {
1101 android_library(target_name) {
1102 forward_variables_from(invoker,
1103 "*",
1104 [
1105 "configs",
1106 "public_configs",
1107 "suppressed_configs",
1108 "visibility",
1109 ])
1110
Oleh Prypin05aee742018-11-23 16:29:441111 errorprone_args = []
Sami Kalliomäkie7fac682018-03-20 15:32:491112
Mirko Bonadeifbb3b7d2017-11-07 15:36:331113 # Treat warnings as errors.
Oleh Prypin05aee742018-11-23 16:29:441114 errorprone_args += [ "-Werror" ]
Sami Kalliomäkie7fac682018-03-20 15:32:491115
1116 # Add any arguments defined by the invoker.
Oleh Prypin05aee742018-11-23 16:29:441117 if (defined(invoker.errorprone_args)) {
1118 errorprone_args += invoker.errorprone_args
Sami Kalliomäkie7fac682018-03-20 15:32:491119 }
Mirko Bonadeifbb3b7d2017-11-07 15:36:331120
Sami Kalliomäkidc526512018-03-27 15:07:271121 if (!defined(deps)) {
1122 deps = []
1123 }
Sami Kalliomäkidc526512018-03-27 15:07:271124
Mirko Bonadeifbb3b7d2017-11-07 15:36:331125 no_build_hooks = true
Mirko Bonadei8b7cfa12020-06-03 19:23:411126 not_needed([ "android_manifest" ])
Mirko Bonadeifbb3b7d2017-11-07 15:36:331127 }
1128 }
1129
1130 template("rtc_android_apk") {
1131 android_apk(target_name) {
1132 forward_variables_from(invoker,
1133 "*",
1134 [
1135 "configs",
1136 "public_configs",
1137 "suppressed_configs",
1138 "visibility",
1139 ])
1140
1141 # Treat warnings as errors.
Yves Gerey2f385d22019-11-20 11:10:081142 errorprone_args = []
1143 errorprone_args += [ "-Werror" ]
Sami Kalliomäkidc526512018-03-27 15:07:271144
1145 if (!defined(deps)) {
1146 deps = []
1147 }
Sami Kalliomäkidc526512018-03-27 15:07:271148
Mirko Bonadeifbb3b7d2017-11-07 15:36:331149 no_build_hooks = true
1150 }
1151 }
1152
1153 template("rtc_instrumentation_test_apk") {
1154 instrumentation_test_apk(target_name) {
1155 forward_variables_from(invoker,
1156 "*",
1157 [
1158 "configs",
1159 "public_configs",
1160 "suppressed_configs",
1161 "visibility",
1162 ])
1163
1164 # Treat warnings as errors.
Yves Gerey2f385d22019-11-20 11:10:081165 errorprone_args = []
1166 errorprone_args += [ "-Werror" ]
Sami Kalliomäkidc526512018-03-27 15:07:271167
1168 if (!defined(deps)) {
1169 deps = []
1170 }
Sami Kalliomäkidc526512018-03-27 15:07:271171
Mirko Bonadeifbb3b7d2017-11-07 15:36:331172 no_build_hooks = true
1173 }
1174 }
1175}