blob: 23ce0f07b309c6cd7964503d3a3b234ee88b305f [file] [log] [blame]
wjia@webrtc.org03cfde22014-01-14 17:48:34 +00001# 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.
8
Patrik Höglund29dd6d72017-12-01 11:35:26 +01009# 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.
14
Mirko Bonadeibb547202017-09-15 06:15:48 +020015import("//build/config/linux/pkg_config.gni")
16import("//build/config/sanitizers/sanitizers.gni")
17import("webrtc.gni")
Kimmo Kinnunen08f6a6c2019-02-26 11:46:17 +020018if (rtc_enable_protobuf) {
Dan Minor9c686132018-01-15 10:20:00 -050019 import("//third_party/protobuf/proto_library.gni")
20}
Mirko Bonadeibb547202017-09-15 06:15:48 +020021if (is_android) {
22 import("//build/config/android/config.gni")
23 import("//build/config/android/rules.gni")
24}
ehmaldonado37d7a222016-11-08 06:34:20 -080025
Mirko Bonadeibb547202017-09-15 06:15:48 +020026if (!build_with_chromium) {
Patrik Höglund29dd6d72017-12-01 11:35:26 +010027 # This target should (transitively) cause everything to be built; if you run
28 # 'ninja default' and then 'ninja all', the second build should do no work.
Mirko Bonadeibb547202017-09-15 06:15:48 +020029 group("default") {
30 testonly = true
31 deps = [
32 ":webrtc",
Mirko Bonadeibb547202017-09-15 06:15:48 +020033 ]
Joachim Bauch93e91342017-12-07 01:25:53 +010034 if (rtc_build_examples) {
35 deps += [ "examples" ]
36 }
37 if (rtc_build_tools) {
38 deps += [ "rtc_tools" ]
39 }
Mirko Bonadeibb547202017-09-15 06:15:48 +020040 if (rtc_include_tests) {
Patrik Höglund29dd6d72017-12-01 11:35:26 +010041 deps += [
42 ":rtc_unittests",
Sebastian Jansson449c1c02018-10-22 17:18:46 +020043 ":slow_tests",
Patrik Höglund29dd6d72017-12-01 11:35:26 +010044 ":video_engine_tests",
45 ":webrtc_nonparallel_tests",
46 ":webrtc_perf_tests",
47 "common_audio:common_audio_unittests",
48 "common_video:common_video_unittests",
Niels Möller9862c2e2018-10-30 12:20:03 +010049 "examples:examples_unittests",
Patrik Höglund29dd6d72017-12-01 11:35:26 +010050 "media:rtc_media_unittests",
51 "modules:modules_tests",
52 "modules:modules_unittests",
53 "modules/audio_coding:audio_coding_tests",
54 "modules/audio_processing:audio_processing_tests",
Patrik Höglund29dd6d72017-12-01 11:35:26 +010055 "modules/rtp_rtcp:test_packet_masks_metrics",
56 "modules/video_capture:video_capture_internal_impl",
Patrik Höglund29dd6d72017-12-01 11:35:26 +010057 "pc:peerconnection_unittests",
58 "pc:rtc_pc_unittests",
Patrik Höglund29dd6d72017-12-01 11:35:26 +010059 "stats:rtc_stats_unittests",
60 "system_wrappers:system_wrappers_unittests",
61 "test",
62 "video:screenshare_loopback",
Ilya Nikolaevskiy255d1cd2017-12-21 18:02:59 +010063 "video:sv_loopback",
Patrik Höglund29dd6d72017-12-01 11:35:26 +010064 "video:video_loopback",
Patrik Höglund29dd6d72017-12-01 11:35:26 +010065 ]
66 if (is_android) {
67 deps += [
68 ":android_junit_tests",
Sami Kalliomäkid54f5f52018-08-03 13:23:05 +020069 "sdk/android:android_instrumentation_test_apk",
Patrik Höglund29dd6d72017-12-01 11:35:26 +010070 ]
71 } else {
72 deps += [ "modules/video_capture:video_capture_tests" ]
73 }
74 if (rtc_enable_protobuf) {
75 deps += [
76 "audio:low_bandwidth_audio_test",
77 "logging:rtc_event_log2rtp_dump",
78 ]
79 }
Mirko Bonadeibb547202017-09-15 06:15:48 +020080 }
81 }
82}
83
Mirko Bonadei32ce18c2018-09-18 13:15:54 +020084config("library_impl_config") {
85 # Build targets that contain WebRTC implementation need this macro to
86 # be defined in order to correctly export symbols when is_component_build
87 # is true.
88 # For more info see: rtc_base/build/rtc_export.h.
89 defines = [ "WEBRTC_LIBRARY_IMPL" ]
90}
91
Mirko Bonadeibb547202017-09-15 06:15:48 +020092# Contains the defines and includes in common.gypi that are duplicated both as
93# target_defaults and direct_dependent_settings.
94config("common_inherited_config") {
95 defines = []
96 cflags = []
97 ldflags = []
Mirko Bonadei32ce18c2018-09-18 13:15:54 +020098
Mirko Bonadei028248c2018-10-10 12:19:02 +020099 if (rtc_enable_symbol_export) {
100 defines = [ "WEBRTC_ENABLE_SYMBOL_EXPORT" ]
101 }
102
Mirko Bonadeibb547202017-09-15 06:15:48 +0200103 if (build_with_mozilla) {
104 defines += [ "WEBRTC_MOZILLA_BUILD" ]
105 }
106
Mirko Bonadeib889a202018-08-15 11:41:27 +0200107 if (!rtc_builtin_ssl_root_certificates) {
108 defines += [ "WEBRTC_EXCLUDE_BUILT_IN_SSL_ROOT_CERTS" ]
109 }
110
Mirko Bonadeibb547202017-09-15 06:15:48 +0200111 # Some tests need to declare their own trace event handlers. If this define is
112 # not set, the first time TRACE_EVENT_* is called it will store the return
113 # value for the current handler in an static variable, so that subsequent
114 # changes to the handler for that TRACE_EVENT_* will be ignored.
115 # So when tests are included, we set this define, making it possible to use
116 # different event handlers in different tests.
ehmaldonado37d7a222016-11-08 06:34:20 -0800117 if (rtc_include_tests) {
Mirko Bonadeibb547202017-09-15 06:15:48 +0200118 defines += [ "WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS=1" ]
119 } else {
120 defines += [ "WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS=0" ]
121 }
122 if (build_with_chromium) {
Mirko Bonadei8e5014a2018-08-02 13:36:10 +0200123 defines += [ "WEBRTC_CHROMIUM_BUILD" ]
Mirko Bonadeibb547202017-09-15 06:15:48 +0200124 include_dirs = [
125 # The overrides must be included first as that is the mechanism for
126 # selecting the override headers in Chromium.
127 "../webrtc_overrides",
128
129 # Allow includes to be prefixed with webrtc/ in case it is not an
130 # immediate subdirectory of the top-level.
131 ".",
Tomas Popela762543f2018-12-12 14:37:51 +0100132
133 # Just like the root WebRTC directory is added to include path, the
134 # corresponding directory tree with generated files needs to be added too.
135 # Note: this path does not change depending on the current target, e.g.
136 # it is always "//gen/third_party/webrtc" when building with Chromium.
137 # See also: http://cs.chromium.org/?q=%5C"default_include_dirs
138 # https://gn.googlesource.com/gn/+/master/docs/reference.md#target_gen_dir
139 target_gen_dir,
Mirko Bonadeibb547202017-09-15 06:15:48 +0200140 ]
141 }
Fabrice de Gans-Riberi09a6cd52018-03-30 10:38:06 -0700142 if (is_posix || is_fuchsia) {
Mirko Bonadeibb547202017-09-15 06:15:48 +0200143 defines += [ "WEBRTC_POSIX" ]
144 }
145 if (is_ios) {
146 defines += [
147 "WEBRTC_MAC",
148 "WEBRTC_IOS",
149 ]
150 }
151 if (is_linux) {
152 defines += [ "WEBRTC_LINUX" ]
153 }
154 if (is_mac) {
155 defines += [ "WEBRTC_MAC" ]
156 }
Sergey Ulanov6acefdb2017-12-11 17:38:13 -0800157 if (is_fuchsia) {
158 defines += [ "WEBRTC_FUCHSIA" ]
159 }
Mirko Bonadeibb547202017-09-15 06:15:48 +0200160 if (is_win) {
Mirko Bonadei89a87742018-04-24 09:12:13 +0200161 defines += [ "WEBRTC_WIN" ]
Mirko Bonadeibb547202017-09-15 06:15:48 +0200162 }
163 if (is_android) {
164 defines += [
165 "WEBRTC_LINUX",
166 "WEBRTC_ANDROID",
167 ]
Dan Minor9c686132018-01-15 10:20:00 -0500168
169 if (build_with_mozilla) {
170 defines += [ "WEBRTC_ANDROID_OPENSLES" ]
171 }
Mirko Bonadeibb547202017-09-15 06:15:48 +0200172 }
173 if (is_chromeos) {
174 defines += [ "CHROMEOS" ]
175 }
176
177 if (rtc_sanitize_coverage != "") {
178 assert(is_clang, "sanitizer coverage requires clang")
179 cflags += [ "-fsanitize-coverage=${rtc_sanitize_coverage}" ]
180 ldflags += [ "-fsanitize-coverage=${rtc_sanitize_coverage}" ]
181 }
182
183 if (is_ubsan) {
184 cflags += [ "-fsanitize=float-cast-overflow" ]
185 }
Mirko Bonadeibb547202017-09-15 06:15:48 +0200186}
187
Mirko Bonadei96ede162018-09-06 13:45:44 +0200188# TODO(bugs.webrtc.org/9693): Remove the possibility to suppress this warning
189# as soon as WebRTC compiles without it.
190config("no_exit_time_destructors") {
191 if (is_clang) {
192 cflags = [ "-Wno-exit-time-destructors" ]
193 }
194}
195
196# TODO(bugs.webrtc.org/9693): Remove the possibility to suppress this warning
197# as soon as WebRTC compiles without it.
198config("no_global_constructors") {
199 if (is_clang) {
200 cflags = [ "-Wno-global-constructors" ]
201 }
202}
203
204config("rtc_prod_config") {
205 # Ideally, WebRTC production code (but not test code) should have these flags.
206 if (is_clang) {
207 cflags = [
208 "-Wexit-time-destructors",
209 "-Wglobal-constructors",
210 ]
211 }
212}
213
Mirko Bonadeibb547202017-09-15 06:15:48 +0200214config("common_config") {
215 cflags = []
Mirko Bonadeid7573562018-03-19 16:23:48 +0100216 cflags_c = []
Mirko Bonadeibb547202017-09-15 06:15:48 +0200217 cflags_cc = []
Mirko Bonadeid7573562018-03-19 16:23:48 +0100218 cflags_objc = []
Mirko Bonadeibb547202017-09-15 06:15:48 +0200219 defines = []
220
221 if (rtc_enable_protobuf) {
222 defines += [ "WEBRTC_ENABLE_PROTOBUF=1" ]
223 } else {
224 defines += [ "WEBRTC_ENABLE_PROTOBUF=0" ]
225 }
226
Mirko Bonadeibb547202017-09-15 06:15:48 +0200227 if (rtc_include_internal_audio_device) {
228 defines += [ "WEBRTC_INCLUDE_INTERNAL_AUDIO_DEVICE" ]
229 }
230
Mirko Bonadei8ef57932018-11-16 14:38:03 +0100231 if (rtc_libvpx_build_vp9) {
232 defines += [ "RTC_ENABLE_VP9" ]
Mirko Bonadeibb547202017-09-15 06:15:48 +0200233 }
234
235 if (rtc_enable_sctp) {
236 defines += [ "HAVE_SCTP" ]
237 }
238
239 if (rtc_enable_external_auth) {
240 defines += [ "ENABLE_EXTERNAL_AUTH" ]
241 }
242
Johannes Kronb76b9ba2019-02-08 10:13:25 +0100243 if (rtc_use_h264) {
244 defines += [ "WEBRTC_USE_H264" ]
245 }
246
Mirko Bonadeibb547202017-09-15 06:15:48 +0200247 if (build_with_chromium) {
248 defines += [
249 # NOTICE: Since common_inherited_config is used in public_configs for our
250 # targets, there's no point including the defines in that config here.
251 # TODO(kjellander): Cleanup unused ones and move defines closer to the
252 # source when webrtc:4256 is completed.
253 "HAVE_WEBRTC_VIDEO",
Mirko Bonadeibb547202017-09-15 06:15:48 +0200254 "LOGGING_INSIDE_WEBRTC",
Mirko Bonadeibb547202017-09-15 06:15:48 +0200255 ]
256 } else {
Fabrice de Gans-Riberi09a6cd52018-03-30 10:38:06 -0700257 if (is_posix || is_fuchsia) {
Mirko Bonadeibb547202017-09-15 06:15:48 +0200258 # Enable more warnings: -Wextra is currently disabled in Chromium.
259 cflags = [
260 "-Wextra",
261
262 # Repeat some flags that get overridden by -Wextra.
263 "-Wno-unused-parameter",
264 "-Wno-missing-field-initializers",
Mirko Bonadeibb547202017-09-15 06:15:48 +0200265 ]
Mirko Bonadeid7573562018-03-19 16:23:48 +0100266 cflags_c += [
267 # TODO(bugs.webrtc.org/9029): enable commented compiler flags.
268 # Some of these flags should also be added to cflags_objc.
269
270 # "-Wextra", (used when building C++ but not when building C)
271 # "-Wmissing-prototypes", (C/Obj-C only)
272 # "-Wmissing-declarations", (ensure this is always used C/C++, etc..)
273 "-Wstrict-prototypes",
274
275 # "-Wpointer-arith", (ensure this is always used C/C++, etc..)
276 # "-Wbad-function-cast", (C/Obj-C only)
277 # "-Wnested-externs", (C/Obj-C only)
278 ]
279 cflags_objc += [ "-Wstrict-prototypes" ]
Mirko Bonadeibb547202017-09-15 06:15:48 +0200280 cflags_cc = [
281 "-Wnon-virtual-dtor",
282
283 # This is enabled for clang; enable for gcc as well.
284 "-Woverloaded-virtual",
285 ]
286 }
287
288 if (is_clang) {
289 cflags += [
290 "-Wc++11-narrowing",
291 "-Wimplicit-fallthrough",
292 "-Wthread-safety",
293 "-Winconsistent-missing-override",
294 "-Wundef",
295 ]
296
297 # use_xcode_clang only refers to the iOS toolchain, host binaries use
298 # chromium's clang always.
299 if (!is_nacl &&
300 (!use_xcode_clang || current_toolchain == host_toolchain)) {
301 # Flags NaCl (Clang 3.7) and Xcode 7.3 (Clang clang-703.0.31) do not
302 # recognize.
303 cflags += [ "-Wunused-lambda-capture" ]
304 }
305 }
Mirko Bonadeie7659df2018-05-16 11:50:40 +0200306
307 if (is_win && !is_clang) {
308 # MSVC warning suppressions (needed to use Abseil).
309 # TODO(bugs.webrtc.org/9274): Remove these warnings as soon as MSVC allows
310 # external headers warning suppression (or fix them upstream).
311 cflags += [ "/wd4702" ] # unreachable code
312 }
Mirko Bonadeibb547202017-09-15 06:15:48 +0200313 }
314
315 if (current_cpu == "arm64") {
316 defines += [ "WEBRTC_ARCH_ARM64" ]
317 defines += [ "WEBRTC_HAS_NEON" ]
318 }
319
320 if (current_cpu == "arm") {
321 defines += [ "WEBRTC_ARCH_ARM" ]
322 if (arm_version >= 7) {
323 defines += [ "WEBRTC_ARCH_ARM_V7" ]
324 if (arm_use_neon) {
325 defines += [ "WEBRTC_HAS_NEON" ]
326 }
327 }
328 }
329
330 if (current_cpu == "mipsel") {
331 defines += [ "MIPS32_LE" ]
332 if (mips_float_abi == "hard") {
333 defines += [ "MIPS_FPU_LE" ]
334 }
335 if (mips_arch_variant == "r2") {
336 defines += [ "MIPS32_R2_LE" ]
337 }
338 if (mips_dsp_rev == 1) {
339 defines += [ "MIPS_DSP_R1_LE" ]
340 } else if (mips_dsp_rev == 2) {
341 defines += [
342 "MIPS_DSP_R1_LE",
343 "MIPS_DSP_R2_LE",
344 ]
345 }
346 }
347
348 if (is_android && !is_clang) {
349 # The Android NDK doesn"t provide optimized versions of these
350 # functions. Ensure they are disabled for all compilers.
351 cflags += [
352 "-fno-builtin-cos",
353 "-fno-builtin-sin",
354 "-fno-builtin-cosf",
355 "-fno-builtin-sinf",
356 ]
357 }
358
Max Moroza61fa6e2018-05-28 19:26:58 -0700359 if (use_fuzzing_engine && optimize_for_fuzzing) {
Mirko Bonadeibb547202017-09-15 06:15:48 +0200360 # Used in Chromium's overrides to disable logging
361 defines += [ "WEBRTC_UNSAFE_FUZZER_MODE" ]
362 }
Mirko Bonadei20574f42019-03-28 07:50:07 +0100363
364 if (!build_with_chromium && rtc_win_undef_unicode) {
365 cflags += [
366 "/UUNICODE",
367 "/U_UNICODE",
368 ]
369 }
Mirko Bonadeibb547202017-09-15 06:15:48 +0200370}
371
372config("common_objc") {
373 libs = [ "Foundation.framework" ]
Anders Carlsson7bca8ca2018-08-30 09:30:29 +0200374
375 if (rtc_use_metal_rendering) {
376 defines = [ "RTC_SUPPORTS_METAL" ]
377 }
Mirko Bonadeibb547202017-09-15 06:15:48 +0200378}
379
380if (!build_with_chromium) {
381 # Target to build all the WebRTC production code.
382 rtc_static_library("webrtc") {
383 # Only the root target should depend on this.
384 visibility = [ "//:default" ]
385
386 sources = []
387 complete_static_lib = true
Oleh Prypind2f4e8b2018-08-01 12:18:05 +0200388 suppressed_configs += [ "//build/config/compiler:thin_archive" ]
Mirko Bonadeibb547202017-09-15 06:15:48 +0200389 defines = []
390
391 deps = [
392 ":webrtc_common",
Yves Gerey06f6bc92018-11-09 10:22:52 +0100393 "api:libjingle_peerconnection_api",
Mirko Bonadeibb547202017-09-15 06:15:48 +0200394 "api:transport_api",
Danil Chapovalov4ba04b72019-06-26 15:49:47 +0200395 "api/rtc_event_log:rtc_event_log_factory",
Mirko Bonadeibb547202017-09-15 06:15:48 +0200396 "audio",
397 "call",
398 "common_audio",
399 "common_video",
Yves Gerey06f6bc92018-11-09 10:22:52 +0100400 "logging:rtc_event_log_api",
Mirko Bonadeibb547202017-09-15 06:15:48 +0200401 "media",
402 "modules",
403 "modules/video_capture:video_capture_internal_impl",
Yves Gerey06f6bc92018-11-09 10:22:52 +0100404 "p2p:rtc_p2p",
405 "pc:libjingle_peerconnection",
406 "pc:peerconnection",
407 "pc:rtc_pc",
408 "pc:rtc_pc_base",
Mirko Bonadeibb547202017-09-15 06:15:48 +0200409 "rtc_base",
410 "sdk",
Mirko Bonadeibb547202017-09-15 06:15:48 +0200411 "video",
Mirko Bonadeibb547202017-09-15 06:15:48 +0200412 ]
413
Jiawei Ou08745302019-02-12 11:36:13 -0800414 if (rtc_include_builtin_audio_codecs) {
415 deps += [
416 "api/audio_codecs:builtin_audio_decoder_factory",
417 "api/audio_codecs:builtin_audio_encoder_factory",
418 ]
419 }
420
421 if (rtc_include_builtin_video_codecs) {
422 deps += [
423 "api/video_codecs:builtin_video_decoder_factory",
424 "api/video_codecs:builtin_video_encoder_factory",
425 ]
426 }
Yves Gerey12912252018-07-18 22:06:42 +0200427
Dan Minor9c686132018-01-15 10:20:00 -0500428 if (build_with_mozilla) {
Chen Xing5d24b162019-06-10 12:59:38 +0200429 deps += [
430 "api/video:video_frame",
431 "api/video:video_rtp_headers",
432 ]
Dan Minor9c686132018-01-15 10:20:00 -0500433 } else {
434 deps += [
435 "api",
436 "logging",
437 "p2p",
438 "pc",
439 "stats",
440 ]
441 }
442
Mirko Bonadeibb547202017-09-15 06:15:48 +0200443 if (rtc_enable_protobuf) {
444 defines += [ "ENABLE_RTC_EVENT_LOG" ]
445 deps += [ "logging:rtc_event_log_proto" ]
446 }
447 }
Mirko Bonadeibb547202017-09-15 06:15:48 +0200448}
449
Niels Möllera46bd4b2018-06-08 14:03:44 +0200450rtc_source_set("webrtc_common") {
Mirko Bonadei8ca5c522018-10-03 15:39:56 +0200451 # Client code SHOULD NOT USE THIS TARGET, but for now it needs to be public
452 # because there exists client code that uses it.
453 # TODO(bugs.webrtc.org/9808): Move to private visibility as soon as that
454 # client code gets updated.
455 visibility = [ "*" ]
Mirko Bonadeibb547202017-09-15 06:15:48 +0200456 sources = [
Mirko Bonadeibb547202017-09-15 06:15:48 +0200457 "common_types.h",
Patrik Höglund3e113432017-12-15 14:40:10 +0100458 ]
Mirko Bonadeibb547202017-09-15 06:15:48 +0200459}
460
Nico Weberdf644be2019-03-17 21:06:11 -0400461if (use_libfuzzer || use_afl) {
Mirko Bonadeibb547202017-09-15 06:15:48 +0200462 # This target is only here for gn to discover fuzzer build targets under
463 # webrtc/test/fuzzers/.
464 group("webrtc_fuzzers_dummy") {
465 testonly = true
466 deps = [
467 "test/fuzzers:webrtc_fuzzer_main",
468 ]
469 }
470}
471
472if (rtc_include_tests) {
Mirko Bonadeibb547202017-09-15 06:15:48 +0200473 rtc_test("rtc_unittests") {
474 testonly = true
475
476 deps = [
477 ":webrtc_common",
Harald Alvestrand3cc45d42019-03-14 05:42:04 +0100478 "api:compile_all_headers",
Mirko Bonadeibb547202017-09-15 06:15:48 +0200479 "api:rtc_api_unittests",
Fredrik Solenbergbbf21a32018-04-12 22:44:09 +0200480 "api/audio/test:audio_api_unittests",
Mirko Bonadeibb547202017-09-15 06:15:48 +0200481 "api/audio_codecs/test:audio_codecs_api_unittests",
Sebastian Jansson74682c12019-03-01 11:50:20 +0100482 "api/task_queue:global_task_queue_factory",
Stefan Holmerf7044682018-07-17 10:16:41 +0200483 "api/video/test:rtc_api_video_unittests",
Anders Carlssondd3e0ab2018-06-12 11:15:56 +0200484 "api/video_codecs/test:video_codecs_api_unittests",
Sebastian Jansson487c09b2019-02-21 16:21:51 +0100485 "call:fake_network_pipe_unittests",
Mirko Bonadeibb547202017-09-15 06:15:48 +0200486 "p2p:libstunprober_unittests",
487 "p2p:rtc_p2p_unittests",
488 "rtc_base:rtc_base_approved_unittests",
Mirko Bonadeibb547202017-09-15 06:15:48 +0200489 "rtc_base:rtc_base_unittests",
Sam Zackrissonb45bdb52018-10-02 16:25:59 +0200490 "rtc_base:rtc_json_unittests",
Mirko Bonadeibb547202017-09-15 06:15:48 +0200491 "rtc_base:rtc_numerics_unittests",
492 "rtc_base:rtc_task_queue_unittests",
Artem Titove41c4332018-07-25 15:04:28 +0200493 "rtc_base:sigslot_unittest",
Mirko Bonadeibb547202017-09-15 06:15:48 +0200494 "rtc_base:weak_ptr_unittests",
Sebastian Jansson2808ae92018-04-09 11:13:04 +0200495 "rtc_base/experiments:experiments_unittests",
Sebastian Janssonb55015e2019-04-09 13:44:04 +0200496 "rtc_base/synchronization:sequence_checker_unittests",
Danil Chapovalov3b548dd2019-03-01 14:58:44 +0100497 "rtc_base/task_utils:to_queued_task_unittests",
Niels Möllerdac03d92019-02-13 08:52:27 +0100498 "sdk:sdk_tests",
Niels Möller04a3cc12019-05-21 13:01:58 +0200499 "test:test_main",
Artem Titov386802e2019-07-05 10:48:17 +0200500 "test/network:network_emulation_unittests",
Mirko Bonadeibb547202017-09-15 06:15:48 +0200501 ]
502
503 if (rtc_enable_protobuf) {
504 deps += [ "logging:rtc_event_log_tests" ]
505 }
506
507 if (is_android) {
Sami Kalliomäki78498cf2018-02-07 16:59:33 +0100508 # Do not use Chromium's launcher. native_unittests defines its own JNI_OnLoad.
509 use_default_launcher = false
510
511 deps += [
512 "sdk/android:native_unittests",
513 "sdk/android:native_unittests_java",
514 "//testing/android/native_test:native_test_support",
515 ]
Mirko Bonadeibb547202017-09-15 06:15:48 +0200516 shard_timeout = 900
517 }
518
519 if (is_ios || is_mac) {
Kári Tristan Helgason90143242018-07-27 12:34:54 +0200520 deps += [ "sdk:rtc_unittests_objc" ]
Mirko Bonadeibb547202017-09-15 06:15:48 +0200521 }
522 }
523
Sebastian Jansson449c1c02018-10-22 17:18:46 +0200524 # This runs tests that must run in real time and therefore can take some
525 # time to execute. They are in a separate executable to avoid making the
526 # regular unittest suite too slow to run frequently.
527 rtc_test("slow_tests") {
528 testonly = true
529 deps = [
530 "modules/congestion_controller/goog_cc:goog_cc_slow_tests",
Sebastian Janssonecb68972019-01-18 10:30:54 +0100531 "rtc_base/task_utils:repeating_task_unittests",
Sebastian Jansson449c1c02018-10-22 17:18:46 +0200532 "test:test_main",
533 ]
534 }
535
Mirko Bonadeibb547202017-09-15 06:15:48 +0200536 # TODO(pbos): Rename test suite, this is no longer "just" for video targets.
537 video_engine_tests_resources = [
Mirko Bonadei92ea95e2017-09-15 06:47:31 +0200538 "resources/foreman_cif_short.yuv",
539 "resources/voice_engine/audio_long16.pcm",
Mirko Bonadeibb547202017-09-15 06:15:48 +0200540 ]
541
542 if (is_ios) {
543 bundle_data("video_engine_tests_bundle_data") {
544 testonly = true
545 sources = video_engine_tests_resources
546 outputs = [
547 "{{bundle_resources_dir}}/{{source_file_part}}",
548 ]
549 }
550 }
551
552 rtc_test("video_engine_tests") {
553 testonly = true
554 deps = [
555 "audio:audio_tests",
556
557 # TODO(eladalon): call_tests aren't actually video-specific, so we
558 # should move them to a more appropriate test suite.
559 "call:call_tests",
Mirko Bonadeibb547202017-09-15 06:15:48 +0200560 "test:test_common",
561 "test:test_main",
562 "test:video_test_common",
563 "video:video_tests",
564 ]
565 data = video_engine_tests_resources
Mirko Bonadeibb547202017-09-15 06:15:48 +0200566 if (is_android) {
567 deps += [ "//testing/android/native_test:native_test_native_code" ]
568 shard_timeout = 900
569 }
570 if (is_ios) {
571 deps += [ ":video_engine_tests_bundle_data" ]
572 }
573 }
574
575 webrtc_perf_tests_resources = [
Mirko Bonadei92ea95e2017-09-15 06:47:31 +0200576 "resources/audio_coding/speech_mono_16kHz.pcm",
577 "resources/audio_coding/speech_mono_32_48kHz.pcm",
578 "resources/audio_coding/testfile32kHz.pcm",
579 "resources/ConferenceMotion_1280_720_50.yuv",
580 "resources/difficult_photo_1850_1110.yuv",
581 "resources/foreman_cif.yuv",
Mirko Bonadei92ea95e2017-09-15 06:47:31 +0200582 "resources/paris_qcif.yuv",
583 "resources/photo_1850_1110.yuv",
584 "resources/presentation_1850_1110.yuv",
Mirko Bonadei92ea95e2017-09-15 06:47:31 +0200585 "resources/voice_engine/audio_long16.pcm",
586 "resources/web_screenshot_1850_1110.yuv",
Mirko Bonadeibb547202017-09-15 06:15:48 +0200587 ]
588
589 if (is_ios) {
590 bundle_data("webrtc_perf_tests_bundle_data") {
591 testonly = true
592 sources = webrtc_perf_tests_resources
593 outputs = [
594 "{{bundle_resources_dir}}/{{source_file_part}}",
595 ]
596 }
597 }
598
599 rtc_test("webrtc_perf_tests") {
600 testonly = true
Mirko Bonadeibb547202017-09-15 06:15:48 +0200601 deps = [
602 "audio:audio_perf_tests",
603 "call:call_perf_tests",
604 "modules/audio_coding:audio_coding_perf_tests",
605 "modules/audio_processing:audio_processing_perf_tests",
Seth Hampsond1003d72018-06-22 15:40:16 -0700606 "pc:peerconnection_perf_tests",
Mirko Bonadeibb547202017-09-15 06:15:48 +0200607 "test:test_main",
608 "video:video_full_stack_tests",
Artem Titov137f6c82019-05-17 10:51:15 +0200609 "video:video_pc_full_stack_tests",
Mirko Bonadeibb547202017-09-15 06:15:48 +0200610 ]
611
612 data = webrtc_perf_tests_resources
613 if (is_android) {
Rasmus Brandt31027342017-09-29 13:48:12 +0000614 deps += [ "//testing/android/native_test:native_test_native_code" ]
Oleh Prypin2aa03792018-12-13 08:48:13 +0100615 shard_timeout = 4500
Mirko Bonadeibb547202017-09-15 06:15:48 +0200616 }
617 if (is_ios) {
618 deps += [ ":webrtc_perf_tests_bundle_data" ]
619 }
620 }
621
622 rtc_test("webrtc_nonparallel_tests") {
623 testonly = true
624 deps = [
625 "rtc_base:rtc_base_nonparallel_tests",
626 ]
627 if (is_android) {
628 deps += [ "//testing/android/native_test:native_test_support" ]
629 shard_timeout = 900
630 }
631 }
632
633 if (is_android) {
634 junit_binary("android_junit_tests") {
635 java_files = [
636 "examples/androidjunit/src/org/appspot/apprtc/BluetoothManagerTest.java",
637 "examples/androidjunit/src/org/appspot/apprtc/DirectRTCClientTest.java",
638 "examples/androidjunit/src/org/appspot/apprtc/TCPChannelClientTest.java",
Sami Kalliomäki389d2262018-09-05 16:38:57 +0200639 "sdk/android/tests/src/org/webrtc/AndroidVideoDecoderTest.java",
Mirko Bonadeibb547202017-09-15 06:15:48 +0200640 "sdk/android/tests/src/org/webrtc/CameraEnumerationTest.java",
Sami Kalliomäkia3818712018-08-08 11:29:23 +0200641 "sdk/android/tests/src/org/webrtc/CodecTestHelper.java",
642 "sdk/android/tests/src/org/webrtc/FakeMediaCodecWrapper.java",
643 "sdk/android/tests/src/org/webrtc/GlGenericDrawerTest.java",
644 "sdk/android/tests/src/org/webrtc/HardwareVideoEncoderTest.java",
Sami Kalliomäki8619e8a2018-04-17 14:44:36 +0200645 "sdk/android/tests/src/org/webrtc/ScalingSettingsTest.java",
Benjamin Wright8c27cca2018-10-25 10:16:44 -0700646 "sdk/android/tests/src/org/webrtc/CryptoOptionsTest.java",
Mirko Bonadeibb547202017-09-15 06:15:48 +0200647 ]
648
649 deps = [
650 "examples:AppRTCMobile_javalib",
651 "sdk/android:libjingle_peerconnection_java",
652 "//base:base_java_test_support",
Sami Kalliomäkia3818712018-08-08 11:29:23 +0200653 "//third_party/google-truth:google_truth_java",
Mirko Bonadeibb547202017-09-15 06:15:48 +0200654 ]
Artem Titarenkoff088a12018-11-28 14:46:40 +0100655
656 additional_jar_files = [ [
657 "sdk/android/tests/resources/robolectric.properties",
658 "robolectric.properties",
659 ] ]
Mirko Bonadeibb547202017-09-15 06:15:48 +0200660 }
ehmaldonado37d7a222016-11-08 06:34:20 -0800661 }
wjia@webrtc.org03cfde22014-01-14 17:48:34 +0000662}
Karl Wibergbb23c832018-04-22 19:55:00 +0200663
664# ---- Poisons ----
665#
666# Here is one empty dummy target for each poison type (needed because
667# "being poisonous with poison type foo" is implemented as "depends on
668# //:poison_foo").
669#
670# The set of poison_* targets needs to be kept in sync with the
671# `all_poison_types` list in webrtc.gni.
672#
673group("poison_audio_codecs") {
674}
Anders Carlsson1f433e42018-04-24 16:39:05 +0200675
676group("poison_software_video_codecs") {
677}