Bug 1795082 - Part 2/2: Drop post-processing from getURL() r=zombie
[gecko.git] / third_party / libwebrtc / BUILD.gn
blobef99dfb402d67ec465e0278f9ccc31981c338ed1
1 # Copyright (c) 2014 The WebRTC project authors. All Rights Reserved.
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.
9 # This is the root build file for GN. GN will start processing by loading this
10 # file, and recursively load all dependencies until all dependencies are either
11 # resolved or known not to exist (which will cause the build to fail). So if
12 # you add a new build file, there must be some path of dependencies from this
13 # file to your new one or GN won't know about it.
15 # Use of visibility = clauses:
16 # The default visibility for all rtc_ targets is equivalent to "//*", or
17 # "all targets in webrtc can depend on this, nothing outside can".
19 # When overriding, the choices are:
20 # - visibility = [ "*" ] - public. Stuff outside webrtc can use this.
21 # - visibility = [ ":*" ] - directory private.
22 # As a general guideline, only targets in api/ should have public visibility.
24 import("//build/config/linux/pkg_config.gni")
25 import("//build/config/sanitizers/sanitizers.gni")
26 import("webrtc.gni")
27 if (rtc_enable_protobuf) {
28   import("//third_party/protobuf/proto_library.gni")
30 if (is_android) {
31   import("//build/config/android/config.gni")
32   import("//build/config/android/rules.gni")
33   import("//third_party/jni_zero/jni_zero.gni")
36 if (!build_with_chromium && !build_with_mozilla) {
37   # This target should (transitively) cause everything to be built; if you run
38   # 'ninja default' and then 'ninja all', the second build should do no work.
39   group("default") {
40     testonly = true
41     deps = [ ":webrtc" ]
42     if (rtc_build_examples) {
43       deps += [ "examples" ]
44     }
45     if (rtc_build_tools) {
46       deps += [ "rtc_tools" ]
47     }
48     if (rtc_include_tests) {
49       deps += [
50         ":rtc_unittests",
51         ":video_engine_tests",
52         ":voip_unittests",
53         ":webrtc_nonparallel_tests",
54         ":webrtc_perf_tests",
55         "common_audio:common_audio_unittests",
56         "common_video:common_video_unittests",
57         "examples:examples_unittests",
58         "media:rtc_media_unittests",
59         "modules:modules_tests",
60         "modules:modules_unittests",
61         "modules/audio_coding:audio_coding_tests",
62         "modules/audio_processing:audio_processing_tests",
63         "modules/remote_bitrate_estimator:rtp_to_text",
64         "modules/rtp_rtcp:test_packet_masks_metrics",
65         "modules/video_capture:video_capture_internal_impl",
66         "modules/video_coding:video_codec_perf_tests",
67         "net/dcsctp:dcsctp_unittests",
68         "pc:peerconnection_unittests",
69         "pc:rtc_pc_unittests",
70         "pc:slow_peer_connection_unittests",
71         "pc:svc_tests",
72         "rtc_tools:rtp_generator",
73         "rtc_tools:video_encoder",
74         "rtc_tools:video_replay",
75         "stats:rtc_stats_unittests",
76         "system_wrappers:system_wrappers_unittests",
77         "test",
78         "video:screenshare_loopback",
79         "video:sv_loopback",
80         "video:video_loopback",
81       ]
82       if (!is_asan) {
83         # Do not build :webrtc_lib_link_test because lld complains on some OS
84         # (e.g. when target_os = "mac") when is_asan=true. For more details,
85         # see bugs.webrtc.org/11027#c5.
86         deps += [ ":webrtc_lib_link_test" ]
87       }
88       if (is_ios) {
89         deps += [
90           "examples:apprtcmobile_tests",
91           "sdk:sdk_framework_unittests",
92           "sdk:sdk_unittests",
93         ]
94       }
95       if (is_android) {
96         deps += [
97           "examples:android_examples_junit_tests",
98           "sdk/android:android_instrumentation_test_apk",
99           "sdk/android:android_sdk_junit_tests",
100         ]
101       } else {
102         deps += [ "modules/video_capture:video_capture_tests" ]
103       }
104       if (rtc_enable_protobuf) {
105         deps += [
106           "logging:rtc_event_log_rtp_dump",
107           "tools_webrtc/perf:webrtc_dashboard_upload",
108         ]
109       }
110       if ((is_linux || is_chromeos) && rtc_use_pipewire) {
111         deps += [ "modules/desktop_capture:shared_screencast_stream_test" ]
112       }
113     }
114     if (target_os == "android") {
115       deps += [ "tools_webrtc:binary_version_check" ]
116     }
117   }
120 # Abseil Flags by default doesn't register command line flags on mobile
121 # platforms, WebRTC tests requires them (e.g. on simualtors) so this
122 # config will be applied to testonly targets globally (see webrtc.gni).
123 config("absl_flags_configs") {
124   defines = [ "ABSL_FLAGS_STRIP_NAMES=0" ]
127 config("library_impl_config") {
128   # Build targets that contain WebRTC implementation need this macro to
129   # be defined in order to correctly export symbols when is_component_build
130   # is true.
131   # For more info see: rtc_base/build/rtc_export.h.
132   defines = [ "WEBRTC_LIBRARY_IMPL" ]
135 # Contains the defines and includes in common.gypi that are duplicated both as
136 # target_defaults and direct_dependent_settings.
137 config("common_inherited_config") {
138   defines = []
139   cflags = []
140   ldflags = []
142   if (rtc_jni_generator_legacy_symbols) {
143     defines += [ "RTC_JNI_GENERATOR_LEGACY_SYMBOLS" ]
144   }
146   if (rtc_objc_prefix != "") {
147     defines += [ "RTC_OBJC_TYPE_PREFIX=${rtc_objc_prefix}" ]
148   }
150   if (rtc_dlog_always_on) {
151     defines += [ "DLOG_ALWAYS_ON" ]
152   }
154   if (rtc_enable_symbol_export || is_component_build) {
155     defines += [ "WEBRTC_ENABLE_SYMBOL_EXPORT" ]
156   }
157   if (rtc_enable_objc_symbol_export) {
158     defines += [ "WEBRTC_ENABLE_OBJC_SYMBOL_EXPORT" ]
159   }
161   if (build_with_mozilla) {
162     defines += [ "WEBRTC_MOZILLA_BUILD" ]
163   }
165   if (!rtc_builtin_ssl_root_certificates) {
166     defines += [ "WEBRTC_EXCLUDE_BUILT_IN_SSL_ROOT_CERTS" ]
167   }
169   if (rtc_disable_check_msg) {
170     defines += [ "RTC_DISABLE_CHECK_MSG" ]
171   }
173   if (rtc_enable_avx2) {
174     defines += [ "WEBRTC_ENABLE_AVX2" ]
175   }
177   if (rtc_enable_win_wgc) {
178     defines += [ "RTC_ENABLE_WIN_WGC" ]
179   }
181   if (!rtc_use_perfetto) {
182     # Some tests need to declare their own trace event handlers. If this define is
183     # not set, the first time TRACE_EVENT_* is called it will store the return
184     # value for the current handler in an static variable, so that subsequent
185     # changes to the handler for that TRACE_EVENT_* will be ignored.
186     # So when tests are included, we set this define, making it possible to use
187     # different event handlers in different tests.
188     if (rtc_include_tests) {
189       defines += [ "WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS=1" ]
190     } else {
191       defines += [ "WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS=0" ]
192     }
193   }
194   if (build_with_chromium) {
195     defines += [ "WEBRTC_CHROMIUM_BUILD" ]
196     include_dirs = [
197       # The overrides must be included first as that is the mechanism for
198       # selecting the override headers in Chromium.
199       "../webrtc_overrides",
201       # Allow includes to be prefixed with webrtc/ in case it is not an
202       # immediate subdirectory of the top-level.
203       ".",
205       # Just like the root WebRTC directory is added to include path, the
206       # corresponding directory tree with generated files needs to be added too.
207       # Note: this path does not change depending on the current target, e.g.
208       # it is always "//gen/third_party/webrtc" when building with Chromium.
209       # See also: http://cs.chromium.org/?q=%5C"default_include_dirs
210       # https://gn.googlesource.com/gn/+/master/docs/reference.md#target_gen_dir
211       target_gen_dir,
212     ]
213   }
214   if (is_posix || is_fuchsia) {
215     defines += [ "WEBRTC_POSIX" ]
216   }
217   if (is_ios) {
218     defines += [
219       "WEBRTC_MAC",
220       "WEBRTC_IOS",
221     ]
222   }
223   if (is_linux || is_chromeos) {
224     defines += [ "WEBRTC_LINUX" ]
225   }
226   if (is_bsd) {
227     defines += [ "WEBRTC_BSD" ]
228   }
229   if (is_mac) {
230     defines += [ "WEBRTC_MAC" ]
231   }
232   if (is_fuchsia) {
233     defines += [ "WEBRTC_FUCHSIA" ]
234   }
235   if (is_win) {
236     defines += [ "WEBRTC_WIN" ]
237   }
238   if (is_android) {
239     defines += [
240       "WEBRTC_LINUX",
241       "WEBRTC_ANDROID",
242     ]
244     if (build_with_mozilla) {
245       defines += [ "WEBRTC_ANDROID_OPENSLES" ]
246     }
247   }
248   if (is_chromeos) {
249     defines += [ "CHROMEOS" ]
250   }
252   if (rtc_sanitize_coverage != "") {
253     assert(is_clang, "sanitizer coverage requires clang")
254     cflags += [ "-fsanitize-coverage=${rtc_sanitize_coverage}" ]
255     ldflags += [ "-fsanitize-coverage=${rtc_sanitize_coverage}" ]
256   }
258   if (is_ubsan) {
259     cflags += [ "-fsanitize=float-cast-overflow" ]
260   }
263 # TODO(bugs.webrtc.org/9693): Remove the possibility to suppress this warning
264 # as soon as WebRTC compiles without it.
265 config("no_global_constructors") {
266   if (is_clang) {
267     cflags = [ "-Wno-global-constructors" ]
268   }
271 config("rtc_prod_config") {
272   # Ideally, WebRTC production code (but not test code) should have these flags.
273   if (is_clang) {
274     cflags = [
275       "-Wexit-time-destructors",
276       "-Wglobal-constructors",
277     ]
278   }
281 group("tracing") {
282 if (!build_with_mozilla) {
283   all_dependent_configs = [ "//third_party/perfetto/gn:public_config" ]
284   if (rtc_use_perfetto) {
285     if (build_with_chromium) {
286       public_deps =  # no-presubmit-check TODO(webrtc:8603)
287           [ "//third_party/perfetto:libperfetto" ]
288     } else {
289       public_deps = [  # no-presubmit-check TODO(webrtc:8603)
290         ":webrtc_libperfetto",
291         "//third_party/perfetto/include/perfetto/tracing",
292       ]
293     }
294   } else {
295     public_deps =  # no-presubmit-check TODO(webrtc:8603)
296         [ "//third_party/perfetto/include/perfetto/tracing" ]
297   }
301 if (rtc_use_perfetto) {
302   rtc_library("webrtc_libperfetto") {
303     deps = [
304       "//third_party/perfetto/src/tracing:client_api_without_backends",
305       "//third_party/perfetto/src/tracing:platform_impl",
306     ]
307   }
310 config("common_config") {
311   cflags = []
312   cflags_c = []
313   cflags_cc = []
314   cflags_objc = []
315   defines = []
317   if (rtc_enable_protobuf) {
318     defines += [ "WEBRTC_ENABLE_PROTOBUF=1" ]
319   } else {
320     defines += [ "WEBRTC_ENABLE_PROTOBUF=0" ]
321   }
323   if (rtc_strict_field_trials == "") {
324     defines += [ "WEBRTC_STRICT_FIELD_TRIALS=0" ]
325   } else if (rtc_strict_field_trials == "dcheck") {
326     defines += [ "WEBRTC_STRICT_FIELD_TRIALS=1" ]
327   } else if (rtc_strict_field_trials == "warn") {
328     defines += [ "WEBRTC_STRICT_FIELD_TRIALS=2" ]
329   } else {
330     assert(false,
331            "Unsupported value for rtc_strict_field_trials: " +
332                "$rtc_strict_field_trials")
333   }
335   if (rtc_include_internal_audio_device) {
336     defines += [ "WEBRTC_INCLUDE_INTERNAL_AUDIO_DEVICE" ]
337   }
339   if (rtc_libvpx_build_vp9) {
340     defines += [ "RTC_ENABLE_VP9" ]
341   }
343   if (rtc_use_h265) {
344     defines += [ "RTC_ENABLE_H265" ]
345   }
347   if (rtc_include_dav1d_in_internal_decoder_factory) {
348     defines += [ "RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY" ]
349   }
351   if (rtc_enable_sctp) {
352     defines += [ "WEBRTC_HAVE_SCTP" ]
353   }
355   if (rtc_enable_external_auth) {
356     defines += [ "ENABLE_EXTERNAL_AUTH" ]
357   }
359   if (rtc_use_h264) {
360     defines += [ "WEBRTC_USE_H264" ]
361   }
363   if (rtc_use_absl_mutex) {
364     defines += [ "WEBRTC_ABSL_MUTEX" ]
365   }
367   if (rtc_enable_libevent) {
368     defines += [ "WEBRTC_ENABLE_LIBEVENT" ]
369   }
371   if (rtc_disable_logging) {
372     defines += [ "RTC_DISABLE_LOGGING" ]
373   }
375   if (rtc_disable_trace_events) {
376     defines += [ "RTC_DISABLE_TRACE_EVENTS" ]
377   }
379   if (rtc_disable_metrics) {
380     defines += [ "RTC_DISABLE_METRICS" ]
381   }
383   if (rtc_exclude_transient_suppressor) {
384     defines += [ "WEBRTC_EXCLUDE_TRANSIENT_SUPPRESSOR" ]
385   }
387   if (rtc_exclude_audio_processing_module) {
388     defines += [ "WEBRTC_EXCLUDE_AUDIO_PROCESSING_MODULE" ]
389   }
391   if (is_clang) {
392     cflags += [
393       # TODO(webrtc:13219): Fix -Wshadow instances and enable.
394       "-Wno-shadow",
396       # See https://reviews.llvm.org/D56731 for details about this
397       # warning.
398       "-Wctad-maybe-unsupported",
399     ]
400   }
402   if (build_with_chromium) {
403     defines += [
404       # NOTICE: Since common_inherited_config is used in public_configs for our
405       # targets, there's no point including the defines in that config here.
406       # TODO(kjellander): Cleanup unused ones and move defines closer to the
407       # source when webrtc:4256 is completed.
408       "HAVE_WEBRTC_VIDEO",
409       "LOGGING_INSIDE_WEBRTC",
410     ]
411   } else {
412     if (is_posix || is_fuchsia) {
413       cflags_c += [
414         # TODO(bugs.webrtc.org/9029): enable commented compiler flags.
415         # Some of these flags should also be added to cflags_objc.
417         # "-Wextra",  (used when building C++ but not when building C)
418         # "-Wmissing-prototypes",  (C/Obj-C only)
419         # "-Wmissing-declarations",  (ensure this is always used C/C++, etc..)
420         "-Wstrict-prototypes",
422         # "-Wpointer-arith",  (ensure this is always used C/C++, etc..)
423         # "-Wbad-function-cast",  (C/Obj-C only)
424         # "-Wnested-externs",  (C/Obj-C only)
425       ]
426       cflags_objc += [ "-Wstrict-prototypes" ]
427       cflags_cc = [
428         "-Wnon-virtual-dtor",
430         # This is enabled for clang; enable for gcc as well.
431         "-Woverloaded-virtual",
432       ]
433     }
435     if (is_clang) {
436       cflags += [ "-Wc++11-narrowing" ]
438       if (!is_fuchsia) {
439         # Compiling with the Fuchsia SDK results in Wundef errors
440         # TODO(bugs.fuchsia.dev/100722): Remove from (!is_fuchsia) branch when
441         # Fuchsia build errors are fixed.
442         cflags += [ "-Wundef" ]
443       }
445       if (!is_nacl) {
446         # Flags NaCl (Clang 3.7) do not recognize.
447         cflags += [ "-Wunused-lambda-capture" ]
448       }
449     }
451     if (is_win && !is_clang) {
452       # MSVC warning suppressions (needed to use Abseil).
453       # TODO(bugs.webrtc.org/9274): Remove these warnings as soon as MSVC allows
454       # external headers warning suppression (or fix them upstream).
455       cflags += [ "/wd4702" ]  # unreachable code
457       # MSVC 2019 warning suppressions for C++17 compiling
458       cflags +=
459           [ "/wd5041" ]  # out-of-line definition for constexpr static data
460                          # member is not needed and is deprecated in C++17
461     }
462   }
464   if (target_cpu == "arm64") {
465     defines += [ "WEBRTC_ARCH_ARM64" ]
466     defines += [ "WEBRTC_HAS_NEON" ]
467   }
469   if (target_cpu == "arm") {
470     defines += [ "WEBRTC_ARCH_ARM" ]
471     if (arm_version >= 7) {
472       defines += [ "WEBRTC_ARCH_ARM_V7" ]
473       if (arm_use_neon) {
474         defines += [ "WEBRTC_HAS_NEON" ]
475       }
476     }
477   }
479   if (target_cpu == "mipsel") {
480     defines += [ "MIPS32_LE" ]
481     if (mips_float_abi == "hard") {
482       defines += [ "MIPS_FPU_LE" ]
483     }
484     if (mips_arch_variant == "r2") {
485       defines += [ "MIPS32_R2_LE" ]
486     }
487     if (mips_dsp_rev == 1) {
488       defines += [ "MIPS_DSP_R1_LE" ]
489     } else if (mips_dsp_rev == 2) {
490       defines += [
491         "MIPS_DSP_R1_LE",
492         "MIPS_DSP_R2_LE",
493       ]
494     }
495   }
497   if (is_android && !is_clang) {
498     # The Android NDK doesn"t provide optimized versions of these
499     # functions. Ensure they are disabled for all compilers.
500     cflags += [
501       "-fno-builtin-cos",
502       "-fno-builtin-sin",
503       "-fno-builtin-cosf",
504       "-fno-builtin-sinf",
505     ]
506   }
508   if (use_fuzzing_engine) {
509     # Used in Chromium's overrides to disable logging
510     defines += [ "WEBRTC_UNSAFE_FUZZER_MODE" ]
511   }
513   if (!build_with_chromium && rtc_win_undef_unicode) {
514     cflags += [
515       "/UUNICODE",
516       "/U_UNICODE",
517     ]
518   }
520   if (rtc_use_perfetto) {
521     defines += [ "RTC_USE_PERFETTO" ]
522   }
525 if (is_mac) {
526 config("common_objc") {
527   frameworks = [ "Foundation.framework" ]
531 if (!build_with_chromium) {
532   # Target to build all the WebRTC production code.
533   rtc_static_library("webrtc") {
534     # Only the root target and the test should depend on this.
535     visibility = [
536       "//:default",
537       "//:webrtc_lib_link_test",
538     ]
540     sources = []
541     complete_static_lib = true
542     suppressed_configs += [ "//build/config/compiler:thin_archive" ]
543     defines = []
545     deps = [
546       "api:create_peerconnection_factory",
547       "api:enable_media",
548       "api:libjingle_peerconnection_api",
549       "api:rtc_error",
550       "api:transport_api",
551       "api/crypto",
552       "api/rtc_event_log:rtc_event_log_factory",
553       "api/task_queue",
554       "api/task_queue:default_task_queue_factory",
555       "api/test/metrics",
556       "api/video_codecs:video_decoder_factory_template",
557       "api/video_codecs:video_decoder_factory_template_dav1d_adapter",
558       "api/video_codecs:video_decoder_factory_template_libvpx_vp8_adapter",
559       "api/video_codecs:video_decoder_factory_template_libvpx_vp9_adapter",
560       "api/video_codecs:video_decoder_factory_template_open_h264_adapter",
561       "api/video_codecs:video_encoder_factory_template",
562       "api/video_codecs:video_encoder_factory_template_libaom_av1_adapter",
563       "api/video_codecs:video_encoder_factory_template_libvpx_vp8_adapter",
564       "api/video_codecs:video_encoder_factory_template_libvpx_vp9_adapter",
565       "api/video_codecs:video_encoder_factory_template_open_h264_adapter",
566       "audio",
567       "call",
568       "common_audio",
569       "common_video",
570       "logging:rtc_event_log_api",
571       "media",
572       "modules",
573       "modules/video_capture:video_capture_internal_impl",
574       "p2p:rtc_p2p",
575       "pc:libjingle_peerconnection",
576       "pc:rtc_pc",
577       "sdk",
578       "video",
579     ]
580     if (build_with_mozilla) {
581       deps -= [
582         "api:create_peerconnection_factory",
583         "api:enable_media",
584         "api:rtc_error",
585         "api:transport_api",
586         "api/crypto",
587         "api/rtc_event_log:rtc_event_log_factory",
588         "api/task_queue",
589         "api/task_queue:default_task_queue_factory",
590         "api/test/metrics",
591         "api/video_codecs:video_decoder_factory_template",
592         "api/video_codecs:video_decoder_factory_template_dav1d_adapter",
593         "api/video_codecs:video_decoder_factory_template_libvpx_vp8_adapter",
594         "api/video_codecs:video_decoder_factory_template_libvpx_vp9_adapter",
595         "api/video_codecs:video_decoder_factory_template_open_h264_adapter",
596         "api/video_codecs:video_encoder_factory_template",
597         "api/video_codecs:video_encoder_factory_template_libaom_av1_adapter",
598         "api/video_codecs:video_encoder_factory_template_libvpx_vp8_adapter",
599         "api/video_codecs:video_encoder_factory_template_libvpx_vp9_adapter",
600         "api/video_codecs:video_encoder_factory_template_open_h264_adapter",
601         "logging:rtc_event_log_api",
602         "p2p:rtc_p2p",
603         "pc:libjingle_peerconnection",
604         "pc:rtc_pc",
605         "sdk",
606       ]
607     }
609     if (rtc_include_builtin_audio_codecs) {
610       deps += [
611         "api/audio_codecs:builtin_audio_decoder_factory",
612         "api/audio_codecs:builtin_audio_encoder_factory",
613       ]
614     }
616     if (build_with_mozilla) {
617       deps += [
618         "api/environment:environment_factory",
619         "api/video:video_frame",
620         "api/video:video_rtp_headers",
621         "test:rtp_test_utils",
622       ]
623       # Added when we removed deps in other places to avoid building
624       # unreachable sources.  See Bug 1820869.
625       deps += [
626         "api/video_codecs:video_codecs_api",
627         "api/video_codecs:rtc_software_fallback_wrappers",
628         "media:rtc_simulcast_encoder_adapter",
629         "modules/video_coding:webrtc_vp8",
630         "modules/video_coding:webrtc_vp9",
631       ]
632     } else {
633       deps += [
634         "api",
635         "logging",
636         "p2p",
637         "pc",
638         "stats",
639       ]
640     }
642     if (build_with_mozilla && is_mac) {
643       deps += [ "sdk:videocapture_objc" ]
644     }
646     if (rtc_enable_protobuf) {
647       deps += [ "logging:rtc_event_log_proto" ]
648     }
649   }
651   if (rtc_include_tests && !is_asan) {
652     rtc_executable("webrtc_lib_link_test") {
653       testonly = true
655       # This target is used for checking to link, so do not check dependencies
656       # on gn check.
657       check_includes = false  # no-presubmit-check TODO(bugs.webrtc.org/12785)
659       sources = [ "webrtc_lib_link_test.cc" ]
660       deps = [
661         # NOTE: Don't add deps here. If this test fails to link, it means you
662         # need to add stuff to the webrtc static lib target above.
663         ":webrtc",
664       ]
665     }
666   }
669 if (use_libfuzzer || use_afl) {
670   # This target is only here for gn to discover fuzzer build targets under
671   # webrtc/test/fuzzers/.
672   group("webrtc_fuzzers_dummy") {
673     testonly = true
674     deps = [ "test/fuzzers:webrtc_fuzzer_main" ]
675   }
678 if (rtc_include_tests && !build_with_chromium) {
679   rtc_unittests_resources = [ "resources/reference_video_640x360_30fps.y4m" ]
681   if (is_ios) {
682     bundle_data("rtc_unittests_bundle_data") {
683       testonly = true
684       sources = rtc_unittests_resources
685       outputs = [ "{{bundle_resources_dir}}/{{source_file_part}}" ]
686     }
687   }
689   rtc_test("rtc_unittests") {
690     testonly = true
692     deps = [
693       "api:compile_all_headers",
694       "api:rtc_api_unittests",
695       "api/audio/test:audio_api_unittests",
696       "api/audio_codecs/test:audio_codecs_api_unittests",
697       "api/numerics:numerics_unittests",
698       "api/task_queue:pending_task_safety_flag_unittests",
699       "api/test/metrics:metrics_unittests",
700       "api/transport:stun_unittest",
701       "api/video/test:rtc_api_video_unittests",
702       "api/video_codecs:libaom_av1_encoder_factory_test",
703       "api/video_codecs:simple_encoder_wrapper_unittests",
704       "api/video_codecs/test:video_codecs_api_unittests",
705       "api/voip:compile_all_headers",
706       "call:fake_network_pipe_unittests",
707       "p2p:libstunprober_unittests",
708       "p2p:rtc_p2p_unittests",
709       "rtc_base:async_dns_resolver_unittests",
710       "rtc_base:async_packet_socket_unittest",
711       "rtc_base:callback_list_unittests",
712       "rtc_base:rtc_base_approved_unittests",
713       "rtc_base:rtc_base_unittests",
714       "rtc_base:rtc_json_unittests",
715       "rtc_base:rtc_numerics_unittests",
716       "rtc_base:rtc_operations_chain_unittests",
717       "rtc_base:rtc_task_queue_unittests",
718       "rtc_base:sigslot_unittest",
719       "rtc_base:task_queue_stdlib_unittest",
720       "rtc_base:untyped_function_unittest",
721       "rtc_base:weak_ptr_unittests",
722       "rtc_base/experiments:experiments_unittests",
723       "rtc_base/system:file_wrapper_unittests",
724       "rtc_base/task_utils:repeating_task_unittests",
725       "rtc_base/units:units_unittests",
726       "sdk:sdk_tests",
727       "test:rtp_test_utils",
728       "test:test_main",
729       "test/network:network_emulation_unittests",
730     ]
732     data = rtc_unittests_resources
734     if (rtc_enable_protobuf) {
735       deps += [ "logging:rtc_event_log_tests" ]
736     }
738     if (is_ios) {
739       deps += [ ":rtc_unittests_bundle_data" ]
740     }
742     if (is_android) {
743       # Do not use Chromium's launcher. native_unittests defines its own JNI_OnLoad.
744       use_default_launcher = false
746       deps += [
747         "sdk/android:native_unittests",
748         "sdk/android:native_unittests_java",
749         "//testing/android/native_test:native_test_support",
750       ]
751       shard_timeout = 900
752     }
753   }
755   if (rtc_enable_google_benchmarks) {
756     rtc_test("benchmarks") {
757       testonly = true
758       deps = [
759         "rtc_base/synchronization:mutex_benchmark",
760         "test:benchmark_main",
761       ]
762     }
763   }
765   # TODO(pbos): Rename test suite, this is no longer "just" for video targets.
766   video_engine_tests_resources = [
767     "resources/foreman_cif_short.yuv",
768     "resources/voice_engine/audio_long16.pcm",
769   ]
771   if (is_ios) {
772     bundle_data("video_engine_tests_bundle_data") {
773       testonly = true
774       sources = video_engine_tests_resources
775       outputs = [ "{{bundle_resources_dir}}/{{source_file_part}}" ]
776     }
777   }
779   rtc_test("video_engine_tests") {
780     testonly = true
781     deps = [
782       "audio:audio_tests",
784       # TODO(eladalon): call_tests aren't actually video-specific, so we
785       # should move them to a more appropriate test suite.
786       "call:call_tests",
787       "call/adaptation:resource_adaptation_tests",
788       "test:test_common",
789       "test:test_main",
790       "test:video_test_common",
791       "video:video_tests",
792       "video/adaptation:video_adaptation_tests",
793     ]
794     data = video_engine_tests_resources
795     if (is_android) {
796       use_default_launcher = false
797       deps += [
798         "//build/android/gtest_apk:native_test_instrumentation_test_runner_java",
799         "//testing/android/native_test:native_test_java",
800         "//testing/android/native_test:native_test_support",
801       ]
802       shard_timeout = 900
803     }
804     if (is_ios) {
805       deps += [ ":video_engine_tests_bundle_data" ]
806     }
807   }
809   webrtc_perf_tests_resources = [
810     "resources/ConferenceMotion_1280_720_50.yuv",
811     "resources/audio_coding/speech_mono_16kHz.pcm",
812     "resources/audio_coding/speech_mono_32_48kHz.pcm",
813     "resources/audio_coding/testfile32kHz.pcm",
814     "resources/difficult_photo_1850_1110.yuv",
815     "resources/foreman_cif.yuv",
816     "resources/paris_qcif.yuv",
817     "resources/photo_1850_1110.yuv",
818     "resources/presentation_1850_1110.yuv",
819     "resources/voice_engine/audio_long16.pcm",
820     "resources/web_screenshot_1850_1110.yuv",
821   ]
823   if (is_ios) {
824     bundle_data("webrtc_perf_tests_bundle_data") {
825       testonly = true
826       sources = webrtc_perf_tests_resources
827       outputs = [ "{{bundle_resources_dir}}/{{source_file_part}}" ]
828     }
829   }
831   rtc_test("webrtc_perf_tests") {
832     testonly = true
833     deps = [
834       "call:call_perf_tests",
835       "modules/audio_coding:audio_coding_perf_tests",
836       "modules/audio_processing:audio_processing_perf_tests",
837       "pc:peerconnection_perf_tests",
838       "test:test_main",
839       "video:video_full_stack_tests",
840       "video:video_pc_full_stack_tests",
841     ]
843     data = webrtc_perf_tests_resources
844     if (is_android) {
845       use_default_launcher = false
846       deps += [
847         "//build/android/gtest_apk:native_test_instrumentation_test_runner_java",
848         "//testing/android/native_test:native_test_java",
849         "//testing/android/native_test:native_test_support",
850       ]
851       shard_timeout = 4500
852     }
853     if (is_ios) {
854       deps += [ ":webrtc_perf_tests_bundle_data" ]
855     }
856   }
858   rtc_test("webrtc_nonparallel_tests") {
859     testonly = true
860     deps = [ "rtc_base:rtc_base_nonparallel_tests" ]
861     if (is_android) {
862       deps += [ "//testing/android/native_test:native_test_support" ]
863       shard_timeout = 900
864     }
865   }
867   rtc_test("voip_unittests") {
868     testonly = true
869     deps = [
870       "api/voip:compile_all_headers",
871       "api/voip:voip_engine_factory_unittests",
872       "audio/voip/test:audio_channel_unittests",
873       "audio/voip/test:audio_egress_unittests",
874       "audio/voip/test:audio_ingress_unittests",
875       "audio/voip/test:voip_core_unittests",
876       "test:test_main",
877     ]
878   }
881 # Build target for standalone dcsctp
882 rtc_static_library("dcsctp") {
883   # Only the root target should depend on this.
884   visibility = [ "//:default" ]
885   sources = []
886   complete_static_lib = true
887   suppressed_configs += [ "//build/config/compiler:thin_archive" ]
888   defines = []
889   deps = [
890     "net/dcsctp/public:factory",
891     "net/dcsctp/public:socket",
892     "net/dcsctp/public:types",
893     "net/dcsctp/socket:dcsctp_socket",
894     "net/dcsctp/timer:task_queue_timeout",
895   ]
898 # ---- Poisons ----
900 # Here is one empty dummy target for each poison type (needed because
901 # "being poisonous with poison type foo" is implemented as "depends on
902 # //:poison_foo").
904 # The set of poison_* targets needs to be kept in sync with the
905 # `all_poison_types` list in webrtc.gni.
907 group("poison_audio_codecs") {
910 group("poison_default_echo_detector") {
913 group("poison_environment_construction") {
916 group("poison_software_video_codecs") {