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