blob: 47b757a237fafa0c8de3bdf438f76edc965af542 [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 }
Zeke Chin71f6f442015-06-29 14:34:58 -070060 if (is_ios && rtc_use_objc_h264) {
61 defines += [ "WEBRTC_OBJC_H264" ]
62 }
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +000063 if (is_linux) {
64 defines += [ "WEBRTC_LINUX" ]
65 }
66 if (is_mac) {
67 defines += [ "WEBRTC_MAC" ]
68 }
69 if (is_win) {
kjellanderf0e174a2016-05-30 06:27:50 -070070 defines += [
71 "WEBRTC_WIN",
72 "_CRT_SECURE_NO_WARNINGS", # Suppress warnings about _vsnprinf
73 ]
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +000074 }
75 if (is_android) {
76 defines += [
77 "WEBRTC_LINUX",
78 "WEBRTC_ANDROID",
79 ]
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +000080 }
kjellanderf0e174a2016-05-30 06:27:50 -070081 if (is_chromeos) {
82 defines += [ "CHROMEOS" ]
83 }
84
Johan Ahlers9ddac182016-07-22 08:57:23 +020085 if (rtc_sanitize_coverage != "") {
86 assert(is_clang, "sanitizer coverage requires clang")
87 cflags += [ "-fsanitize-coverage=${rtc_sanitize_coverage}" ]
88 ldflags += [ "-fsanitize-coverage=${rtc_sanitize_coverage}" ]
89 }
90
kjellanderf0e174a2016-05-30 06:27:50 -070091 # TODO(GYP): Support these in GN.
92 # if (is_bsd) {
93 # defines += [ "BSD" ]
94 # }
95 # if (is_openbsd) {
96 # defines += [ "OPENBSD" ]
97 # }
98 # if (is_freebsd) {
99 # defines += [ "FREEBSD" ]
100 # }
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000101}
102
kjellander@webrtc.org6d08ca62014-09-07 17:36:10 +0000103if (rtc_have_dbus_glib) {
kjellander@webrtc.org7497fa72014-06-28 18:05:22 +0000104 pkg_config("dbus-glib") {
105 packages = [ "dbus-glib-1" ]
106 }
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000107}
108
109config("common_config") {
kjellander@webrtc.org79ee97c2014-09-04 14:10:49 +0000110 cflags = []
111 cflags_cc = []
kjellanderf0e174a2016-05-30 06:27:50 -0700112 defines = []
113
kjellander@webrtc.org6d08ca62014-09-07 17:36:10 +0000114 if (rtc_restrict_logging) {
kjellanderf0e174a2016-05-30 06:27:50 -0700115 defines += [ "WEBRTC_RESTRICT_LOGGING" ]
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000116 }
117
kjellander82a94492016-06-12 22:12:01 -0700118 if (rtc_include_internal_audio_device) {
119 defines += [ "WEBRTC_INCLUDE_INTERNAL_AUDIO_DEVICE" ]
120 }
121
kjellander@webrtc.org6d08ca62014-09-07 17:36:10 +0000122 if (rtc_have_dbus_glib) {
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000123 defines += [ "HAVE_DBUS_GLIB" ]
Henrik Kjellander57e5fd22015-05-25 12:55:39 +0200124
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000125 # TODO(kjellander): Investigate this, it seems like include <dbus/dbus.h>
126 # is still not found even if the execution of
127 # build/config/linux/pkg-config.py dbus-glib-1 returns correct include
128 # dirs on Linux.
129 all_dependent_configs = [ "dbus-glib" ]
130 }
131
kjellanderc76dc952016-06-03 03:09:32 -0700132 if (rtc_relative_path) {
133 defines += [ "EXPAT_RELATIVE_PATH" ]
134 }
135
brettw@chromium.org9fe11012014-09-09 19:15:33 +0000136 if (build_with_chromium) {
kjellanderf0e174a2016-05-30 06:27:50 -0700137 defines += [
138 # NOTICE: Since common_inherited_config is used in public_configs for our
139 # targets, there's no point including the defines in that config here.
140 # TODO(kjellander): Cleanup unused ones and move defines closer to the
141 # source when webrtc:4256 is completed.
142 "ENABLE_EXTERNAL_AUTH",
143 "HAVE_OPENSSL_SSL_H",
144 "HAVE_SCTP",
145 "HAVE_SRTP",
146 "HAVE_WEBRTC_VIDEO",
147 "HAVE_WEBRTC_VOICE",
148 "LOGGING_INSIDE_WEBRTC",
149 "SRTP_RELATIVE_PATH",
150 "SSL_USE_OPENSSL",
151 "USE_WEBRTC_DEV_BRANCH",
152 ]
brettw@chromium.org9fe11012014-09-09 19:15:33 +0000153 } else {
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000154 if (is_posix) {
155 # -Wextra is currently disabled in Chromium"s common.gypi. Enable
156 # for targets that can handle it. For Android/arm64 right now
157 # there will be an "enumeral and non-enumeral type in conditional
158 # expression" warning in android_tools/ndk_experimental"s version
159 # of stlport.
160 # See: https://code.google.com/p/chromium/issues/detail?id=379699
kjellander@webrtc.org72273912015-02-23 19:08:31 +0000161 if (current_cpu != "arm64" || !is_android) {
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000162 cflags = [
163 "-Wextra",
Henrik Kjellander57e5fd22015-05-25 12:55:39 +0200164
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000165 # We need to repeat some flags from Chromium"s common.gypi
166 # here that get overridden by -Wextra.
167 "-Wno-unused-parameter",
168 "-Wno-missing-field-initializers",
169 "-Wno-strict-overflow",
170 ]
171 cflags_cc = [
172 "-Wnon-virtual-dtor",
Henrik Kjellander57e5fd22015-05-25 12:55:39 +0200173
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000174 # This is enabled for clang; enable for gcc as well.
175 "-Woverloaded-virtual",
176 ]
177 }
178 }
179
180 if (is_clang) {
kjellander3f032cf2016-04-27 07:13:46 -0700181 cflags += [
182 "-Wimplicit-fallthrough",
183 "-Wthread-safety",
nisse4996eaa2016-05-10 23:28:10 -0700184 "-Winconsistent-missing-override",
kjellander3f032cf2016-04-27 07:13:46 -0700185 ]
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000186 }
187 }
188
kjellander@webrtc.org72273912015-02-23 19:08:31 +0000189 if (current_cpu == "arm64") {
Andrew MacDonaldcb7f8ce2015-05-19 22:20:17 -0700190 defines += [ "WEBRTC_ARCH_ARM64" ]
191 defines += [ "WEBRTC_HAS_NEON" ]
tkchin@webrtc.org14146e42014-10-31 00:14:39 +0000192 }
193
kjellander@webrtc.org72273912015-02-23 19:08:31 +0000194 if (current_cpu == "arm") {
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000195 defines += [ "WEBRTC_ARCH_ARM" ]
andrew@webrtc.orga56a2c52014-11-26 17:01:40 +0000196 if (arm_version >= 7) {
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000197 defines += [ "WEBRTC_ARCH_ARM_V7" ]
198 if (arm_use_neon) {
Andrew MacDonaldcb7f8ce2015-05-19 22:20:17 -0700199 defines += [ "WEBRTC_HAS_NEON" ]
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000200 }
201 }
202 }
203
kjellander@webrtc.org72273912015-02-23 19:08:31 +0000204 if (current_cpu == "mipsel") {
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000205 defines += [ "MIPS32_LE" ]
kjellander@webrtc.org6dab6d72015-03-04 09:50:31 +0000206 if (mips_float_abi == "hard") {
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000207 defines += [ "MIPS_FPU_LE" ]
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000208 }
kjellander@webrtc.orgacb80852015-01-25 19:17:56 +0000209 if (mips_arch_variant == "r2") {
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000210 defines += [ "MIPS32_R2_LE" ]
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000211 }
212 if (mips_dsp_rev == 1) {
213 defines += [ "MIPS_DSP_R1_LE" ]
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000214 } else if (mips_dsp_rev == 2) {
215 defines += [
216 "MIPS_DSP_R1_LE",
217 "MIPS_DSP_R2_LE",
218 ]
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000219 }
220 }
221
Henrik Kjellanderc0c7d2e2015-09-07 12:57:42 +0200222 if (is_android && !is_clang) {
Henrik Kjellander5bfc6cb2015-09-21 16:50:45 +0200223 # The Android NDK doesn"t provide optimized versions of these
224 # functions. Ensure they are disabled for all compilers.
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000225 cflags += [
226 "-fno-builtin-cos",
227 "-fno-builtin-sin",
228 "-fno-builtin-cosf",
229 "-fno-builtin-sinf",
230 ]
231 }
katrielcbf81d682016-05-26 01:03:02 -0700232
metzmanf89a5712016-07-25 02:14:09 -0700233 if (use_libfuzzer || use_drfuzz || use_afl) {
katrielcbf81d682016-05-26 01:03:02 -0700234 # Used in Chromium's overrides to disable logging
235 defines += [ "WEBRTC_UNSAFE_FUZZER_MODE" ]
236 }
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000237}
238
kjellander3bcedd32016-06-08 01:14:15 -0700239config("common_objc") {
tkchin2ddfdba2016-08-07 21:37:45 -0700240 libs = [ "Foundation.framework" ]
kjellander3bcedd32016-06-08 01:14:15 -0700241 precompiled_header = "sdk/objc/WebRTC-Prefix.pch"
242 precompiled_source = "sdk/objc/WebRTC-Prefix.pch"
243}
244
Nico Weber3ab32dc2016-08-02 09:53:25 -0400245if (!is_ios || !build_with_chromium) {
ehmaldonado38a21322016-09-02 04:10:34 -0700246 rtc_source_set("webrtc") {
Nico Weber3ab32dc2016-08-02 09:53:25 -0400247 sources = [
248 "call.h",
249 "config.h",
250 "transport.h",
kjellander94cee312016-06-10 01:56:57 -0700251 ]
Bjorn Terelius36411852015-07-30 12:45:18 +0200252
Nico Weber3ab32dc2016-08-02 09:53:25 -0400253 defines = []
Nico Weber3ab32dc2016-08-02 09:53:25 -0400254
255 deps = [
256 ":webrtc_common",
257 "audio",
258 "base:rtc_base",
259 "call",
260 "common_audio",
261 "common_video",
262 "modules",
hbos615d3012016-08-24 01:33:13 -0700263 "stats",
Nico Weber3ab32dc2016-08-02 09:53:25 -0400264 "system_wrappers",
265 "tools",
266 "video",
267 "voice_engine",
268 ]
269
270 if (build_with_chromium) {
271 deps += [ "modules/video_capture" ]
272 } else {
273 # TODO(kjellander): Enable for Chromium as well when bugs.webrtc.org/4256
274 # is fixed. Right now it's not possible due to circular dependencies.
275 deps += [
276 "api",
277 "media",
278 "p2p",
279 "pc",
280 ]
281 }
282
283 if (rtc_enable_protobuf) {
284 defines += [ "ENABLE_RTC_EVENT_LOG" ]
285 deps += [ ":rtc_event_log_proto" ]
286 }
Bjorn Terelius36411852015-07-30 12:45:18 +0200287 }
kjellander@webrtc.org1227ab82014-06-23 19:21:07 +0000288}
289
ehmaldonado38a21322016-09-02 04:10:34 -0700290rtc_source_set("webrtc_common") {
kjellander@webrtc.org1227ab82014-06-23 19:21:07 +0000291 sources = [
kwiberg@webrtc.orgac2d27d2015-02-26 13:59:22 +0000292 "common_types.cc",
kjellander@webrtc.orgd7e34e12015-01-26 19:17:26 +0000293 "common_types.h",
kjellander@webrtc.org1227ab82014-06-23 19:21:07 +0000294 "config.cc",
Henrik Kjellander57e5fd22015-05-25 12:55:39 +0200295 "config.h",
kjellander@webrtc.orgd7e34e12015-01-26 19:17:26 +0000296 "engine_configurations.h",
297 "typedefs.h",
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000298 ]
kjellander@webrtc.org9bef5512014-07-13 09:02:54 +0000299
aluebs688e3082016-01-14 04:32:46 -0800300 if (is_clang && !is_nacl) {
301 # Suppress warnings from Chrome's Clang plugins.
302 # See http://code.google.com/p/webrtc/issues/detail?id=163 for details.
ehmaldonado38a21322016-09-02 04:10:34 -0700303 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
aluebs688e3082016-01-14 04:32:46 -0800304 }
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000305}
kjellander@webrtc.orgd7e34e12015-01-26 19:17:26 +0000306
Bjorn Terelius36411852015-07-30 12:45:18 +0200307if (rtc_enable_protobuf) {
308 proto_library("rtc_event_log_proto") {
309 sources = [
Peter Boström5c389d32015-09-25 13:58:30 +0200310 "call/rtc_event_log.proto",
Bjorn Terelius36411852015-07-30 12:45:18 +0200311 ]
Peter Boström5c389d32015-09-25 13:58:30 +0200312 proto_out_dir = "webrtc/call"
Bjorn Terelius36411852015-07-30 12:45:18 +0200313 }
314}
315
ehmaldonado38a21322016-09-02 04:10:34 -0700316rtc_source_set("rtc_event_log") {
Bjorn Terelius36411852015-07-30 12:45:18 +0200317 sources = [
Peter Boström5c389d32015-09-25 13:58:30 +0200318 "call/rtc_event_log.cc",
319 "call/rtc_event_log.h",
terelius4311ba52016-04-22 12:40:37 -0700320 "call/rtc_event_log_helper_thread.cc",
321 "call/rtc_event_log_helper_thread.h",
Bjorn Terelius36411852015-07-30 12:45:18 +0200322 ]
323
324 defines = []
Bjorn Terelius36411852015-07-30 12:45:18 +0200325
326 deps = [
327 ":webrtc_common",
sakal06bfe1f2016-08-04 07:54:04 -0700328 "modules/rtp_rtcp",
Bjorn Terelius36411852015-07-30 12:45:18 +0200329 ]
330
331 if (rtc_enable_protobuf) {
332 defines += [ "ENABLE_RTC_EVENT_LOG" ]
333 deps += [ ":rtc_event_log_proto" ]
334 }
sergeyu4df08ff2015-09-02 14:22:40 -0700335 if (is_clang && !is_nacl) {
Bjorn Terelius36411852015-07-30 12:45:18 +0200336 # Suppress warnings from Chrome's Clang plugins.
337 # See http://code.google.com/p/webrtc/issues/detail?id=163 for details.
ehmaldonado38a21322016-09-02 04:10:34 -0700338 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
Bjorn Terelius36411852015-07-30 12:45:18 +0200339 }
340}
Peter Boström62e9bda2015-11-23 15:12:06 +0100341
tereliusd5c1a0b2016-05-13 00:42:59 -0700342if (rtc_enable_protobuf) {
ehmaldonado38a21322016-09-02 04:10:34 -0700343 rtc_source_set("rtc_event_log_parser") {
tereliusd5c1a0b2016-05-13 00:42:59 -0700344 sources = [
345 "call/rtc_event_log_parser.cc",
346 "call/rtc_event_log_parser.h",
347 ]
348
terelius54ce6802016-07-13 06:44:41 -0700349 public_deps = [
tereliusd5c1a0b2016-05-13 00:42:59 -0700350 ":rtc_event_log_proto",
351 ":webrtc_common",
352 ]
353
354 if (is_clang && !is_nacl) {
355 # Suppress warnings from Chrome's Clang plugins.
356 # See http://code.google.com/p/webrtc/issues/detail?id=163 for details.
ehmaldonado38a21322016-09-02 04:10:34 -0700357 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
tereliusd5c1a0b2016-05-13 00:42:59 -0700358 }
359 }
360}
361
metzmanf89a5712016-07-25 02:14:09 -0700362if (use_libfuzzer || use_drfuzz || use_afl) {
Peter Boström1e0cfd92015-12-17 14:28:16 +0100363 # This target is only here for gn to discover fuzzer build targets under
364 # webrtc/test/fuzzers/.
365 group("webrtc_fuzzers_dummy") {
Peter Boström62e9bda2015-11-23 15:12:06 +0100366 testonly = true
367 deps = [
Peter Boström1e0cfd92015-12-17 14:28:16 +0100368 "test/fuzzers:webrtc_fuzzer_main",
Peter Boström62e9bda2015-11-23 15:12:06 +0100369 ]
370 }
371}
kjellander@webrtc.org3ee56142016-06-03 15:57:02 +0200372
kjellander@webrtc.orgaff499c2016-06-06 23:04:31 +0200373if (rtc_include_tests) {
kjellander@webrtc.org3ee56142016-06-03 15:57:02 +0200374 config("rtc_unittests_config") {
375 # GN orders flags on a target before flags from configs. The default config
376 # adds -Wall, and this flag have to be after -Wall -- so they need to
377 # come from a config and can"t be on the target directly.
378 if (is_clang) {
379 cflags = [
380 "-Wno-missing-braces",
381 "-Wno-sign-compare",
382 "-Wno-unused-const-variable",
383 ]
384 }
385 }
386
ehmaldonado38a21322016-09-02 04:10:34 -0700387 rtc_test("rtc_unittests") {
kjellander@webrtc.org3ee56142016-06-03 15:57:02 +0200388 testonly = true
389 sources = [
390 "base/array_view_unittest.cc",
391 "base/atomicops_unittest.cc",
392 "base/autodetectproxy_unittest.cc",
393 "base/bandwidthsmoother_unittest.cc",
394 "base/base64_unittest.cc",
395 "base/basictypes_unittest.cc",
396 "base/bind_unittest.cc",
397 "base/bitbuffer_unittest.cc",
398 "base/buffer_unittest.cc",
399 "base/bufferqueue_unittest.cc",
400 "base/bytebuffer_unittest.cc",
401 "base/byteorder_unittest.cc",
402 "base/callback_unittest.cc",
403 "base/copyonwritebuffer_unittest.cc",
404 "base/crc32_unittest.cc",
405 "base/criticalsection_unittest.cc",
406 "base/event_tracer_unittest.cc",
407 "base/event_unittest.cc",
408 "base/exp_filter_unittest.cc",
Viktor Palmkvist4ec6a0c2016-09-02 13:38:32 +0200409 "base/file_unittest.cc",
kjellander@webrtc.org3ee56142016-06-03 15:57:02 +0200410 "base/filerotatingstream_unittest.cc",
411 "base/fileutils_unittest.cc",
412 "base/helpers_unittest.cc",
413 "base/httpbase_unittest.cc",
414 "base/httpcommon_unittest.cc",
415 "base/httpserver_unittest.cc",
416 "base/ipaddress_unittest.cc",
417 "base/logging_unittest.cc",
418 "base/md5digest_unittest.cc",
419 "base/messagedigest_unittest.cc",
420 "base/messagequeue_unittest.cc",
421 "base/mod_ops_unittest.cc",
422 "base/multipart_unittest.cc",
423 "base/nat_unittest.cc",
424 "base/network_unittest.cc",
425 "base/onetimeevent_unittest.cc",
426 "base/optional_unittest.cc",
427 "base/optionsfile_unittest.cc",
428 "base/pathutils_unittest.cc",
429 "base/platform_thread_unittest.cc",
430 "base/profiler_unittest.cc",
431 "base/proxy_unittest.cc",
432 "base/proxydetect_unittest.cc",
433 "base/random_unittest.cc",
sprangcd349d92016-07-13 09:11:28 -0700434 "base/rate_limiter_unittest.cc",
kjellander@webrtc.org3ee56142016-06-03 15:57:02 +0200435 "base/rate_statistics_unittest.cc",
436 "base/ratelimiter_unittest.cc",
437 "base/ratetracker_unittest.cc",
438 "base/referencecountedsingletonfactory_unittest.cc",
439 "base/rollingaccumulator_unittest.cc",
440 "base/rtccertificate_unittest.cc",
441 "base/rtccertificategenerator_unittest.cc",
442 "base/scopedptrcollection_unittest.cc",
perkj9c16fe82016-07-12 15:04:07 -0700443 "base/sequenced_task_checker_unittest.cc",
kjellander@webrtc.org3ee56142016-06-03 15:57:02 +0200444 "base/sha1digest_unittest.cc",
445 "base/sharedexclusivelock_unittest.cc",
446 "base/signalthread_unittest.cc",
447 "base/sigslot_unittest.cc",
448 "base/sigslottester.h",
449 "base/sigslottester.h.pump",
450 "base/stream_unittest.cc",
451 "base/stringencode_unittest.cc",
452 "base/stringutils_unittest.cc",
453 "base/swap_queue_unittest.cc",
454
455 # TODO(ronghuawu): Reenable this test.
456 # "systeminfo_unittest.cc",
457 "base/task_queue_unittest.cc",
458 "base/task_unittest.cc",
459 "base/testclient_unittest.cc",
460 "base/thread_checker_unittest.cc",
461 "base/thread_unittest.cc",
nisse191b3592016-06-22 08:36:53 -0700462 "base/timestampaligner_unittest.cc",
kjellander@webrtc.org3ee56142016-06-03 15:57:02 +0200463 "base/timeutils_unittest.cc",
464 "base/urlencode_unittest.cc",
465 "base/versionparsing_unittest.cc",
466
467 # TODO(ronghuawu): Reenable this test.
468 # "windowpicker_unittest.cc",
469 "p2p/base/dtlstransportchannel_unittest.cc",
470 "p2p/base/fakeportallocator.h",
471 "p2p/base/faketransportcontroller.h",
472 "p2p/base/p2ptransportchannel_unittest.cc",
473 "p2p/base/port_unittest.cc",
474 "p2p/base/portallocator_unittest.cc",
475 "p2p/base/pseudotcp_unittest.cc",
476 "p2p/base/relayport_unittest.cc",
477 "p2p/base/relayserver_unittest.cc",
478 "p2p/base/stun_unittest.cc",
479 "p2p/base/stunport_unittest.cc",
480 "p2p/base/stunrequest_unittest.cc",
481 "p2p/base/stunserver_unittest.cc",
482 "p2p/base/tcpport_unittest.cc",
483 "p2p/base/testrelayserver.h",
484 "p2p/base/teststunserver.h",
485 "p2p/base/testturnserver.h",
486 "p2p/base/transport_unittest.cc",
487 "p2p/base/transportcontroller_unittest.cc",
488 "p2p/base/transportdescriptionfactory_unittest.cc",
489 "p2p/base/turnport_unittest.cc",
Taylor Brandstetter734262c2016-08-01 16:37:14 -0700490 "p2p/base/turnserver_unittest.cc",
kjellander@webrtc.org3ee56142016-06-03 15:57:02 +0200491 "p2p/client/basicportallocator_unittest.cc",
492 "p2p/stunprober/stunprober_unittest.cc",
493 ]
494
495 if (is_linux) {
496 sources += [
497 "base/latebindingsymboltable_unittest.cc",
498
499 # TODO(ronghuawu): Reenable this test.
500 # "linux_unittest.cc",
501 "base/linuxfdwalk_unittest.cc",
502 ]
503 }
504
505 if (is_win) {
506 sources += [
507 "base/win32_unittest.cc",
508 "base/win32regkey_unittest.cc",
509 "base/win32window_unittest.cc",
510 "base/win32windowpicker_unittest.cc",
511 "base/winfirewall_unittest.cc",
512 ]
513 }
514
515 if (is_mac) {
516 sources += [ "base/macutils_unittest.cc" ]
517 }
518
519 if (is_posix) {
520 sources += [
521 "base/ssladapter_unittest.cc",
522 "base/sslidentity_unittest.cc",
523 "base/sslstreamadapter_unittest.cc",
524 ]
525 }
kjellander@webrtc.org3ee56142016-06-03 15:57:02 +0200526 if (rtc_use_quic) {
527 sources += [
528 "p2p/quic/quicconnectionhelper_unittest.cc",
529 "p2p/quic/quicsession_unittest.cc",
530 "p2p/quic/quictransport_unittest.cc",
531 "p2p/quic/quictransportchannel_unittest.cc",
532 "p2p/quic/reliablequicstream_unittest.cc",
533 ]
534 }
535
ehmaldonado7a2ce0b2016-09-05 01:35:44 -0700536 configs += [ ":rtc_unittests_config" ]
kjellander@webrtc.org3ee56142016-06-03 15:57:02 +0200537
538 if (is_clang) {
539 # Suppress warnings from the Chromium Clang plugin.
540 # See http://code.google.com/p/webrtc/issues/detail?id=163 for details.
ehmaldonado38a21322016-09-02 04:10:34 -0700541 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
kjellander@webrtc.org3ee56142016-06-03 15:57:02 +0200542 }
543
544 deps = [
545 "base:rtc_base",
kjellander82a94492016-06-12 22:12:01 -0700546 "base:rtc_base_tests_utils",
kjellander@webrtc.org3ee56142016-06-03 15:57:02 +0200547 "base:rtc_task_queue",
548 "p2p:libstunprober",
549 "p2p:rtc_p2p",
550 "//testing/gmock",
551 "//testing/gtest",
552 ]
553
skvlade9cac752016-09-19 14:42:02 -0700554 if (rtc_enable_protobuf) {
555 deps += [ "call:rtc_event_log_tests" ]
556 }
557
kjellander@webrtc.org3ee56142016-06-03 15:57:02 +0200558 if (is_android) {
559 deps += [ "//testing/android/native_test:native_test_support" ]
sakal714dd4e2016-08-15 02:29:11 -0700560 shard_timeout = 900
kjellander@webrtc.org3ee56142016-06-03 15:57:02 +0200561 }
kjellander3bcedd32016-06-08 01:14:15 -0700562
563 if (is_ios || (is_mac && mac_deployment_target == "10.7")) {
564 deps += [
565 "sdk:rtc_sdk_peerconnection_objc",
566 "system_wrappers:system_wrappers_default",
567 ]
568 sources += [
569 "sdk/objc/Framework/UnitTests/RTCConfigurationTest.mm",
570 "sdk/objc/Framework/UnitTests/RTCDataChannelConfigurationTest.mm",
571 "sdk/objc/Framework/UnitTests/RTCIceCandidateTest.mm",
572 "sdk/objc/Framework/UnitTests/RTCIceServerTest.mm",
573 "sdk/objc/Framework/UnitTests/RTCMediaConstraintsTest.mm",
574 "sdk/objc/Framework/UnitTests/RTCSessionDescriptionTest.mm",
575 ]
576
577 # TODO(tkchin): Cleanup this warning.
578 cflags = [ "-Wno-objc-property-no-attribute" ]
579
580 # |-ObjC| flag needed to make sure category method implementations
581 # are included:
582 # https://developer.apple.com/library/mac/qa/qa1490/_index.html
583 ldflags = [ "-ObjC" ]
584 }
kjellander@webrtc.org3ee56142016-06-03 15:57:02 +0200585 }
Peter Boström02083222016-06-14 12:52:54 +0200586
ehmaldonado38a21322016-09-02 04:10:34 -0700587 rtc_test("xmllite_xmpp_unittests") {
ehmaldonado7a2ce0b2016-09-05 01:35:44 -0700588 configs += [ ":rtc_unittests_config" ]
charujain604fc112016-08-04 01:16:39 -0700589
590 if (is_clang) {
591 # Suppress warnings from the Chromium Clang plugin.
592 # See http://code.google.com/p/webrtc/issues/detail?id=163 for details.
ehmaldonado38a21322016-09-02 04:10:34 -0700593 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
charujain604fc112016-08-04 01:16:39 -0700594 }
595
596 deps = [
597 "base:rtc_base_tests_utils",
598 "libjingle/xmllite:rtc_xmllite",
599 "libjingle/xmpp:rtc_xmpp",
600 "//testing/gtest",
601 ]
602
603 sources = [
604 "libjingle/xmllite/qname_unittest.cc",
605 "libjingle/xmllite/xmlbuilder_unittest.cc",
606 "libjingle/xmllite/xmlelement_unittest.cc",
607 "libjingle/xmllite/xmlnsstack_unittest.cc",
608 "libjingle/xmllite/xmlparser_unittest.cc",
609 "libjingle/xmllite/xmlprinter_unittest.cc",
610 "libjingle/xmpp/fakexmppclient.h",
611 "libjingle/xmpp/hangoutpubsubclient_unittest.cc",
612 "libjingle/xmpp/jid_unittest.cc",
613 "libjingle/xmpp/mucroomconfigtask_unittest.cc",
614 "libjingle/xmpp/mucroomdiscoverytask_unittest.cc",
615 "libjingle/xmpp/mucroomlookuptask_unittest.cc",
616 "libjingle/xmpp/mucroomuniquehangoutidtask_unittest.cc",
617 "libjingle/xmpp/pingtask_unittest.cc",
618 "libjingle/xmpp/pubsubclient_unittest.cc",
619 "libjingle/xmpp/pubsubtasks_unittest.cc",
620 "libjingle/xmpp/util_unittest.cc",
621 "libjingle/xmpp/util_unittest.h",
622 "libjingle/xmpp/xmppengine_unittest.cc",
623 "libjingle/xmpp/xmpplogintask_unittest.cc",
624 "libjingle/xmpp/xmppstanzaparser_unittest.cc",
625 ]
626 }
627
Peter Boström02083222016-06-14 12:52:54 +0200628 # TODO(pbos): Rename test suite, this is no longer "just" for video targets.
ehmaldonado3a7f35b2016-09-14 05:10:01 -0700629 video_engine_tests_resources = [
630 "//resources/foreman_cif_short.yuv",
631 "//resources/voice_engine/audio_long16.pcm",
632 ]
kjellander32c4a202016-08-30 02:53:49 -0700633
634 if (is_ios) {
635 bundle_data("video_engine_tests_bundle_data") {
636 testonly = true
637 sources = video_engine_tests_resources
638 outputs = [
639 "{{bundle_resources_dir}}/{{source_file_part}}",
640 ]
641 }
642 }
643
ehmaldonado38a21322016-09-02 04:10:34 -0700644 rtc_test("video_engine_tests") {
Peter Boström02083222016-06-14 12:52:54 +0200645 testonly = true
646 deps = [
647 "audio:audio_tests",
648 "call:call_tests",
649 "modules/video_capture",
650 "test:test_common",
651 "test:test_main",
652 "video:video_tests",
653 ]
ehmaldonado3a7f35b2016-09-14 05:10:01 -0700654 data = video_engine_tests_resources
Peter Boström02083222016-06-14 12:52:54 +0200655 if (is_clang) {
656 # Suppress warnings from the Chromium Clang plugin.
657 # See http://code.google.com/p/webrtc/issues/detail?id=163 for details.
ehmaldonado38a21322016-09-02 04:10:34 -0700658 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
Peter Boström02083222016-06-14 12:52:54 +0200659 }
sakal714dd4e2016-08-15 02:29:11 -0700660 if (is_android) {
sakal010f0922016-08-18 00:41:59 -0700661 deps += [ "//testing/android/native_test:native_test_native_code" ]
kjellander28a0ffd2016-08-24 07:48:42 -0700662 shard_timeout = 900
663 }
kjellander32c4a202016-08-30 02:53:49 -0700664
665 if (is_ios) {
666 deps += [ ":video_engine_tests_bundle_data" ]
sakal714dd4e2016-08-15 02:29:11 -0700667 }
Peter Boström02083222016-06-14 12:52:54 +0200668 }
Peter Boströmac968bd2016-06-27 19:31:39 +0200669
ehmaldonado38a21322016-09-02 04:10:34 -0700670 rtc_source_set("video_quality_test") {
ehmaldonado529f83c2016-07-27 08:14:32 -0700671 testonly = true
ehmaldonado529f83c2016-07-27 08:14:32 -0700672 sources = [
673 "video/video_quality_test.cc",
674 "video/video_quality_test.h",
675 ]
676 deps = [
677 ":webrtc",
678 "system_wrappers",
679 "//testing/gtest",
680 ]
681 if (!is_android) {
682 deps += [ "modules/video_capture:video_capture_internal_impl" ]
683 }
684 if (is_clang) {
685 # Suppress warnings from the Chromium Clang plugin.
686 # See http://code.google.com/p/webrtc/issues/detail?id=163 for details.
ehmaldonado38a21322016-09-02 04:10:34 -0700687 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
ehmaldonado529f83c2016-07-27 08:14:32 -0700688 }
689 }
690
ehmaldonado3a7f35b2016-09-14 05:10:01 -0700691 webrtc_perf_tests_resources = [
692 "//resources/audio_coding/speech_mono_16kHz.pcm",
693 "//resources/audio_coding/testfile32kHz.pcm",
694 "//resources/ConferenceMotion_1280_720_50.yuv",
695 "//resources/difficult_photo_1850_1110.yuv",
696 "//resources/foreman_cif.yuv",
697 "//resources/google-wifi-3mbps.rx",
698 "//resources/paris_qcif.yuv",
699 "//resources/photo_1850_1110.yuv",
700 "//resources/presentation_1850_1110.yuv",
701 "//resources/verizon4g-downlink.rx",
702 "//resources/voice_engine/audio_long16.pcm",
703 "//resources/web_screenshot_1850_1110.yuv",
704 ]
kjellander32c4a202016-08-30 02:53:49 -0700705
706 if (is_ios) {
707 bundle_data("webrtc_perf_tests_bundle_data") {
708 testonly = true
709 sources = webrtc_perf_tests_resources
710 outputs = [
711 "{{bundle_resources_dir}}/{{source_file_part}}",
712 ]
713 }
714 }
715
charujainbb723e52016-09-13 05:52:48 -0700716 rtc_executable("webrtc_tests") {
717 testonly = true
718 deps = [
719 ":webrtc",
720 "modules/video_capture:video_capture_internal_impl",
721 "test",
722 ]
723 }
724
725 rtc_executable("video_loopback") {
726 testonly = true
727 sources = [
728 "test/run_test.h",
729 "video/video_loopback.cc",
730 ]
731
732 if (is_mac) {
733 sources += [ "test/mac/run_test.mm" ]
734 } else {
735 sources += [ "test/run_test.cc" ]
736 }
737 deps = [
738 ":video_quality_test",
739 "system_wrappers:metrics_default",
740 "test:field_trial",
741 "test:test_common",
742 "test:test_renderer",
743 "//testing/gmock",
744 "//testing/gtest",
745 "//third_party/gflags",
746 ]
747 if (is_clang && !is_nacl) {
748 # Suppress warnings from Chrome's Clang plugins.
749 # See http://code.google.com/p/webrtc/issues/detail?id=163 for details.
750 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
751 }
752 }
753
ehmaldonado38a21322016-09-02 04:10:34 -0700754 rtc_test("webrtc_perf_tests") {
ehmaldonado529f83c2016-07-27 08:14:32 -0700755 testonly = true
ehmaldonado7a2ce0b2016-09-05 01:35:44 -0700756 configs += [ ":rtc_unittests_config" ]
ehmaldonado25f32e72016-08-31 08:22:09 -0700757
ehmaldonado529f83c2016-07-27 08:14:32 -0700758 sources = [
759 "call/call_perf_tests.cc",
760 "call/rampup_tests.cc",
761 "call/rampup_tests.h",
762 "modules/audio_coding/neteq/test/neteq_performance_unittest.cc",
763 "modules/audio_processing/audio_processing_performance_unittest.cc",
764 "modules/audio_processing/level_controller/level_controller_complexity_unittest.cc",
765 "modules/remote_bitrate_estimator/remote_bitrate_estimators_test.cc",
766 "video/full_stack.cc",
767 ]
768 deps = [
769 ":video_quality_test",
770 ":webrtc",
771 "modules/audio_coding:neteq_test_support",
772 "modules/audio_processing",
773 "modules/audio_processing:audioproc_test_utils",
774 "modules/remote_bitrate_estimator:bwe_simulator",
775 "modules/rtp_rtcp",
ehmaldonado529f83c2016-07-27 08:14:32 -0700776 "test:test_common",
777 "test:test_main",
778 "test:test_renderer",
779 "voice_engine",
780 "//testing/gmock",
781 "//testing/gtest",
782 ]
peahd29e3ea2016-09-13 21:42:39 -0700783
784 if (rtc_enable_intelligibility_enhancer) {
785 defines = [ "WEBRTC_INTELLIGIBILITY_ENHANCER=1" ]
786 } else {
787 defines = [ "WEBRTC_INTELLIGIBILITY_ENHANCER=0" ]
788 }
789
ehmaldonado3a7f35b2016-09-14 05:10:01 -0700790 data = webrtc_perf_tests_resources
ehmaldonado529f83c2016-07-27 08:14:32 -0700791 if (is_android) {
792 deps += [ "//testing/android/native_test:native_test_native_code" ]
sakal714dd4e2016-08-15 02:29:11 -0700793 shard_timeout = 2700
ehmaldonado529f83c2016-07-27 08:14:32 -0700794 }
kjellander32c4a202016-08-30 02:53:49 -0700795 if (is_ios) {
796 deps += [ ":webrtc_perf_tests_bundle_data" ]
797 }
ehmaldonado529f83c2016-07-27 08:14:32 -0700798 if (is_clang) {
799 # Suppress warnings from the Chromium Clang plugin.
800 # See http://code.google.com/p/webrtc/issues/detail?id=163 for details.
ehmaldonado38a21322016-09-02 04:10:34 -0700801 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
ehmaldonado529f83c2016-07-27 08:14:32 -0700802 }
803 }
804
ehmaldonado38a21322016-09-02 04:10:34 -0700805 rtc_test("webrtc_nonparallel_tests") {
Peter Boströmac968bd2016-06-27 19:31:39 +0200806 testonly = true
ehmaldonado7a2ce0b2016-09-05 01:35:44 -0700807 configs += [ ":rtc_unittests_config" ]
Peter Boströmac968bd2016-06-27 19:31:39 +0200808 sources = [
809 "base/nullsocketserver_unittest.cc",
danilchapb7b9dca2016-08-05 05:55:43 -0700810 "base/physicalsocketserver_unittest.cc",
811 "base/socket_unittest.cc",
812 "base/socket_unittest.h",
Peter Boströmac968bd2016-06-27 19:31:39 +0200813 "base/socketaddress_unittest.cc",
814 "base/virtualsocket_unittest.cc",
815 ]
816 deps = [
817 "base:rtc_base",
818 "base:rtc_base_tests_utils",
819 "//testing/gtest",
820 ]
821 if (is_win) {
danilchapb7b9dca2016-08-05 05:55:43 -0700822 sources += [ "base/win32socketserver_unittest.cc" ]
Peter Boströmac968bd2016-06-27 19:31:39 +0200823 }
824 if (is_android) {
825 deps += [ "//testing/android/native_test:native_test_support" ]
sakal714dd4e2016-08-15 02:29:11 -0700826 shard_timeout = 900
Peter Boströmac968bd2016-06-27 19:31:39 +0200827 }
828
829 if (is_mac) {
830 sources += [ "base/macsocketserver_unittest.cc" ]
831 }
Peter Boströmac968bd2016-06-27 19:31:39 +0200832 if (is_clang) {
833 # Suppress warnings from the Chromium Clang plugin.
834 # See http://code.google.com/p/webrtc/issues/detail?id=163 for details.
ehmaldonado38a21322016-09-02 04:10:34 -0700835 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
Peter Boströmac968bd2016-06-27 19:31:39 +0200836 }
837 }
sakal80a5bf12016-09-16 07:22:17 -0700838
839 if (is_android) {
840 junit_binary("android_junit_tests") {
kjellander4bb04982016-09-19 08:53:23 -0700841 java_files = [
842 "androidjunit/src/org/webrtc/CameraEnumerationTest.java",
843 "examples/androidjunit/src/org/appspot/apprtc/DirectRTCClientTest.java",
844 "examples/androidjunit/src/org/appspot/apprtc/TCPChannelClientTest.java",
845 ]
sakal80a5bf12016-09-16 07:22:17 -0700846
847 deps = [
848 "//webrtc/api:libjingle_peerconnection_java",
849 "//webrtc/api:libjingle_peerconnection_jni",
magjed87ef6f72016-09-22 10:15:15 -0700850 "//webrtc/examples:AppRTCDemo_javalib",
sakal80a5bf12016-09-16 07:22:17 -0700851 ]
852 }
853 }
kjellander@webrtc.org3ee56142016-06-03 15:57:02 +0200854}