blob: 5ac31323b0f25176eb6df487cf45b10717a149cd [file] [log] [blame]
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +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
kjellander@webrtc.org7497fa72014-06-28 18:05:22 +00009# TODO(kjellander): Rebase this to webrtc/build/common.gypi changes after r6330.
10
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +000011import("//build/config/linux/pkg_config.gni")
Peter Boström62e9bda2015-11-23 15:12:06 +010012import("//build/config/sanitizers/sanitizers.gni")
mbonadei9aa3f0a2017-01-24 06:58:22 -080013import("webrtc.gni")
Bjorn Terelius36411852015-07-30 12:45:18 +020014import("//third_party/protobuf/proto_library.gni")
sakal80a5bf12016-09-16 07:22:17 -070015if (is_android) {
16 import("//build/config/android/config.gni")
17 import("//build/config/android/rules.gni")
18}
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +000019
20# Contains the defines and includes in common.gypi that are duplicated both as
21# target_defaults and direct_dependent_settings.
22config("common_inherited_config") {
23 defines = []
Johan Ahlers9ddac182016-07-22 08:57:23 +020024 cflags = []
25 ldflags = []
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +000026 if (build_with_mozilla) {
27 defines += [ "WEBRTC_MOZILLA_BUILD" ]
28 }
29 if (build_with_chromium) {
kjellanderf0e174a2016-05-30 06:27:50 -070030 defines = [
31 # TODO(kjellander): Cleanup unused ones and move defines closer to
32 # the source when webrtc:4256 is completed.
kjellanderf0e174a2016-05-30 06:27:50 -070033 "FEATURE_ENABLE_VOICEMAIL",
34 "EXPAT_RELATIVE_PATH",
35 "GTEST_RELATIVE_PATH",
36 "NO_MAIN_THREAD_WRAPPING",
37 "NO_SOUND_SYSTEM",
38 "WEBRTC_CHROMIUM_BUILD",
39 ]
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +000040 include_dirs = [
henrikgee2bf412015-09-30 03:48:52 -070041 # The overrides must be included first as that is the mechanism for
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +000042 # selecting the override headers in Chromium.
henrikgee2bf412015-09-30 03:48:52 -070043 "../webrtc_overrides",
Henrik Kjellander57e5fd22015-05-25 12:55:39 +020044
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +000045 # Allow includes to be prefixed with webrtc/ in case it is not an
46 # immediate subdirectory of the top-level.
47 "..",
48 ]
49 }
50 if (is_posix) {
51 defines += [ "WEBRTC_POSIX" ]
52 }
53 if (is_ios) {
54 defines += [
55 "WEBRTC_MAC",
56 "WEBRTC_IOS",
57 ]
58 }
59 if (is_linux) {
60 defines += [ "WEBRTC_LINUX" ]
61 }
62 if (is_mac) {
63 defines += [ "WEBRTC_MAC" ]
64 }
65 if (is_win) {
kjellanderf0e174a2016-05-30 06:27:50 -070066 defines += [
67 "WEBRTC_WIN",
68 "_CRT_SECURE_NO_WARNINGS", # Suppress warnings about _vsnprinf
69 ]
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +000070 }
71 if (is_android) {
72 defines += [
73 "WEBRTC_LINUX",
74 "WEBRTC_ANDROID",
75 ]
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +000076 }
kjellanderf0e174a2016-05-30 06:27:50 -070077 if (is_chromeos) {
78 defines += [ "CHROMEOS" ]
79 }
80
Johan Ahlers9ddac182016-07-22 08:57:23 +020081 if (rtc_sanitize_coverage != "") {
82 assert(is_clang, "sanitizer coverage requires clang")
83 cflags += [ "-fsanitize-coverage=${rtc_sanitize_coverage}" ]
84 ldflags += [ "-fsanitize-coverage=${rtc_sanitize_coverage}" ]
85 }
86
kjellanderf0e174a2016-05-30 06:27:50 -070087 # TODO(GYP): Support these in GN.
88 # if (is_bsd) {
89 # defines += [ "BSD" ]
90 # }
91 # if (is_openbsd) {
92 # defines += [ "OPENBSD" ]
93 # }
94 # if (is_freebsd) {
95 # defines += [ "FREEBSD" ]
96 # }
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +000097}
98
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +000099config("common_config") {
kjellander@webrtc.org79ee97c2014-09-04 14:10:49 +0000100 cflags = []
101 cflags_cc = []
kjellanderf0e174a2016-05-30 06:27:50 -0700102 defines = []
103
kjellander@webrtc.org6d08ca62014-09-07 17:36:10 +0000104 if (rtc_restrict_logging) {
kjellanderf0e174a2016-05-30 06:27:50 -0700105 defines += [ "WEBRTC_RESTRICT_LOGGING" ]
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000106 }
107
kjellander82a94492016-06-12 22:12:01 -0700108 if (rtc_include_internal_audio_device) {
109 defines += [ "WEBRTC_INCLUDE_INTERNAL_AUDIO_DEVICE" ]
110 }
111
kjellanderc76dc952016-06-03 03:09:32 -0700112 if (rtc_relative_path) {
113 defines += [ "EXPAT_RELATIVE_PATH" ]
114 }
115
phoglund33603522016-10-05 06:52:22 -0700116 if (!rtc_libvpx_build_vp9) {
117 defines += [ "RTC_DISABLE_VP9" ]
118 }
119
deadbeef40610e22016-12-22 10:53:38 -0800120 if (rtc_enable_sctp) {
121 defines += [ "HAVE_SCTP" ]
122 }
123
kjellandere7b0f522017-01-03 22:09:25 -0800124 if (rtc_enable_external_auth) {
125 defines += [ "ENABLE_EXTERNAL_AUTH" ]
126 }
127
brettw@chromium.org9fe11012014-09-09 19:15:33 +0000128 if (build_with_chromium) {
kjellanderf0e174a2016-05-30 06:27:50 -0700129 defines += [
130 # NOTICE: Since common_inherited_config is used in public_configs for our
131 # targets, there's no point including the defines in that config here.
132 # TODO(kjellander): Cleanup unused ones and move defines closer to the
133 # source when webrtc:4256 is completed.
kjellanderf0e174a2016-05-30 06:27:50 -0700134 "HAVE_WEBRTC_VIDEO",
135 "HAVE_WEBRTC_VOICE",
136 "LOGGING_INSIDE_WEBRTC",
kjellanderf0e174a2016-05-30 06:27:50 -0700137 "USE_WEBRTC_DEV_BRANCH",
138 ]
brettw@chromium.org9fe11012014-09-09 19:15:33 +0000139 } else {
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000140 if (is_posix) {
kjellander496c64c2016-11-03 07:57:35 -0700141 # Enable more warnings: -Wextra is currently disabled in Chromium.
142 cflags = [
143 "-Wextra",
Henrik Kjellander57e5fd22015-05-25 12:55:39 +0200144
kjellander496c64c2016-11-03 07:57:35 -0700145 # Repeat some flags that get overridden by -Wextra.
146 "-Wno-unused-parameter",
147 "-Wno-missing-field-initializers",
148 "-Wno-strict-overflow",
149 ]
150 cflags_cc = [
151 "-Wnon-virtual-dtor",
Henrik Kjellander57e5fd22015-05-25 12:55:39 +0200152
kjellander496c64c2016-11-03 07:57:35 -0700153 # This is enabled for clang; enable for gcc as well.
154 "-Woverloaded-virtual",
155 ]
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000156 }
157
158 if (is_clang) {
kjellander3f032cf2016-04-27 07:13:46 -0700159 cflags += [
160 "-Wimplicit-fallthrough",
161 "-Wthread-safety",
nisse4996eaa2016-05-10 23:28:10 -0700162 "-Winconsistent-missing-override",
kwiberg77eab702016-09-28 17:42:01 -0700163 "-Wundef",
kjellander3f032cf2016-04-27 07:13:46 -0700164 ]
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000165 }
166 }
167
kjellander@webrtc.org72273912015-02-23 19:08:31 +0000168 if (current_cpu == "arm64") {
Andrew MacDonaldcb7f8ce2015-05-19 22:20:17 -0700169 defines += [ "WEBRTC_ARCH_ARM64" ]
170 defines += [ "WEBRTC_HAS_NEON" ]
tkchin@webrtc.org14146e42014-10-31 00:14:39 +0000171 }
172
kjellander@webrtc.org72273912015-02-23 19:08:31 +0000173 if (current_cpu == "arm") {
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000174 defines += [ "WEBRTC_ARCH_ARM" ]
andrew@webrtc.orga56a2c52014-11-26 17:01:40 +0000175 if (arm_version >= 7) {
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000176 defines += [ "WEBRTC_ARCH_ARM_V7" ]
177 if (arm_use_neon) {
Andrew MacDonaldcb7f8ce2015-05-19 22:20:17 -0700178 defines += [ "WEBRTC_HAS_NEON" ]
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000179 }
180 }
181 }
182
kjellander@webrtc.org72273912015-02-23 19:08:31 +0000183 if (current_cpu == "mipsel") {
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000184 defines += [ "MIPS32_LE" ]
kjellander@webrtc.org6dab6d72015-03-04 09:50:31 +0000185 if (mips_float_abi == "hard") {
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000186 defines += [ "MIPS_FPU_LE" ]
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000187 }
kjellander@webrtc.orgacb80852015-01-25 19:17:56 +0000188 if (mips_arch_variant == "r2") {
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000189 defines += [ "MIPS32_R2_LE" ]
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000190 }
191 if (mips_dsp_rev == 1) {
192 defines += [ "MIPS_DSP_R1_LE" ]
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000193 } else if (mips_dsp_rev == 2) {
194 defines += [
195 "MIPS_DSP_R1_LE",
196 "MIPS_DSP_R2_LE",
197 ]
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000198 }
199 }
200
Henrik Kjellanderc0c7d2e2015-09-07 12:57:42 +0200201 if (is_android && !is_clang) {
Henrik Kjellander5bfc6cb2015-09-21 16:50:45 +0200202 # The Android NDK doesn"t provide optimized versions of these
203 # functions. Ensure they are disabled for all compilers.
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000204 cflags += [
205 "-fno-builtin-cos",
206 "-fno-builtin-sin",
207 "-fno-builtin-cosf",
208 "-fno-builtin-sinf",
209 ]
210 }
katrielcbf81d682016-05-26 01:03:02 -0700211
metzmanf89a5712016-07-25 02:14:09 -0700212 if (use_libfuzzer || use_drfuzz || use_afl) {
katrielcbf81d682016-05-26 01:03:02 -0700213 # Used in Chromium's overrides to disable logging
214 defines += [ "WEBRTC_UNSAFE_FUZZER_MODE" ]
215 }
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000216}
217
kjellander3bcedd32016-06-08 01:14:15 -0700218config("common_objc") {
tkchin2ddfdba2016-08-07 21:37:45 -0700219 libs = [ "Foundation.framework" ]
kjellander3bcedd32016-06-08 01:14:15 -0700220}
221
kjellander6ceab082016-10-28 05:44:03 -0700222if (!build_with_chromium) {
223 # Target to build all the WebRTC production code.
kjellanderee996962016-09-27 12:13:13 -0700224 rtc_static_library("webrtc") {
kjellander6ceab082016-10-28 05:44:03 -0700225 # Only the root target should depend on this.
226 visibility = [ "//:default" ]
227
Nico Weber3ab32dc2016-08-02 09:53:25 -0400228 sources = [
ossuf515ab82016-12-07 04:52:58 -0800229 # TODO(ossu): Keep this here until donwstream projects have updated.
230 # http://bugs.webrtc.org/6716
Nico Weber3ab32dc2016-08-02 09:53:25 -0400231 "call.h",
232 "config.h",
kjellander94cee312016-06-10 01:56:57 -0700233 ]
kjellander7007bcf2017-03-23 02:49:15 -0700234 complete_static_lib = true
Nico Weber3ab32dc2016-08-02 09:53:25 -0400235 defines = []
Nico Weber3ab32dc2016-08-02 09:53:25 -0400236
237 deps = [
238 ":webrtc_common",
kjellander6ceab082016-10-28 05:44:03 -0700239 "api",
aleloia8eb7562016-11-28 07:02:13 -0800240 "api:transport_api",
Nico Weber3ab32dc2016-08-02 09:53:25 -0400241 "audio",
kjellander6ceab082016-10-28 05:44:03 -0700242 "base",
Nico Weber3ab32dc2016-08-02 09:53:25 -0400243 "call",
244 "common_audio",
245 "common_video",
kjellander6ceab082016-10-28 05:44:03 -0700246 "logging",
247 "media",
Nico Weber3ab32dc2016-08-02 09:53:25 -0400248 "modules",
kjellander6ceab082016-10-28 05:44:03 -0700249 "modules/video_capture:video_capture_internal_impl",
deadbeefe814a0d2017-02-25 18:15:09 -0800250 "ortc",
kjellander6ceab082016-10-28 05:44:03 -0700251 "p2p",
252 "pc",
253 "sdk",
hbos615d3012016-08-24 01:33:13 -0700254 "stats",
Nico Weber3ab32dc2016-08-02 09:53:25 -0400255 "system_wrappers",
Nico Weber3ab32dc2016-08-02 09:53:25 -0400256 "video",
257 "voice_engine",
258 ]
259
Nico Weber3ab32dc2016-08-02 09:53:25 -0400260 if (rtc_enable_protobuf) {
261 defines += [ "ENABLE_RTC_EVENT_LOG" ]
skvladcc91d282016-10-03 18:31:22 -0700262 deps += [ "logging:rtc_event_log_proto" ]
Nico Weber3ab32dc2016-08-02 09:53:25 -0400263 }
Bjorn Terelius36411852015-07-30 12:45:18 +0200264 }
kjellander6ceab082016-10-28 05:44:03 -0700265
266 if (rtc_include_tests) {
267 # Target to build all the WebRTC tests (but not examples or tools).
268 # Executable in order to get a target that links all WebRTC code.
269 rtc_executable("webrtc_tests") {
270 testonly = true
271
272 # Only the root target should depend on this.
273 visibility = [ "//:default" ]
274
275 deps = [
276 ":rtc_unittests",
277 ":video_engine_tests",
278 ":webrtc_nonparallel_tests",
279 ":webrtc_perf_tests",
deadbeef6038e972017-02-16 23:31:33 -0800280 "api:rtc_api_unittests",
nissee0e3bdf2017-01-18 02:16:20 -0800281 "base:rtc_base_tests_utils",
kjellander6ceab082016-10-28 05:44:03 -0700282 "common_audio:common_audio_unittests",
283 "common_video:common_video_unittests",
284 "media:rtc_media_unittests",
285 "modules:modules_tests",
286 "modules:modules_unittests",
287 "modules/audio_coding:audio_coding_tests",
288 "modules/audio_processing:audio_processing_tests",
Henrik Kjellander7af1ea12017-03-22 15:48:11 +0100289 "modules/remote_bitrate_estimator:bwe_simulations_tests",
kjellander6ceab082016-10-28 05:44:03 -0700290 "modules/rtp_rtcp:test_packet_masks_metrics",
291 "modules/video_capture:video_capture_internal_impl",
brandtr11c9eaf2017-02-20 23:56:39 -0800292 "modules/video_coding:plot_videoprocessor_integrationtest",
deadbeef4b1bf6c2017-02-22 23:45:38 -0800293 "ortc:ortc_unittests",
ossu7bb87ee2017-01-23 04:56:25 -0800294 "pc:peerconnection_unittests",
kjellander6ceab082016-10-28 05:44:03 -0700295 "pc:rtc_pc_unittests",
296 "stats:rtc_stats_unittests",
297 "system_wrappers:system_wrappers_unittests",
298 "test",
299 "video:screenshare_loopback",
300 "video:video_loopback",
301 "video:video_tests",
kjellander6ceab082016-10-28 05:44:03 -0700302 "voice_engine:voice_engine_unittests",
303 ]
304 if (is_android) {
305 deps += [
306 ":android_junit_tests",
magjed768c6482016-12-06 04:29:37 -0800307 "//webrtc/sdk/android:libjingle_peerconnection_android_unittest",
kjellander6ceab082016-10-28 05:44:03 -0700308 ]
309 } else {
310 deps += [ "modules/video_capture:video_capture_tests" ]
311 }
312 if (!is_ios) {
tommi3dda2462017-02-26 07:12:50 -0800313 deps += [
314 "modules/audio_device:audio_device_tests",
315 "voice_engine:voe_auto_test",
316 ]
kjellander6ceab082016-10-28 05:44:03 -0700317 }
ivoc54b6e982017-02-08 00:28:09 -0800318 if (rtc_enable_protobuf) {
319 deps += [ "logging:rtc_event_log2rtp_dump" ]
320 }
kjellander6ceab082016-10-28 05:44:03 -0700321 }
322 }
kjellander@webrtc.org1227ab82014-06-23 19:21:07 +0000323}
324
kjellanderb62dbbe2016-09-23 00:38:52 -0700325rtc_static_library("webrtc_common") {
kjellander@webrtc.org1227ab82014-06-23 19:21:07 +0000326 sources = [
kwiberg@webrtc.orgac2d27d2015-02-26 13:59:22 +0000327 "common_types.cc",
kjellander@webrtc.orgd7e34e12015-01-26 19:17:26 +0000328 "common_types.h",
kjellander@webrtc.org1227ab82014-06-23 19:21:07 +0000329 "config.cc",
Henrik Kjellander57e5fd22015-05-25 12:55:39 +0200330 "config.h",
kjellander@webrtc.orgd7e34e12015-01-26 19:17:26 +0000331 "typedefs.h",
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000332 ]
kjellander@webrtc.org9bef5512014-07-13 09:02:54 +0000333
kjellandere40a7ee2016-10-16 23:56:12 -0700334 if (!build_with_chromium && is_clang) {
335 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
ehmaldonado38a21322016-09-02 04:10:34 -0700336 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
aluebs688e3082016-01-14 04:32:46 -0800337 }
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000338}
kjellander@webrtc.orgd7e34e12015-01-26 19:17:26 +0000339
metzmanf89a5712016-07-25 02:14:09 -0700340if (use_libfuzzer || use_drfuzz || use_afl) {
Peter Boström1e0cfd92015-12-17 14:28:16 +0100341 # This target is only here for gn to discover fuzzer build targets under
342 # webrtc/test/fuzzers/.
343 group("webrtc_fuzzers_dummy") {
Peter Boström62e9bda2015-11-23 15:12:06 +0100344 testonly = true
345 deps = [
Peter Boström1e0cfd92015-12-17 14:28:16 +0100346 "test/fuzzers:webrtc_fuzzer_main",
Peter Boström62e9bda2015-11-23 15:12:06 +0100347 ]
348 }
349}
kjellander@webrtc.org3ee56142016-06-03 15:57:02 +0200350
kjellander@webrtc.orgaff499c2016-06-06 23:04:31 +0200351if (rtc_include_tests) {
kjellander@webrtc.org3ee56142016-06-03 15:57:02 +0200352 config("rtc_unittests_config") {
353 # GN orders flags on a target before flags from configs. The default config
354 # adds -Wall, and this flag have to be after -Wall -- so they need to
355 # come from a config and can"t be on the target directly.
356 if (is_clang) {
357 cflags = [
kjellander@webrtc.org3ee56142016-06-03 15:57:02 +0200358 "-Wno-sign-compare",
359 "-Wno-unused-const-variable",
360 ]
361 }
362 }
363
ehmaldonado38a21322016-09-02 04:10:34 -0700364 rtc_test("rtc_unittests") {
kjellander@webrtc.org3ee56142016-06-03 15:57:02 +0200365 testonly = true
kjellander@webrtc.org3ee56142016-06-03 15:57:02 +0200366 deps = [
deadbeefb5388d72017-02-24 01:17:43 -0800367 "api:rtc_api_unittests",
ehmaldonadoda8dcfb2017-01-04 07:11:23 -0800368 "base:rtc_base_approved_unittests",
369 "base:rtc_base_unittests",
tereliusbc5d9212017-01-13 09:14:33 -0800370 "base:rtc_numerics_unittests",
ehmaldonadoda8dcfb2017-01-04 07:11:23 -0800371 "base:rtc_task_queue_unittests",
372 "p2p:libstunprober_unittests",
373 "p2p:rtc_p2p_unittests",
ehmaldonadof49ff262017-01-23 04:26:02 -0800374 "system_wrappers:metrics_default",
kjellander@webrtc.org3ee56142016-06-03 15:57:02 +0200375 ]
376
skvlade9cac752016-09-19 14:42:02 -0700377 if (rtc_enable_protobuf) {
skvladcc91d282016-10-03 18:31:22 -0700378 deps += [ "logging:rtc_event_log_tests" ]
skvlade9cac752016-09-19 14:42:02 -0700379 }
380
kjellander@webrtc.org3ee56142016-06-03 15:57:02 +0200381 if (is_android) {
382 deps += [ "//testing/android/native_test:native_test_support" ]
sakal714dd4e2016-08-15 02:29:11 -0700383 shard_timeout = 900
kjellander@webrtc.org3ee56142016-06-03 15:57:02 +0200384 }
kjellander3bcedd32016-06-08 01:14:15 -0700385
kthelgasoncc2d1c62016-11-09 07:44:27 -0800386 if (is_ios || is_mac) {
ehmaldonadoda8dcfb2017-01-04 07:11:23 -0800387 deps += [ "sdk:rtc_sdk_peerconnection_objc_unittests" ]
kjellander3bcedd32016-06-08 01:14:15 -0700388 }
kjellander@webrtc.org3ee56142016-06-03 15:57:02 +0200389 }
Peter Boström02083222016-06-14 12:52:54 +0200390
391 # TODO(pbos): Rename test suite, this is no longer "just" for video targets.
ehmaldonado3a7f35b2016-09-14 05:10:01 -0700392 video_engine_tests_resources = [
393 "//resources/foreman_cif_short.yuv",
394 "//resources/voice_engine/audio_long16.pcm",
395 ]
kjellander32c4a202016-08-30 02:53:49 -0700396
397 if (is_ios) {
398 bundle_data("video_engine_tests_bundle_data") {
399 testonly = true
400 sources = video_engine_tests_resources
401 outputs = [
402 "{{bundle_resources_dir}}/{{source_file_part}}",
403 ]
404 }
405 }
406
ehmaldonado38a21322016-09-02 04:10:34 -0700407 rtc_test("video_engine_tests") {
Peter Boström02083222016-06-14 12:52:54 +0200408 testonly = true
409 deps = [
410 "audio:audio_tests",
nissee0e3bdf2017-01-18 02:16:20 -0800411 "base:rtc_base_tests_utils",
Peter Boström02083222016-06-14 12:52:54 +0200412 "call:call_tests",
413 "modules/video_capture",
414 "test:test_common",
415 "test:test_main",
ehmaldonado656610f2017-02-06 02:21:11 -0800416 "test:video_test_common",
Peter Boström02083222016-06-14 12:52:54 +0200417 "video:video_tests",
418 ]
ehmaldonado3a7f35b2016-09-14 05:10:01 -0700419 data = video_engine_tests_resources
kjellandere40a7ee2016-10-16 23:56:12 -0700420 if (!build_with_chromium && is_clang) {
421 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
ehmaldonado38a21322016-09-02 04:10:34 -0700422 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
Peter Boström02083222016-06-14 12:52:54 +0200423 }
sakal714dd4e2016-08-15 02:29:11 -0700424 if (is_android) {
sakal010f0922016-08-18 00:41:59 -0700425 deps += [ "//testing/android/native_test:native_test_native_code" ]
kjellander28a0ffd2016-08-24 07:48:42 -0700426 shard_timeout = 900
427 }
kjellander32c4a202016-08-30 02:53:49 -0700428 if (is_ios) {
429 deps += [ ":video_engine_tests_bundle_data" ]
sakal714dd4e2016-08-15 02:29:11 -0700430 }
Peter Boström02083222016-06-14 12:52:54 +0200431 }
Peter Boströmac968bd2016-06-27 19:31:39 +0200432
ehmaldonado3a7f35b2016-09-14 05:10:01 -0700433 webrtc_perf_tests_resources = [
434 "//resources/audio_coding/speech_mono_16kHz.pcm",
henrik.lundin8c1dd8d2016-12-19 06:18:35 -0800435 "//resources/audio_coding/speech_mono_32_48kHz.pcm",
ehmaldonado3a7f35b2016-09-14 05:10:01 -0700436 "//resources/audio_coding/testfile32kHz.pcm",
437 "//resources/ConferenceMotion_1280_720_50.yuv",
438 "//resources/difficult_photo_1850_1110.yuv",
439 "//resources/foreman_cif.yuv",
440 "//resources/google-wifi-3mbps.rx",
441 "//resources/paris_qcif.yuv",
442 "//resources/photo_1850_1110.yuv",
443 "//resources/presentation_1850_1110.yuv",
444 "//resources/verizon4g-downlink.rx",
445 "//resources/voice_engine/audio_long16.pcm",
446 "//resources/web_screenshot_1850_1110.yuv",
447 ]
kjellander32c4a202016-08-30 02:53:49 -0700448
449 if (is_ios) {
450 bundle_data("webrtc_perf_tests_bundle_data") {
451 testonly = true
452 sources = webrtc_perf_tests_resources
453 outputs = [
454 "{{bundle_resources_dir}}/{{source_file_part}}",
455 ]
456 }
457 }
458
ehmaldonado38a21322016-09-02 04:10:34 -0700459 rtc_test("webrtc_perf_tests") {
ehmaldonado529f83c2016-07-27 08:14:32 -0700460 testonly = true
ehmaldonado7a2ce0b2016-09-05 01:35:44 -0700461 configs += [ ":rtc_unittests_config" ]
ehmaldonado25f32e72016-08-31 08:22:09 -0700462
danilchap5fbcd222017-01-05 04:57:49 -0800463 deps = [
ehmaldonado021eef32017-01-05 07:09:50 -0800464 "call:call_perf_tests",
465 "modules/audio_coding:audio_coding_perf_tests",
466 "modules/audio_processing:audio_processing_perf_tests",
467 "modules/remote_bitrate_estimator:remote_bitrate_estimator_perf_tests",
danilchap5fbcd222017-01-05 04:57:49 -0800468 "test:test_main",
ehmaldonado021eef32017-01-05 07:09:50 -0800469 "video:video_full_stack_tests",
danilchap5fbcd222017-01-05 04:57:49 -0800470 "video:video_quality_test",
danilchap5fbcd222017-01-05 04:57:49 -0800471 ]
472
ehmaldonado3a7f35b2016-09-14 05:10:01 -0700473 data = webrtc_perf_tests_resources
ehmaldonado529f83c2016-07-27 08:14:32 -0700474 if (is_android) {
475 deps += [ "//testing/android/native_test:native_test_native_code" ]
sakal714dd4e2016-08-15 02:29:11 -0700476 shard_timeout = 2700
ehmaldonado529f83c2016-07-27 08:14:32 -0700477 }
kjellander32c4a202016-08-30 02:53:49 -0700478 if (is_ios) {
479 deps += [ ":webrtc_perf_tests_bundle_data" ]
480 }
ehmaldonado529f83c2016-07-27 08:14:32 -0700481 }
482
ehmaldonado38a21322016-09-02 04:10:34 -0700483 rtc_test("webrtc_nonparallel_tests") {
Peter Boströmac968bd2016-06-27 19:31:39 +0200484 testonly = true
Peter Boströmac968bd2016-06-27 19:31:39 +0200485 deps = [
ehmaldonado894c2bb2017-01-05 06:03:24 -0800486 "base:rtc_base_nonparallel_tests",
Peter Boströmac968bd2016-06-27 19:31:39 +0200487 ]
Peter Boströmac968bd2016-06-27 19:31:39 +0200488 if (is_android) {
489 deps += [ "//testing/android/native_test:native_test_support" ]
sakal714dd4e2016-08-15 02:29:11 -0700490 shard_timeout = 900
Peter Boströmac968bd2016-06-27 19:31:39 +0200491 }
Peter Boströmac968bd2016-06-27 19:31:39 +0200492 }
sakal80a5bf12016-09-16 07:22:17 -0700493
494 if (is_android) {
495 junit_binary("android_junit_tests") {
kjellander4bb04982016-09-19 08:53:23 -0700496 java_files = [
sakalb621c3f2017-01-27 05:14:59 -0800497 "examples/androidjunit/src/org/appspot/apprtc/BluetoothManagerTest.java",
kjellander4bb04982016-09-19 08:53:23 -0700498 "examples/androidjunit/src/org/appspot/apprtc/DirectRTCClientTest.java",
499 "examples/androidjunit/src/org/appspot/apprtc/TCPChannelClientTest.java",
sakalb621c3f2017-01-27 05:14:59 -0800500 "sdk/android/tests/src/org/webrtc/CameraEnumerationTest.java",
kjellander4bb04982016-09-19 08:53:23 -0700501 ]
sakal80a5bf12016-09-16 07:22:17 -0700502
503 deps = [
ehmaldonadoeb5040a2016-09-30 00:20:06 -0700504 "//base:base_java_test_support",
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200505 "//webrtc/examples:AppRTCMobile_javalib",
magjed768c6482016-12-06 04:29:37 -0800506 "//webrtc/sdk/android:libjingle_peerconnection_java",
sakal80a5bf12016-09-16 07:22:17 -0700507 ]
508 }
509 }
kjellander@webrtc.org3ee56142016-06-03 15:57:02 +0200510}