blob: 3fb9cfea72ebf94abda5ea30f50f0f079ca32b94 [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")
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +000013import("build/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.
33 "FEATURE_ENABLE_SSL",
34 "FEATURE_ENABLE_VOICEMAIL",
35 "EXPAT_RELATIVE_PATH",
36 "GTEST_RELATIVE_PATH",
37 "NO_MAIN_THREAD_WRAPPING",
38 "NO_SOUND_SYSTEM",
39 "WEBRTC_CHROMIUM_BUILD",
40 ]
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +000041 include_dirs = [
henrikgee2bf412015-09-30 03:48:52 -070042 # The overrides must be included first as that is the mechanism for
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +000043 # selecting the override headers in Chromium.
henrikgee2bf412015-09-30 03:48:52 -070044 "../webrtc_overrides",
Henrik Kjellander57e5fd22015-05-25 12:55:39 +020045
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +000046 # Allow includes to be prefixed with webrtc/ in case it is not an
47 # immediate subdirectory of the top-level.
48 "..",
49 ]
50 }
51 if (is_posix) {
52 defines += [ "WEBRTC_POSIX" ]
53 }
54 if (is_ios) {
55 defines += [
56 "WEBRTC_MAC",
57 "WEBRTC_IOS",
58 ]
59 }
60 if (is_linux) {
61 defines += [ "WEBRTC_LINUX" ]
62 }
63 if (is_mac) {
64 defines += [ "WEBRTC_MAC" ]
65 }
66 if (is_win) {
kjellanderf0e174a2016-05-30 06:27:50 -070067 defines += [
68 "WEBRTC_WIN",
69 "_CRT_SECURE_NO_WARNINGS", # Suppress warnings about _vsnprinf
70 ]
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +000071 }
72 if (is_android) {
73 defines += [
74 "WEBRTC_LINUX",
75 "WEBRTC_ANDROID",
76 ]
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +000077 }
kjellanderf0e174a2016-05-30 06:27:50 -070078 if (is_chromeos) {
79 defines += [ "CHROMEOS" ]
80 }
81
Johan Ahlers9ddac182016-07-22 08:57:23 +020082 if (rtc_sanitize_coverage != "") {
83 assert(is_clang, "sanitizer coverage requires clang")
84 cflags += [ "-fsanitize-coverage=${rtc_sanitize_coverage}" ]
85 ldflags += [ "-fsanitize-coverage=${rtc_sanitize_coverage}" ]
86 }
87
kjellanderf0e174a2016-05-30 06:27:50 -070088 # TODO(GYP): Support these in GN.
89 # if (is_bsd) {
90 # defines += [ "BSD" ]
91 # }
92 # if (is_openbsd) {
93 # defines += [ "OPENBSD" ]
94 # }
95 # if (is_freebsd) {
96 # defines += [ "FREEBSD" ]
97 # }
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +000098}
99
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000100config("common_config") {
kjellander@webrtc.org79ee97c2014-09-04 14:10:49 +0000101 cflags = []
102 cflags_cc = []
kjellanderf0e174a2016-05-30 06:27:50 -0700103 defines = []
104
kjellander@webrtc.org6d08ca62014-09-07 17:36:10 +0000105 if (rtc_restrict_logging) {
kjellanderf0e174a2016-05-30 06:27:50 -0700106 defines += [ "WEBRTC_RESTRICT_LOGGING" ]
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000107 }
108
kjellander82a94492016-06-12 22:12:01 -0700109 if (rtc_include_internal_audio_device) {
110 defines += [ "WEBRTC_INCLUDE_INTERNAL_AUDIO_DEVICE" ]
111 }
112
kjellanderc76dc952016-06-03 03:09:32 -0700113 if (rtc_relative_path) {
114 defines += [ "EXPAT_RELATIVE_PATH" ]
115 }
116
phoglund33603522016-10-05 06:52:22 -0700117 if (!rtc_libvpx_build_vp9) {
118 defines += [ "RTC_DISABLE_VP9" ]
119 }
120
deadbeef40610e22016-12-22 10:53:38 -0800121 if (rtc_enable_sctp) {
122 defines += [ "HAVE_SCTP" ]
123 }
124
brettw@chromium.org9fe11012014-09-09 19:15:33 +0000125 if (build_with_chromium) {
kjellanderf0e174a2016-05-30 06:27:50 -0700126 defines += [
127 # NOTICE: Since common_inherited_config is used in public_configs for our
128 # targets, there's no point including the defines in that config here.
129 # TODO(kjellander): Cleanup unused ones and move defines closer to the
130 # source when webrtc:4256 is completed.
131 "ENABLE_EXTERNAL_AUTH",
132 "HAVE_OPENSSL_SSL_H",
kjellanderf0e174a2016-05-30 06:27:50 -0700133 "HAVE_SRTP",
134 "HAVE_WEBRTC_VIDEO",
135 "HAVE_WEBRTC_VOICE",
136 "LOGGING_INSIDE_WEBRTC",
kjellanderf0e174a2016-05-30 06:27:50 -0700137 "SSL_USE_OPENSSL",
138 "USE_WEBRTC_DEV_BRANCH",
139 ]
brettw@chromium.org9fe11012014-09-09 19:15:33 +0000140 } else {
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000141 if (is_posix) {
kjellander496c64c2016-11-03 07:57:35 -0700142 # Enable more warnings: -Wextra is currently disabled in Chromium.
143 cflags = [
144 "-Wextra",
Henrik Kjellander57e5fd22015-05-25 12:55:39 +0200145
kjellander496c64c2016-11-03 07:57:35 -0700146 # Repeat some flags that get overridden by -Wextra.
147 "-Wno-unused-parameter",
148 "-Wno-missing-field-initializers",
149 "-Wno-strict-overflow",
150 ]
151 cflags_cc = [
152 "-Wnon-virtual-dtor",
Henrik Kjellander57e5fd22015-05-25 12:55:39 +0200153
kjellander496c64c2016-11-03 07:57:35 -0700154 # This is enabled for clang; enable for gcc as well.
155 "-Woverloaded-virtual",
156 ]
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000157 }
158
159 if (is_clang) {
kjellander3f032cf2016-04-27 07:13:46 -0700160 cflags += [
161 "-Wimplicit-fallthrough",
162 "-Wthread-safety",
nisse4996eaa2016-05-10 23:28:10 -0700163 "-Winconsistent-missing-override",
kwiberg77eab702016-09-28 17:42:01 -0700164 "-Wundef",
kjellander3f032cf2016-04-27 07:13:46 -0700165 ]
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000166 }
167 }
168
kjellander@webrtc.org72273912015-02-23 19:08:31 +0000169 if (current_cpu == "arm64") {
Andrew MacDonaldcb7f8ce2015-05-19 22:20:17 -0700170 defines += [ "WEBRTC_ARCH_ARM64" ]
171 defines += [ "WEBRTC_HAS_NEON" ]
tkchin@webrtc.org14146e42014-10-31 00:14:39 +0000172 }
173
kjellander@webrtc.org72273912015-02-23 19:08:31 +0000174 if (current_cpu == "arm") {
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000175 defines += [ "WEBRTC_ARCH_ARM" ]
andrew@webrtc.orga56a2c52014-11-26 17:01:40 +0000176 if (arm_version >= 7) {
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000177 defines += [ "WEBRTC_ARCH_ARM_V7" ]
178 if (arm_use_neon) {
Andrew MacDonaldcb7f8ce2015-05-19 22:20:17 -0700179 defines += [ "WEBRTC_HAS_NEON" ]
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000180 }
181 }
182 }
183
kjellander@webrtc.org72273912015-02-23 19:08:31 +0000184 if (current_cpu == "mipsel") {
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000185 defines += [ "MIPS32_LE" ]
kjellander@webrtc.org6dab6d72015-03-04 09:50:31 +0000186 if (mips_float_abi == "hard") {
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000187 defines += [ "MIPS_FPU_LE" ]
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000188 }
kjellander@webrtc.orgacb80852015-01-25 19:17:56 +0000189 if (mips_arch_variant == "r2") {
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000190 defines += [ "MIPS32_R2_LE" ]
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000191 }
192 if (mips_dsp_rev == 1) {
193 defines += [ "MIPS_DSP_R1_LE" ]
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000194 } else if (mips_dsp_rev == 2) {
195 defines += [
196 "MIPS_DSP_R1_LE",
197 "MIPS_DSP_R2_LE",
198 ]
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000199 }
200 }
201
Henrik Kjellanderc0c7d2e2015-09-07 12:57:42 +0200202 if (is_android && !is_clang) {
Henrik Kjellander5bfc6cb2015-09-21 16:50:45 +0200203 # The Android NDK doesn"t provide optimized versions of these
204 # functions. Ensure they are disabled for all compilers.
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000205 cflags += [
206 "-fno-builtin-cos",
207 "-fno-builtin-sin",
208 "-fno-builtin-cosf",
209 "-fno-builtin-sinf",
210 ]
211 }
katrielcbf81d682016-05-26 01:03:02 -0700212
metzmanf89a5712016-07-25 02:14:09 -0700213 if (use_libfuzzer || use_drfuzz || use_afl) {
katrielcbf81d682016-05-26 01:03:02 -0700214 # Used in Chromium's overrides to disable logging
215 defines += [ "WEBRTC_UNSAFE_FUZZER_MODE" ]
216 }
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000217}
218
kjellander3bcedd32016-06-08 01:14:15 -0700219config("common_objc") {
tkchin2ddfdba2016-08-07 21:37:45 -0700220 libs = [ "Foundation.framework" ]
kjellander3bcedd32016-06-08 01:14:15 -0700221 precompiled_header = "sdk/objc/WebRTC-Prefix.pch"
222 precompiled_source = "sdk/objc/WebRTC-Prefix.pch"
223}
224
kjellander6ceab082016-10-28 05:44:03 -0700225if (!build_with_chromium) {
226 # Target to build all the WebRTC production code.
kjellanderee996962016-09-27 12:13:13 -0700227 rtc_static_library("webrtc") {
kjellander6ceab082016-10-28 05:44:03 -0700228 # Only the root target should depend on this.
229 visibility = [ "//:default" ]
230
Nico Weber3ab32dc2016-08-02 09:53:25 -0400231 sources = [
kjellanderee996962016-09-27 12:13:13 -0700232 # TODO(kjellander): Remove this whenever possible. GN's static_library
233 # target type requires at least one object to avoid errors linking.
234 "build/no_op_function.cc",
ossuf515ab82016-12-07 04:52:58 -0800235
236 # TODO(ossu): Keep this here until donwstream projects have updated.
237 # http://bugs.webrtc.org/6716
Nico Weber3ab32dc2016-08-02 09:53:25 -0400238 "call.h",
239 "config.h",
kjellander94cee312016-06-10 01:56:57 -0700240 ]
Bjorn Terelius36411852015-07-30 12:45:18 +0200241
Nico Weber3ab32dc2016-08-02 09:53:25 -0400242 defines = []
Nico Weber3ab32dc2016-08-02 09:53:25 -0400243
244 deps = [
245 ":webrtc_common",
kjellander6ceab082016-10-28 05:44:03 -0700246 "api",
aleloia8eb7562016-11-28 07:02:13 -0800247 "api:transport_api",
Nico Weber3ab32dc2016-08-02 09:53:25 -0400248 "audio",
kjellander6ceab082016-10-28 05:44:03 -0700249 "base",
Nico Weber3ab32dc2016-08-02 09:53:25 -0400250 "call",
251 "common_audio",
252 "common_video",
kjellander6ceab082016-10-28 05:44:03 -0700253 "libjingle/xmllite",
254 "libjingle/xmpp",
255 "logging",
256 "media",
Nico Weber3ab32dc2016-08-02 09:53:25 -0400257 "modules",
kjellander6ceab082016-10-28 05:44:03 -0700258 "modules/video_capture:video_capture_internal_impl",
259 "p2p",
260 "pc",
261 "sdk",
hbos615d3012016-08-24 01:33:13 -0700262 "stats",
Nico Weber3ab32dc2016-08-02 09:53:25 -0400263 "system_wrappers",
Nico Weber3ab32dc2016-08-02 09:53:25 -0400264 "video",
265 "voice_engine",
266 ]
267
Nico Weber3ab32dc2016-08-02 09:53:25 -0400268 if (rtc_enable_protobuf) {
269 defines += [ "ENABLE_RTC_EVENT_LOG" ]
skvladcc91d282016-10-03 18:31:22 -0700270 deps += [ "logging:rtc_event_log_proto" ]
Nico Weber3ab32dc2016-08-02 09:53:25 -0400271 }
Bjorn Terelius36411852015-07-30 12:45:18 +0200272 }
kjellander6ceab082016-10-28 05:44:03 -0700273
274 if (rtc_include_tests) {
275 # Target to build all the WebRTC tests (but not examples or tools).
276 # Executable in order to get a target that links all WebRTC code.
277 rtc_executable("webrtc_tests") {
278 testonly = true
279
280 # Only the root target should depend on this.
281 visibility = [ "//:default" ]
282
283 deps = [
284 ":rtc_unittests",
285 ":video_engine_tests",
286 ":webrtc_nonparallel_tests",
287 ":webrtc_perf_tests",
kjellander6ceab082016-10-28 05:44:03 -0700288 "api:peerconnection_unittests",
289 "common_audio:common_audio_unittests",
290 "common_video:common_video_unittests",
kjellandereee9c0e2016-11-08 03:18:38 -0800291 "libjingle:xmllite_xmpp_unittests",
kjellander6ceab082016-10-28 05:44:03 -0700292 "media:rtc_media_unittests",
293 "modules:modules_tests",
294 "modules:modules_unittests",
295 "modules/audio_coding:audio_coding_tests",
296 "modules/audio_processing:audio_processing_tests",
297 "modules/rtp_rtcp:test_packet_masks_metrics",
298 "modules/video_capture:video_capture_internal_impl",
299 "pc:rtc_pc_unittests",
300 "stats:rtc_stats_unittests",
301 "system_wrappers:system_wrappers_unittests",
302 "test",
303 "video:screenshare_loopback",
304 "video:video_loopback",
305 "video:video_tests",
306 "voice_engine:voe_cmd_test",
307 "voice_engine:voice_engine_unittests",
308 ]
309 if (is_android) {
310 deps += [
311 ":android_junit_tests",
magjed768c6482016-12-06 04:29:37 -0800312 "//webrtc/sdk/android:libjingle_peerconnection_android_unittest",
kjellander6ceab082016-10-28 05:44:03 -0700313 ]
314 } else {
315 deps += [ "modules/video_capture:video_capture_tests" ]
316 }
317 if (!is_ios) {
318 deps += [
319 "modules/audio_device:audio_device_tests",
320 "voice_engine:voe_auto_test",
321 ]
322 }
323 }
324 }
kjellander@webrtc.org1227ab82014-06-23 19:21:07 +0000325}
326
kjellanderb62dbbe2016-09-23 00:38:52 -0700327rtc_static_library("webrtc_common") {
kjellander@webrtc.org1227ab82014-06-23 19:21:07 +0000328 sources = [
kwiberg@webrtc.orgac2d27d2015-02-26 13:59:22 +0000329 "common_types.cc",
kjellander@webrtc.orgd7e34e12015-01-26 19:17:26 +0000330 "common_types.h",
kjellander@webrtc.org1227ab82014-06-23 19:21:07 +0000331 "config.cc",
Henrik Kjellander57e5fd22015-05-25 12:55:39 +0200332 "config.h",
kjellander@webrtc.orgd7e34e12015-01-26 19:17:26 +0000333 "typedefs.h",
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000334 ]
kjellander@webrtc.org9bef5512014-07-13 09:02:54 +0000335
kjellandere40a7ee2016-10-16 23:56:12 -0700336 if (!build_with_chromium && is_clang) {
337 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
ehmaldonado38a21322016-09-02 04:10:34 -0700338 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
aluebs688e3082016-01-14 04:32:46 -0800339 }
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000340}
kjellander@webrtc.orgd7e34e12015-01-26 19:17:26 +0000341
metzmanf89a5712016-07-25 02:14:09 -0700342if (use_libfuzzer || use_drfuzz || use_afl) {
Peter Boström1e0cfd92015-12-17 14:28:16 +0100343 # This target is only here for gn to discover fuzzer build targets under
344 # webrtc/test/fuzzers/.
345 group("webrtc_fuzzers_dummy") {
Peter Boström62e9bda2015-11-23 15:12:06 +0100346 testonly = true
347 deps = [
Peter Boström1e0cfd92015-12-17 14:28:16 +0100348 "test/fuzzers:webrtc_fuzzer_main",
Peter Boström62e9bda2015-11-23 15:12:06 +0100349 ]
350 }
351}
kjellander@webrtc.org3ee56142016-06-03 15:57:02 +0200352
kjellander@webrtc.orgaff499c2016-06-06 23:04:31 +0200353if (rtc_include_tests) {
kjellander@webrtc.org3ee56142016-06-03 15:57:02 +0200354 config("rtc_unittests_config") {
355 # GN orders flags on a target before flags from configs. The default config
356 # adds -Wall, and this flag have to be after -Wall -- so they need to
357 # come from a config and can"t be on the target directly.
358 if (is_clang) {
359 cflags = [
360 "-Wno-missing-braces",
361 "-Wno-sign-compare",
362 "-Wno-unused-const-variable",
363 ]
364 }
365 }
366
ehmaldonado38a21322016-09-02 04:10:34 -0700367 rtc_test("rtc_unittests") {
kjellander@webrtc.org3ee56142016-06-03 15:57:02 +0200368 testonly = true
369 sources = [
Honghai Zhangd93f50c2016-10-05 11:47:22 -0700370 "api/fakemetricsobserver.cc",
minyue69b627d2016-11-24 11:01:09 -0800371 "base/analytics/exp_filter_unittest.cc",
tereliuscb861e02016-11-30 06:51:57 -0800372 "base/analytics/percentile_filter_unittest.cc",
kjellander@webrtc.org3ee56142016-06-03 15:57:02 +0200373 "base/array_view_unittest.cc",
374 "base/atomicops_unittest.cc",
375 "base/autodetectproxy_unittest.cc",
kjellander@webrtc.org3ee56142016-06-03 15:57:02 +0200376 "base/base64_unittest.cc",
377 "base/basictypes_unittest.cc",
378 "base/bind_unittest.cc",
379 "base/bitbuffer_unittest.cc",
380 "base/buffer_unittest.cc",
381 "base/bufferqueue_unittest.cc",
382 "base/bytebuffer_unittest.cc",
383 "base/byteorder_unittest.cc",
384 "base/callback_unittest.cc",
385 "base/copyonwritebuffer_unittest.cc",
386 "base/crc32_unittest.cc",
387 "base/criticalsection_unittest.cc",
388 "base/event_tracer_unittest.cc",
389 "base/event_unittest.cc",
Viktor Palmkvist4ec6a0c2016-09-02 13:38:32 +0200390 "base/file_unittest.cc",
kjellander@webrtc.org3ee56142016-06-03 15:57:02 +0200391 "base/filerotatingstream_unittest.cc",
392 "base/fileutils_unittest.cc",
kwiberg24c7c122016-09-28 11:57:10 -0700393 "base/function_view_unittest.cc",
kjellander@webrtc.org3ee56142016-06-03 15:57:02 +0200394 "base/helpers_unittest.cc",
395 "base/httpbase_unittest.cc",
396 "base/httpcommon_unittest.cc",
397 "base/httpserver_unittest.cc",
398 "base/ipaddress_unittest.cc",
399 "base/logging_unittest.cc",
400 "base/md5digest_unittest.cc",
401 "base/messagedigest_unittest.cc",
402 "base/messagequeue_unittest.cc",
403 "base/mod_ops_unittest.cc",
kjellander@webrtc.org3ee56142016-06-03 15:57:02 +0200404 "base/nat_unittest.cc",
405 "base/network_unittest.cc",
406 "base/onetimeevent_unittest.cc",
407 "base/optional_unittest.cc",
408 "base/optionsfile_unittest.cc",
409 "base/pathutils_unittest.cc",
410 "base/platform_thread_unittest.cc",
kjellander@webrtc.org3ee56142016-06-03 15:57:02 +0200411 "base/proxy_unittest.cc",
412 "base/proxydetect_unittest.cc",
413 "base/random_unittest.cc",
sprangcd349d92016-07-13 09:11:28 -0700414 "base/rate_limiter_unittest.cc",
kjellander@webrtc.org3ee56142016-06-03 15:57:02 +0200415 "base/rate_statistics_unittest.cc",
416 "base/ratelimiter_unittest.cc",
417 "base/ratetracker_unittest.cc",
perkj0489e492016-10-20 00:24:01 -0700418 "base/refcountedobject_unittest.cc",
kjellander@webrtc.org3ee56142016-06-03 15:57:02 +0200419 "base/rollingaccumulator_unittest.cc",
420 "base/rtccertificate_unittest.cc",
421 "base/rtccertificategenerator_unittest.cc",
kwiberg8a44e1d2016-11-01 12:04:26 -0700422 "base/safe_compare_unittest.cc",
kjellander@webrtc.org3ee56142016-06-03 15:57:02 +0200423 "base/scopedptrcollection_unittest.cc",
perkj9c16fe82016-07-12 15:04:07 -0700424 "base/sequenced_task_checker_unittest.cc",
kjellander@webrtc.org3ee56142016-06-03 15:57:02 +0200425 "base/sha1digest_unittest.cc",
426 "base/sharedexclusivelock_unittest.cc",
427 "base/signalthread_unittest.cc",
428 "base/sigslot_unittest.cc",
kjellander1d081002016-12-05 06:14:29 -0800429 "base/sigslottester_unittest.cc",
kjellander@webrtc.org3ee56142016-06-03 15:57:02 +0200430 "base/stream_unittest.cc",
431 "base/stringencode_unittest.cc",
432 "base/stringutils_unittest.cc",
433 "base/swap_queue_unittest.cc",
skvladffb865f2016-12-16 16:48:28 -0800434
435 # TODO(ronghuawu): Reenable this test.
436 # "systeminfo_unittest.cc",
kjellander@webrtc.org3ee56142016-06-03 15:57:02 +0200437 "base/task_queue_unittest.cc",
438 "base/task_unittest.cc",
439 "base/testclient_unittest.cc",
danilchap01404082016-10-24 06:07:25 -0700440 "base/thread_annotations_unittest.cc",
kjellander@webrtc.org3ee56142016-06-03 15:57:02 +0200441 "base/thread_checker_unittest.cc",
442 "base/thread_unittest.cc",
nisse191b3592016-06-22 08:36:53 -0700443 "base/timestampaligner_unittest.cc",
kjellander@webrtc.org3ee56142016-06-03 15:57:02 +0200444 "base/timeutils_unittest.cc",
perkj8ff860a2016-10-03 00:30:04 -0700445 "base/weak_ptr_unittest.cc",
kjellander3283cf92016-10-13 06:35:45 -0700446 "p2p/base/asyncstuntcpsocket_unittest.cc",
kjellander@webrtc.org3ee56142016-06-03 15:57:02 +0200447 "p2p/base/dtlstransportchannel_unittest.cc",
448 "p2p/base/fakeportallocator.h",
449 "p2p/base/faketransportcontroller.h",
deadbeef49f34fd2016-12-06 16:22:06 -0800450 "p2p/base/jseptransport_unittest.cc",
kjellander@webrtc.org3ee56142016-06-03 15:57:02 +0200451 "p2p/base/p2ptransportchannel_unittest.cc",
452 "p2p/base/port_unittest.cc",
453 "p2p/base/portallocator_unittest.cc",
454 "p2p/base/pseudotcp_unittest.cc",
455 "p2p/base/relayport_unittest.cc",
456 "p2p/base/relayserver_unittest.cc",
457 "p2p/base/stun_unittest.cc",
458 "p2p/base/stunport_unittest.cc",
459 "p2p/base/stunrequest_unittest.cc",
460 "p2p/base/stunserver_unittest.cc",
461 "p2p/base/tcpport_unittest.cc",
462 "p2p/base/testrelayserver.h",
463 "p2p/base/teststunserver.h",
464 "p2p/base/testturnserver.h",
kjellander@webrtc.org3ee56142016-06-03 15:57:02 +0200465 "p2p/base/transportcontroller_unittest.cc",
466 "p2p/base/transportdescriptionfactory_unittest.cc",
467 "p2p/base/turnport_unittest.cc",
Taylor Brandstetter734262c2016-08-01 16:37:14 -0700468 "p2p/base/turnserver_unittest.cc",
johan6bedebf2016-11-09 13:44:09 -0800469 "p2p/base/udptransportchannel_unittest.cc",
kjellander@webrtc.org3ee56142016-06-03 15:57:02 +0200470 "p2p/client/basicportallocator_unittest.cc",
471 "p2p/stunprober/stunprober_unittest.cc",
472 ]
473
kjellander@webrtc.org3ee56142016-06-03 15:57:02 +0200474 if (is_win) {
475 sources += [
476 "base/win32_unittest.cc",
kjellander@webrtc.org3ee56142016-06-03 15:57:02 +0200477 "base/win32window_unittest.cc",
kjellander@webrtc.org3ee56142016-06-03 15:57:02 +0200478 ]
479 }
480
481 if (is_mac) {
482 sources += [ "base/macutils_unittest.cc" ]
483 }
484
485 if (is_posix) {
486 sources += [
487 "base/ssladapter_unittest.cc",
488 "base/sslidentity_unittest.cc",
489 "base/sslstreamadapter_unittest.cc",
490 ]
491 }
kjellander@webrtc.org3ee56142016-06-03 15:57:02 +0200492 if (rtc_use_quic) {
493 sources += [
494 "p2p/quic/quicconnectionhelper_unittest.cc",
495 "p2p/quic/quicsession_unittest.cc",
496 "p2p/quic/quictransport_unittest.cc",
497 "p2p/quic/quictransportchannel_unittest.cc",
498 "p2p/quic/reliablequicstream_unittest.cc",
499 ]
500 }
501
ehmaldonado7a2ce0b2016-09-05 01:35:44 -0700502 configs += [ ":rtc_unittests_config" ]
kjellander@webrtc.org3ee56142016-06-03 15:57:02 +0200503
kjellandere40a7ee2016-10-16 23:56:12 -0700504 if (!build_with_chromium && is_clang) {
505 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
ehmaldonado38a21322016-09-02 04:10:34 -0700506 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
kjellander@webrtc.org3ee56142016-06-03 15:57:02 +0200507 }
508
509 deps = [
minyue69b627d2016-11-24 11:01:09 -0800510 "base:rtc_analytics",
kjellander@webrtc.org3ee56142016-06-03 15:57:02 +0200511 "base:rtc_base",
kjellander82a94492016-06-12 22:12:01 -0700512 "base:rtc_base_tests_utils",
kjellander@webrtc.org3ee56142016-06-03 15:57:02 +0200513 "base:rtc_task_queue",
514 "p2p:libstunprober",
515 "p2p:rtc_p2p",
516 "//testing/gmock",
517 "//testing/gtest",
518 ]
519
skvlade9cac752016-09-19 14:42:02 -0700520 if (rtc_enable_protobuf) {
skvladcc91d282016-10-03 18:31:22 -0700521 deps += [ "logging:rtc_event_log_tests" ]
skvlade9cac752016-09-19 14:42:02 -0700522 }
523
kjellander@webrtc.org3ee56142016-06-03 15:57:02 +0200524 if (is_android) {
525 deps += [ "//testing/android/native_test:native_test_support" ]
sakal714dd4e2016-08-15 02:29:11 -0700526 shard_timeout = 900
kjellander@webrtc.org3ee56142016-06-03 15:57:02 +0200527 }
kjellander3bcedd32016-06-08 01:14:15 -0700528
kthelgasoncc2d1c62016-11-09 07:44:27 -0800529 if (is_ios || is_mac) {
kjellander3bcedd32016-06-08 01:14:15 -0700530 deps += [
531 "sdk:rtc_sdk_peerconnection_objc",
532 "system_wrappers:system_wrappers_default",
denicija28c24872016-12-06 05:22:49 -0800533 "//third_party/ocmock",
kjellander3bcedd32016-06-08 01:14:15 -0700534 ]
535 sources += [
536 "sdk/objc/Framework/UnitTests/RTCConfigurationTest.mm",
537 "sdk/objc/Framework/UnitTests/RTCDataChannelConfigurationTest.mm",
538 "sdk/objc/Framework/UnitTests/RTCIceCandidateTest.mm",
539 "sdk/objc/Framework/UnitTests/RTCIceServerTest.mm",
540 "sdk/objc/Framework/UnitTests/RTCMediaConstraintsTest.mm",
541 "sdk/objc/Framework/UnitTests/RTCSessionDescriptionTest.mm",
denicija28c24872016-12-06 05:22:49 -0800542 "sdk/objc/Framework/UnitTests/avformatmappertests.mm",
kjellander3bcedd32016-06-08 01:14:15 -0700543 ]
544
545 # TODO(tkchin): Cleanup this warning.
546 cflags = [ "-Wno-objc-property-no-attribute" ]
547
548 # |-ObjC| flag needed to make sure category method implementations
549 # are included:
550 # https://developer.apple.com/library/mac/qa/qa1490/_index.html
551 ldflags = [ "-ObjC" ]
552 }
kjellander@webrtc.org3ee56142016-06-03 15:57:02 +0200553 }
Peter Boström02083222016-06-14 12:52:54 +0200554
555 # TODO(pbos): Rename test suite, this is no longer "just" for video targets.
ehmaldonado3a7f35b2016-09-14 05:10:01 -0700556 video_engine_tests_resources = [
557 "//resources/foreman_cif_short.yuv",
558 "//resources/voice_engine/audio_long16.pcm",
559 ]
kjellander32c4a202016-08-30 02:53:49 -0700560
561 if (is_ios) {
562 bundle_data("video_engine_tests_bundle_data") {
563 testonly = true
564 sources = video_engine_tests_resources
565 outputs = [
566 "{{bundle_resources_dir}}/{{source_file_part}}",
567 ]
568 }
569 }
570
ehmaldonado38a21322016-09-02 04:10:34 -0700571 rtc_test("video_engine_tests") {
Peter Boström02083222016-06-14 12:52:54 +0200572 testonly = true
573 deps = [
574 "audio:audio_tests",
575 "call:call_tests",
576 "modules/video_capture",
577 "test:test_common",
578 "test:test_main",
579 "video:video_tests",
580 ]
ehmaldonado3a7f35b2016-09-14 05:10:01 -0700581 data = video_engine_tests_resources
kjellandere40a7ee2016-10-16 23:56:12 -0700582 if (!build_with_chromium && is_clang) {
583 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
ehmaldonado38a21322016-09-02 04:10:34 -0700584 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
Peter Boström02083222016-06-14 12:52:54 +0200585 }
sakal714dd4e2016-08-15 02:29:11 -0700586 if (is_android) {
sakal010f0922016-08-18 00:41:59 -0700587 deps += [ "//testing/android/native_test:native_test_native_code" ]
kjellander28a0ffd2016-08-24 07:48:42 -0700588 shard_timeout = 900
589 }
kjellander32c4a202016-08-30 02:53:49 -0700590 if (is_ios) {
591 deps += [ ":video_engine_tests_bundle_data" ]
sakal714dd4e2016-08-15 02:29:11 -0700592 }
Peter Boström02083222016-06-14 12:52:54 +0200593 }
Peter Boströmac968bd2016-06-27 19:31:39 +0200594
ehmaldonado3a7f35b2016-09-14 05:10:01 -0700595 webrtc_perf_tests_resources = [
596 "//resources/audio_coding/speech_mono_16kHz.pcm",
henrik.lundin8c1dd8d2016-12-19 06:18:35 -0800597 "//resources/audio_coding/speech_mono_32_48kHz.pcm",
ehmaldonado3a7f35b2016-09-14 05:10:01 -0700598 "//resources/audio_coding/testfile32kHz.pcm",
599 "//resources/ConferenceMotion_1280_720_50.yuv",
600 "//resources/difficult_photo_1850_1110.yuv",
601 "//resources/foreman_cif.yuv",
602 "//resources/google-wifi-3mbps.rx",
603 "//resources/paris_qcif.yuv",
604 "//resources/photo_1850_1110.yuv",
605 "//resources/presentation_1850_1110.yuv",
606 "//resources/verizon4g-downlink.rx",
607 "//resources/voice_engine/audio_long16.pcm",
608 "//resources/web_screenshot_1850_1110.yuv",
609 ]
kjellander32c4a202016-08-30 02:53:49 -0700610
611 if (is_ios) {
612 bundle_data("webrtc_perf_tests_bundle_data") {
613 testonly = true
614 sources = webrtc_perf_tests_resources
615 outputs = [
616 "{{bundle_resources_dir}}/{{source_file_part}}",
617 ]
618 }
619 }
620
ehmaldonado38a21322016-09-02 04:10:34 -0700621 rtc_test("webrtc_perf_tests") {
ehmaldonado529f83c2016-07-27 08:14:32 -0700622 testonly = true
ehmaldonado7a2ce0b2016-09-05 01:35:44 -0700623 configs += [ ":rtc_unittests_config" ]
ehmaldonado25f32e72016-08-31 08:22:09 -0700624
ehmaldonado529f83c2016-07-27 08:14:32 -0700625 sources = [
626 "call/call_perf_tests.cc",
627 "call/rampup_tests.cc",
628 "call/rampup_tests.h",
henrik.lundin875862c2016-11-22 02:07:54 -0800629 "modules/audio_coding/codecs/opus/opus_complexity_unittest.cc",
ehmaldonado529f83c2016-07-27 08:14:32 -0700630 "modules/audio_coding/neteq/test/neteq_performance_unittest.cc",
631 "modules/audio_processing/audio_processing_performance_unittest.cc",
632 "modules/audio_processing/level_controller/level_controller_complexity_unittest.cc",
ivoc3cfb3ef2016-11-24 04:17:28 -0800633 "modules/audio_processing/residual_echo_detector_complexity_unittest.cc",
ehmaldonado529f83c2016-07-27 08:14:32 -0700634 "modules/remote_bitrate_estimator/remote_bitrate_estimators_test.cc",
brandtraa354c92016-12-01 00:20:06 -0800635 "video/full_stack_tests.cc",
ehmaldonado529f83c2016-07-27 08:14:32 -0700636 ]
637 deps = [
ehmaldonado529f83c2016-07-27 08:14:32 -0700638 "modules/audio_coding:neteq_test_support",
639 "modules/audio_processing",
640 "modules/audio_processing:audioproc_test_utils",
terelius3dcfd642016-10-07 00:39:56 -0700641 "modules/remote_bitrate_estimator:bwe_simulator_lib",
ehmaldonado529f83c2016-07-27 08:14:32 -0700642 "modules/rtp_rtcp",
ehmaldonado529f83c2016-07-27 08:14:32 -0700643 "test:test_common",
644 "test:test_main",
645 "test:test_renderer",
kjellandera3cac052016-10-24 01:52:39 -0700646 "video:video_quality_test",
ehmaldonado529f83c2016-07-27 08:14:32 -0700647 "voice_engine",
648 "//testing/gmock",
649 "//testing/gtest",
650 ]
peahd29e3ea2016-09-13 21:42:39 -0700651
652 if (rtc_enable_intelligibility_enhancer) {
653 defines = [ "WEBRTC_INTELLIGIBILITY_ENHANCER=1" ]
654 } else {
655 defines = [ "WEBRTC_INTELLIGIBILITY_ENHANCER=0" ]
656 }
657
ehmaldonado3a7f35b2016-09-14 05:10:01 -0700658 data = webrtc_perf_tests_resources
ehmaldonado529f83c2016-07-27 08:14:32 -0700659 if (is_android) {
660 deps += [ "//testing/android/native_test:native_test_native_code" ]
sakal714dd4e2016-08-15 02:29:11 -0700661 shard_timeout = 2700
ehmaldonado529f83c2016-07-27 08:14:32 -0700662 }
kjellander32c4a202016-08-30 02:53:49 -0700663 if (is_ios) {
664 deps += [ ":webrtc_perf_tests_bundle_data" ]
665 }
kjellandere40a7ee2016-10-16 23:56:12 -0700666 if (!build_with_chromium && is_clang) {
667 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
ehmaldonado38a21322016-09-02 04:10:34 -0700668 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
ehmaldonado529f83c2016-07-27 08:14:32 -0700669 }
brandtrdd369c62016-11-16 23:56:57 -0800670 if (rtc_use_h264) {
671 defines += [ "WEBRTC_USE_H264" ]
672 }
ehmaldonado529f83c2016-07-27 08:14:32 -0700673 }
674
ehmaldonado38a21322016-09-02 04:10:34 -0700675 rtc_test("webrtc_nonparallel_tests") {
Peter Boströmac968bd2016-06-27 19:31:39 +0200676 testonly = true
ehmaldonado7a2ce0b2016-09-05 01:35:44 -0700677 configs += [ ":rtc_unittests_config" ]
Peter Boströmac968bd2016-06-27 19:31:39 +0200678 sources = [
679 "base/nullsocketserver_unittest.cc",
danilchapb7b9dca2016-08-05 05:55:43 -0700680 "base/physicalsocketserver_unittest.cc",
681 "base/socket_unittest.cc",
682 "base/socket_unittest.h",
Peter Boströmac968bd2016-06-27 19:31:39 +0200683 "base/socketaddress_unittest.cc",
684 "base/virtualsocket_unittest.cc",
685 ]
686 deps = [
687 "base:rtc_base",
688 "base:rtc_base_tests_utils",
689 "//testing/gtest",
690 ]
691 if (is_win) {
danilchapb7b9dca2016-08-05 05:55:43 -0700692 sources += [ "base/win32socketserver_unittest.cc" ]
Peter Boströmac968bd2016-06-27 19:31:39 +0200693 }
694 if (is_android) {
695 deps += [ "//testing/android/native_test:native_test_support" ]
sakal714dd4e2016-08-15 02:29:11 -0700696 shard_timeout = 900
Peter Boströmac968bd2016-06-27 19:31:39 +0200697 }
698
kjellandere40a7ee2016-10-16 23:56:12 -0700699 if (!build_with_chromium && is_clang) {
700 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
ehmaldonado38a21322016-09-02 04:10:34 -0700701 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
Peter Boströmac968bd2016-06-27 19:31:39 +0200702 }
703 }
sakal80a5bf12016-09-16 07:22:17 -0700704
705 if (is_android) {
706 junit_binary("android_junit_tests") {
kjellander4bb04982016-09-19 08:53:23 -0700707 java_files = [
708 "androidjunit/src/org/webrtc/CameraEnumerationTest.java",
709 "examples/androidjunit/src/org/appspot/apprtc/DirectRTCClientTest.java",
710 "examples/androidjunit/src/org/appspot/apprtc/TCPChannelClientTest.java",
henrikac3c2f312016-12-14 07:36:56 -0800711 "examples/androidjunit/src/org/appspot/apprtc/BluetoothManagerTest.java",
kjellander4bb04982016-09-19 08:53:23 -0700712 ]
sakal80a5bf12016-09-16 07:22:17 -0700713
714 deps = [
ehmaldonadoeb5040a2016-09-30 00:20:06 -0700715 "//base:base_java_test_support",
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200716 "//webrtc/examples:AppRTCMobile_javalib",
magjed768c6482016-12-06 04:29:37 -0800717 "//webrtc/sdk/android:libjingle_peerconnection_java",
sakal80a5bf12016-09-16 07:22:17 -0700718 ]
719 }
720 }
kjellander@webrtc.org3ee56142016-06-03 15:57:02 +0200721}