blob: ae109a14352669e38b56ec69a56ab5f05baa3d33 [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")
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +000015
16# Contains the defines and includes in common.gypi that are duplicated both as
17# target_defaults and direct_dependent_settings.
18config("common_inherited_config") {
19 defines = []
Johan Ahlers9ddac182016-07-22 08:57:23 +020020 cflags = []
21 ldflags = []
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +000022 if (build_with_mozilla) {
23 defines += [ "WEBRTC_MOZILLA_BUILD" ]
24 }
25 if (build_with_chromium) {
kjellanderf0e174a2016-05-30 06:27:50 -070026 defines = [
27 # TODO(kjellander): Cleanup unused ones and move defines closer to
28 # the source when webrtc:4256 is completed.
29 "FEATURE_ENABLE_SSL",
30 "FEATURE_ENABLE_VOICEMAIL",
31 "EXPAT_RELATIVE_PATH",
32 "GTEST_RELATIVE_PATH",
33 "NO_MAIN_THREAD_WRAPPING",
34 "NO_SOUND_SYSTEM",
35 "WEBRTC_CHROMIUM_BUILD",
36 ]
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +000037 include_dirs = [
henrikgee2bf412015-09-30 03:48:52 -070038 # The overrides must be included first as that is the mechanism for
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +000039 # selecting the override headers in Chromium.
henrikgee2bf412015-09-30 03:48:52 -070040 "../webrtc_overrides",
Henrik Kjellander57e5fd22015-05-25 12:55:39 +020041
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +000042 # Allow includes to be prefixed with webrtc/ in case it is not an
43 # immediate subdirectory of the top-level.
44 "..",
45 ]
46 }
47 if (is_posix) {
48 defines += [ "WEBRTC_POSIX" ]
49 }
50 if (is_ios) {
51 defines += [
52 "WEBRTC_MAC",
53 "WEBRTC_IOS",
54 ]
55 }
Zeke Chin71f6f442015-06-29 14:34:58 -070056 if (is_ios && rtc_use_objc_h264) {
57 defines += [ "WEBRTC_OBJC_H264" ]
58 }
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +000059 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.org6d08ca62014-09-07 17:36:10 +000099if (rtc_have_dbus_glib) {
kjellander@webrtc.org7497fa72014-06-28 18:05:22 +0000100 pkg_config("dbus-glib") {
101 packages = [ "dbus-glib-1" ]
102 }
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000103}
104
105config("common_config") {
kjellander@webrtc.org79ee97c2014-09-04 14:10:49 +0000106 cflags = []
107 cflags_cc = []
kjellanderf0e174a2016-05-30 06:27:50 -0700108 defines = []
109
kjellander@webrtc.org6d08ca62014-09-07 17:36:10 +0000110 if (rtc_restrict_logging) {
kjellanderf0e174a2016-05-30 06:27:50 -0700111 defines += [ "WEBRTC_RESTRICT_LOGGING" ]
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000112 }
113
kjellander82a94492016-06-12 22:12:01 -0700114 if (rtc_include_internal_audio_device) {
115 defines += [ "WEBRTC_INCLUDE_INTERNAL_AUDIO_DEVICE" ]
116 }
117
kjellander@webrtc.org6d08ca62014-09-07 17:36:10 +0000118 if (rtc_have_dbus_glib) {
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000119 defines += [ "HAVE_DBUS_GLIB" ]
Henrik Kjellander57e5fd22015-05-25 12:55:39 +0200120
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000121 # TODO(kjellander): Investigate this, it seems like include <dbus/dbus.h>
122 # is still not found even if the execution of
123 # build/config/linux/pkg-config.py dbus-glib-1 returns correct include
124 # dirs on Linux.
125 all_dependent_configs = [ "dbus-glib" ]
126 }
127
kjellanderc76dc952016-06-03 03:09:32 -0700128 if (rtc_relative_path) {
129 defines += [ "EXPAT_RELATIVE_PATH" ]
130 }
131
brettw@chromium.org9fe11012014-09-09 19:15:33 +0000132 if (build_with_chromium) {
kjellanderf0e174a2016-05-30 06:27:50 -0700133 defines += [
134 # NOTICE: Since common_inherited_config is used in public_configs for our
135 # targets, there's no point including the defines in that config here.
136 # TODO(kjellander): Cleanup unused ones and move defines closer to the
137 # source when webrtc:4256 is completed.
138 "ENABLE_EXTERNAL_AUTH",
139 "HAVE_OPENSSL_SSL_H",
140 "HAVE_SCTP",
141 "HAVE_SRTP",
142 "HAVE_WEBRTC_VIDEO",
143 "HAVE_WEBRTC_VOICE",
144 "LOGGING_INSIDE_WEBRTC",
145 "SRTP_RELATIVE_PATH",
146 "SSL_USE_OPENSSL",
147 "USE_WEBRTC_DEV_BRANCH",
148 ]
brettw@chromium.org9fe11012014-09-09 19:15:33 +0000149 } else {
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000150 if (is_posix) {
151 # -Wextra is currently disabled in Chromium"s common.gypi. Enable
152 # for targets that can handle it. For Android/arm64 right now
153 # there will be an "enumeral and non-enumeral type in conditional
154 # expression" warning in android_tools/ndk_experimental"s version
155 # of stlport.
156 # See: https://code.google.com/p/chromium/issues/detail?id=379699
kjellander@webrtc.org72273912015-02-23 19:08:31 +0000157 if (current_cpu != "arm64" || !is_android) {
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000158 cflags = [
159 "-Wextra",
Henrik Kjellander57e5fd22015-05-25 12:55:39 +0200160
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000161 # We need to repeat some flags from Chromium"s common.gypi
162 # here that get overridden by -Wextra.
163 "-Wno-unused-parameter",
164 "-Wno-missing-field-initializers",
165 "-Wno-strict-overflow",
166 ]
167 cflags_cc = [
168 "-Wnon-virtual-dtor",
Henrik Kjellander57e5fd22015-05-25 12:55:39 +0200169
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000170 # This is enabled for clang; enable for gcc as well.
171 "-Woverloaded-virtual",
172 ]
173 }
174 }
175
176 if (is_clang) {
kjellander3f032cf2016-04-27 07:13:46 -0700177 cflags += [
178 "-Wimplicit-fallthrough",
179 "-Wthread-safety",
nisse4996eaa2016-05-10 23:28:10 -0700180 "-Winconsistent-missing-override",
kjellander3f032cf2016-04-27 07:13:46 -0700181 ]
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000182 }
183 }
184
kjellander@webrtc.org72273912015-02-23 19:08:31 +0000185 if (current_cpu == "arm64") {
Andrew MacDonaldcb7f8ce2015-05-19 22:20:17 -0700186 defines += [ "WEBRTC_ARCH_ARM64" ]
187 defines += [ "WEBRTC_HAS_NEON" ]
tkchin@webrtc.org14146e42014-10-31 00:14:39 +0000188 }
189
kjellander@webrtc.org72273912015-02-23 19:08:31 +0000190 if (current_cpu == "arm") {
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000191 defines += [ "WEBRTC_ARCH_ARM" ]
andrew@webrtc.orga56a2c52014-11-26 17:01:40 +0000192 if (arm_version >= 7) {
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000193 defines += [ "WEBRTC_ARCH_ARM_V7" ]
194 if (arm_use_neon) {
Andrew MacDonaldcb7f8ce2015-05-19 22:20:17 -0700195 defines += [ "WEBRTC_HAS_NEON" ]
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000196 }
197 }
198 }
199
kjellander@webrtc.org72273912015-02-23 19:08:31 +0000200 if (current_cpu == "mipsel") {
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000201 defines += [ "MIPS32_LE" ]
kjellander@webrtc.org6dab6d72015-03-04 09:50:31 +0000202 if (mips_float_abi == "hard") {
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000203 defines += [ "MIPS_FPU_LE" ]
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000204 }
kjellander@webrtc.orgacb80852015-01-25 19:17:56 +0000205 if (mips_arch_variant == "r2") {
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000206 defines += [ "MIPS32_R2_LE" ]
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000207 }
208 if (mips_dsp_rev == 1) {
209 defines += [ "MIPS_DSP_R1_LE" ]
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000210 } else if (mips_dsp_rev == 2) {
211 defines += [
212 "MIPS_DSP_R1_LE",
213 "MIPS_DSP_R2_LE",
214 ]
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000215 }
216 }
217
Henrik Kjellanderc0c7d2e2015-09-07 12:57:42 +0200218 if (is_android && !is_clang) {
Henrik Kjellander5bfc6cb2015-09-21 16:50:45 +0200219 # The Android NDK doesn"t provide optimized versions of these
220 # functions. Ensure they are disabled for all compilers.
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000221 cflags += [
222 "-fno-builtin-cos",
223 "-fno-builtin-sin",
224 "-fno-builtin-cosf",
225 "-fno-builtin-sinf",
226 ]
227 }
katrielcbf81d682016-05-26 01:03:02 -0700228
metzmanf89a5712016-07-25 02:14:09 -0700229 if (use_libfuzzer || use_drfuzz || use_afl) {
katrielcbf81d682016-05-26 01:03:02 -0700230 # Used in Chromium's overrides to disable logging
231 defines += [ "WEBRTC_UNSAFE_FUZZER_MODE" ]
232 }
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000233}
234
kjellander3bcedd32016-06-08 01:14:15 -0700235config("common_objc") {
tkchin2ddfdba2016-08-07 21:37:45 -0700236 libs = [ "Foundation.framework" ]
kjellander3bcedd32016-06-08 01:14:15 -0700237 precompiled_header = "sdk/objc/WebRTC-Prefix.pch"
238 precompiled_source = "sdk/objc/WebRTC-Prefix.pch"
239}
240
Nico Weber3ab32dc2016-08-02 09:53:25 -0400241if (!is_ios || !build_with_chromium) {
ehmaldonado38a21322016-09-02 04:10:34 -0700242 rtc_source_set("webrtc") {
Nico Weber3ab32dc2016-08-02 09:53:25 -0400243 sources = [
244 "call.h",
245 "config.h",
246 "transport.h",
kjellander94cee312016-06-10 01:56:57 -0700247 ]
Bjorn Terelius36411852015-07-30 12:45:18 +0200248
Nico Weber3ab32dc2016-08-02 09:53:25 -0400249 defines = []
250 configs += [ ":common_config" ]
251 public_configs = [ ":common_inherited_config" ]
252
253 deps = [
254 ":webrtc_common",
255 "audio",
256 "base:rtc_base",
257 "call",
258 "common_audio",
259 "common_video",
260 "modules",
hbos615d3012016-08-24 01:33:13 -0700261 "stats",
Nico Weber3ab32dc2016-08-02 09:53:25 -0400262 "system_wrappers",
263 "tools",
264 "video",
265 "voice_engine",
266 ]
267
268 if (build_with_chromium) {
269 deps += [ "modules/video_capture" ]
270 } else {
271 # TODO(kjellander): Enable for Chromium as well when bugs.webrtc.org/4256
272 # is fixed. Right now it's not possible due to circular dependencies.
273 deps += [
274 "api",
275 "media",
276 "p2p",
277 "pc",
278 ]
279 }
280
281 if (rtc_enable_protobuf) {
282 defines += [ "ENABLE_RTC_EVENT_LOG" ]
283 deps += [ ":rtc_event_log_proto" ]
284 }
Bjorn Terelius36411852015-07-30 12:45:18 +0200285 }
kjellander@webrtc.org1227ab82014-06-23 19:21:07 +0000286}
287
kjellander@webrtc.orgb8caf6a2014-09-30 18:05:02 +0000288if (!build_with_chromium) {
ehmaldonado38a21322016-09-02 04:10:34 -0700289 rtc_executable("webrtc_tests") {
kjellander@webrtc.orgb8caf6a2014-09-30 18:05:02 +0000290 testonly = true
291 deps = [
292 ":webrtc",
kjellander@webrtc.orgb8caf6a2014-09-30 18:05:02 +0000293 "modules/video_capture:video_capture_internal_impl",
294 "test",
295 ]
296 }
stefan3ab66142016-08-15 06:29:10 -0700297
ehmaldonado38a21322016-09-02 04:10:34 -0700298 rtc_executable("video_loopback") {
stefan3ab66142016-08-15 06:29:10 -0700299 testonly = true
300 sources = [
301 "test/run_test.h",
302 "video/video_loopback.cc",
303 ]
304
305 if (is_mac) {
306 sources += [ "test/mac/run_test.mm" ]
307 } else {
308 sources += [ "test/run_test.cc" ]
309 }
310 deps = [
311 ":video_quality_test",
312 "system_wrappers:metrics_default",
313 "test:field_trial",
314 "test:test_common",
315 "test:test_renderer",
316 "//testing/gmock",
317 "//testing/gtest",
318 "//third_party/gflags",
319 ]
320 if (is_clang && !is_nacl) {
321 # Suppress warnings from Chrome's Clang plugins.
322 # See http://code.google.com/p/webrtc/issues/detail?id=163 for details.
ehmaldonado38a21322016-09-02 04:10:34 -0700323 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
stefan3ab66142016-08-15 06:29:10 -0700324 }
325 }
kjellander@webrtc.orgb8caf6a2014-09-30 18:05:02 +0000326}
327
ehmaldonado38a21322016-09-02 04:10:34 -0700328rtc_source_set("webrtc_common") {
kjellander@webrtc.org1227ab82014-06-23 19:21:07 +0000329 sources = [
kjellander@webrtc.org50772f12016-02-29 06:49:43 +0100330 "audio_sink.h",
kwiberg65fc8b92016-08-29 10:05:24 -0700331 "common.cc",
332 "common.h",
kwiberg@webrtc.orgac2d27d2015-02-26 13:59:22 +0000333 "common_types.cc",
kjellander@webrtc.orgd7e34e12015-01-26 19:17:26 +0000334 "common_types.h",
kjellander@webrtc.org1227ab82014-06-23 19:21:07 +0000335 "config.cc",
Henrik Kjellander57e5fd22015-05-25 12:55:39 +0200336 "config.h",
kjellander@webrtc.orgd7e34e12015-01-26 19:17:26 +0000337 "engine_configurations.h",
338 "typedefs.h",
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000339 ]
kjellander@webrtc.org9bef5512014-07-13 09:02:54 +0000340
kjellander@webrtc.orgf21ea912014-09-28 17:37:22 +0000341 configs += [ ":common_config" ]
342 public_configs = [ ":common_inherited_config" ]
aluebs688e3082016-01-14 04:32:46 -0800343
344 if (is_clang && !is_nacl) {
345 # Suppress warnings from Chrome's Clang plugins.
346 # See http://code.google.com/p/webrtc/issues/detail?id=163 for details.
ehmaldonado38a21322016-09-02 04:10:34 -0700347 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
aluebs688e3082016-01-14 04:32:46 -0800348 }
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000349}
kjellander@webrtc.orgd7e34e12015-01-26 19:17:26 +0000350
Bjorn Terelius36411852015-07-30 12:45:18 +0200351if (rtc_enable_protobuf) {
352 proto_library("rtc_event_log_proto") {
353 sources = [
Peter Boström5c389d32015-09-25 13:58:30 +0200354 "call/rtc_event_log.proto",
Bjorn Terelius36411852015-07-30 12:45:18 +0200355 ]
Peter Boström5c389d32015-09-25 13:58:30 +0200356 proto_out_dir = "webrtc/call"
Bjorn Terelius36411852015-07-30 12:45:18 +0200357 }
358}
359
ehmaldonado38a21322016-09-02 04:10:34 -0700360rtc_source_set("rtc_event_log") {
Bjorn Terelius36411852015-07-30 12:45:18 +0200361 sources = [
Peter Boström5c389d32015-09-25 13:58:30 +0200362 "call/rtc_event_log.cc",
363 "call/rtc_event_log.h",
terelius4311ba52016-04-22 12:40:37 -0700364 "call/rtc_event_log_helper_thread.cc",
365 "call/rtc_event_log_helper_thread.h",
Bjorn Terelius36411852015-07-30 12:45:18 +0200366 ]
367
368 defines = []
369 configs += [ ":common_config" ]
370 public_configs = [ ":common_inherited_config" ]
371
372 deps = [
373 ":webrtc_common",
sakal06bfe1f2016-08-04 07:54:04 -0700374 "modules/rtp_rtcp",
Bjorn Terelius36411852015-07-30 12:45:18 +0200375 ]
376
377 if (rtc_enable_protobuf) {
378 defines += [ "ENABLE_RTC_EVENT_LOG" ]
379 deps += [ ":rtc_event_log_proto" ]
380 }
sergeyu4df08ff2015-09-02 14:22:40 -0700381 if (is_clang && !is_nacl) {
Bjorn Terelius36411852015-07-30 12:45:18 +0200382 # Suppress warnings from Chrome's Clang plugins.
383 # See http://code.google.com/p/webrtc/issues/detail?id=163 for details.
ehmaldonado38a21322016-09-02 04:10:34 -0700384 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
Bjorn Terelius36411852015-07-30 12:45:18 +0200385 }
386}
Peter Boström62e9bda2015-11-23 15:12:06 +0100387
tereliusd5c1a0b2016-05-13 00:42:59 -0700388if (rtc_enable_protobuf) {
ehmaldonado38a21322016-09-02 04:10:34 -0700389 rtc_source_set("rtc_event_log_parser") {
tereliusd5c1a0b2016-05-13 00:42:59 -0700390 sources = [
391 "call/rtc_event_log_parser.cc",
392 "call/rtc_event_log_parser.h",
393 ]
394
395 configs += [ ":common_config" ]
396 public_configs = [ ":common_inherited_config" ]
397
terelius54ce6802016-07-13 06:44:41 -0700398 public_deps = [
tereliusd5c1a0b2016-05-13 00:42:59 -0700399 ":rtc_event_log_proto",
400 ":webrtc_common",
401 ]
402
403 if (is_clang && !is_nacl) {
404 # Suppress warnings from Chrome's Clang plugins.
405 # See http://code.google.com/p/webrtc/issues/detail?id=163 for details.
ehmaldonado38a21322016-09-02 04:10:34 -0700406 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
tereliusd5c1a0b2016-05-13 00:42:59 -0700407 }
408 }
409}
410
metzmanf89a5712016-07-25 02:14:09 -0700411if (use_libfuzzer || use_drfuzz || use_afl) {
Peter Boström1e0cfd92015-12-17 14:28:16 +0100412 # This target is only here for gn to discover fuzzer build targets under
413 # webrtc/test/fuzzers/.
414 group("webrtc_fuzzers_dummy") {
Peter Boström62e9bda2015-11-23 15:12:06 +0100415 testonly = true
416 deps = [
Peter Boström1e0cfd92015-12-17 14:28:16 +0100417 "test/fuzzers:webrtc_fuzzer_main",
Peter Boström62e9bda2015-11-23 15:12:06 +0100418 ]
419 }
420}
kjellander@webrtc.org3ee56142016-06-03 15:57:02 +0200421
kjellander@webrtc.orgaff499c2016-06-06 23:04:31 +0200422if (rtc_include_tests) {
kjellander@webrtc.org3ee56142016-06-03 15:57:02 +0200423 config("rtc_unittests_config") {
424 # GN orders flags on a target before flags from configs. The default config
425 # adds -Wall, and this flag have to be after -Wall -- so they need to
426 # come from a config and can"t be on the target directly.
427 if (is_clang) {
428 cflags = [
429 "-Wno-missing-braces",
430 "-Wno-sign-compare",
431 "-Wno-unused-const-variable",
432 ]
433 }
434 }
435
ehmaldonado38a21322016-09-02 04:10:34 -0700436 rtc_test("rtc_unittests") {
kjellander@webrtc.org3ee56142016-06-03 15:57:02 +0200437 testonly = true
438 sources = [
439 "base/array_view_unittest.cc",
440 "base/atomicops_unittest.cc",
441 "base/autodetectproxy_unittest.cc",
442 "base/bandwidthsmoother_unittest.cc",
443 "base/base64_unittest.cc",
444 "base/basictypes_unittest.cc",
445 "base/bind_unittest.cc",
446 "base/bitbuffer_unittest.cc",
447 "base/buffer_unittest.cc",
448 "base/bufferqueue_unittest.cc",
449 "base/bytebuffer_unittest.cc",
450 "base/byteorder_unittest.cc",
451 "base/callback_unittest.cc",
452 "base/copyonwritebuffer_unittest.cc",
453 "base/crc32_unittest.cc",
454 "base/criticalsection_unittest.cc",
455 "base/event_tracer_unittest.cc",
456 "base/event_unittest.cc",
457 "base/exp_filter_unittest.cc",
Viktor Palmkvist4ec6a0c2016-09-02 13:38:32 +0200458 "base/file_unittest.cc",
kjellander@webrtc.org3ee56142016-06-03 15:57:02 +0200459 "base/filerotatingstream_unittest.cc",
460 "base/fileutils_unittest.cc",
461 "base/helpers_unittest.cc",
462 "base/httpbase_unittest.cc",
463 "base/httpcommon_unittest.cc",
464 "base/httpserver_unittest.cc",
465 "base/ipaddress_unittest.cc",
466 "base/logging_unittest.cc",
467 "base/md5digest_unittest.cc",
468 "base/messagedigest_unittest.cc",
469 "base/messagequeue_unittest.cc",
470 "base/mod_ops_unittest.cc",
471 "base/multipart_unittest.cc",
472 "base/nat_unittest.cc",
473 "base/network_unittest.cc",
474 "base/onetimeevent_unittest.cc",
475 "base/optional_unittest.cc",
476 "base/optionsfile_unittest.cc",
477 "base/pathutils_unittest.cc",
478 "base/platform_thread_unittest.cc",
479 "base/profiler_unittest.cc",
480 "base/proxy_unittest.cc",
481 "base/proxydetect_unittest.cc",
482 "base/random_unittest.cc",
sprangcd349d92016-07-13 09:11:28 -0700483 "base/rate_limiter_unittest.cc",
kjellander@webrtc.org3ee56142016-06-03 15:57:02 +0200484 "base/rate_statistics_unittest.cc",
485 "base/ratelimiter_unittest.cc",
486 "base/ratetracker_unittest.cc",
487 "base/referencecountedsingletonfactory_unittest.cc",
488 "base/rollingaccumulator_unittest.cc",
489 "base/rtccertificate_unittest.cc",
490 "base/rtccertificategenerator_unittest.cc",
491 "base/scopedptrcollection_unittest.cc",
perkj9c16fe82016-07-12 15:04:07 -0700492 "base/sequenced_task_checker_unittest.cc",
kjellander@webrtc.org3ee56142016-06-03 15:57:02 +0200493 "base/sha1digest_unittest.cc",
494 "base/sharedexclusivelock_unittest.cc",
495 "base/signalthread_unittest.cc",
496 "base/sigslot_unittest.cc",
497 "base/sigslottester.h",
498 "base/sigslottester.h.pump",
499 "base/stream_unittest.cc",
500 "base/stringencode_unittest.cc",
501 "base/stringutils_unittest.cc",
502 "base/swap_queue_unittest.cc",
503
504 # TODO(ronghuawu): Reenable this test.
505 # "systeminfo_unittest.cc",
506 "base/task_queue_unittest.cc",
507 "base/task_unittest.cc",
508 "base/testclient_unittest.cc",
509 "base/thread_checker_unittest.cc",
510 "base/thread_unittest.cc",
nisse191b3592016-06-22 08:36:53 -0700511 "base/timestampaligner_unittest.cc",
kjellander@webrtc.org3ee56142016-06-03 15:57:02 +0200512 "base/timeutils_unittest.cc",
513 "base/urlencode_unittest.cc",
514 "base/versionparsing_unittest.cc",
515
516 # TODO(ronghuawu): Reenable this test.
517 # "windowpicker_unittest.cc",
518 "p2p/base/dtlstransportchannel_unittest.cc",
519 "p2p/base/fakeportallocator.h",
520 "p2p/base/faketransportcontroller.h",
521 "p2p/base/p2ptransportchannel_unittest.cc",
522 "p2p/base/port_unittest.cc",
523 "p2p/base/portallocator_unittest.cc",
524 "p2p/base/pseudotcp_unittest.cc",
525 "p2p/base/relayport_unittest.cc",
526 "p2p/base/relayserver_unittest.cc",
527 "p2p/base/stun_unittest.cc",
528 "p2p/base/stunport_unittest.cc",
529 "p2p/base/stunrequest_unittest.cc",
530 "p2p/base/stunserver_unittest.cc",
531 "p2p/base/tcpport_unittest.cc",
532 "p2p/base/testrelayserver.h",
533 "p2p/base/teststunserver.h",
534 "p2p/base/testturnserver.h",
535 "p2p/base/transport_unittest.cc",
536 "p2p/base/transportcontroller_unittest.cc",
537 "p2p/base/transportdescriptionfactory_unittest.cc",
538 "p2p/base/turnport_unittest.cc",
Taylor Brandstetter734262c2016-08-01 16:37:14 -0700539 "p2p/base/turnserver_unittest.cc",
kjellander@webrtc.org3ee56142016-06-03 15:57:02 +0200540 "p2p/client/basicportallocator_unittest.cc",
541 "p2p/stunprober/stunprober_unittest.cc",
542 ]
543
544 if (is_linux) {
545 sources += [
546 "base/latebindingsymboltable_unittest.cc",
547
548 # TODO(ronghuawu): Reenable this test.
549 # "linux_unittest.cc",
550 "base/linuxfdwalk_unittest.cc",
551 ]
552 }
553
554 if (is_win) {
555 sources += [
556 "base/win32_unittest.cc",
557 "base/win32regkey_unittest.cc",
558 "base/win32window_unittest.cc",
559 "base/win32windowpicker_unittest.cc",
560 "base/winfirewall_unittest.cc",
561 ]
562 }
563
564 if (is_mac) {
565 sources += [ "base/macutils_unittest.cc" ]
566 }
567
568 if (is_posix) {
569 sources += [
570 "base/ssladapter_unittest.cc",
571 "base/sslidentity_unittest.cc",
572 "base/sslstreamadapter_unittest.cc",
573 ]
574 }
575 if (is_ios || (is_mac && target_cpu != "x86")) {
576 defines = [ "CARBON_DEPRECATED=YES" ]
577 }
578
579 if (rtc_use_quic) {
580 sources += [
581 "p2p/quic/quicconnectionhelper_unittest.cc",
582 "p2p/quic/quicsession_unittest.cc",
583 "p2p/quic/quictransport_unittest.cc",
584 "p2p/quic/quictransportchannel_unittest.cc",
585 "p2p/quic/reliablequicstream_unittest.cc",
586 ]
587 }
588
589 configs += [
590 ":common_config",
591 ":rtc_unittests_config",
592 ]
593 public_configs = [ ":common_inherited_config" ]
594
595 if (is_clang) {
596 # Suppress warnings from the Chromium Clang plugin.
597 # See http://code.google.com/p/webrtc/issues/detail?id=163 for details.
ehmaldonado38a21322016-09-02 04:10:34 -0700598 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
kjellander@webrtc.org3ee56142016-06-03 15:57:02 +0200599 }
600
601 deps = [
602 "base:rtc_base",
kjellander82a94492016-06-12 22:12:01 -0700603 "base:rtc_base_tests_utils",
kjellander@webrtc.org3ee56142016-06-03 15:57:02 +0200604 "base:rtc_task_queue",
605 "p2p:libstunprober",
606 "p2p:rtc_p2p",
607 "//testing/gmock",
608 "//testing/gtest",
609 ]
610
611 if (is_android) {
612 deps += [ "//testing/android/native_test:native_test_support" ]
sakal714dd4e2016-08-15 02:29:11 -0700613 shard_timeout = 900
kjellander@webrtc.org3ee56142016-06-03 15:57:02 +0200614 }
kjellander3bcedd32016-06-08 01:14:15 -0700615
616 if (is_ios || (is_mac && mac_deployment_target == "10.7")) {
617 deps += [
618 "sdk:rtc_sdk_peerconnection_objc",
619 "system_wrappers:system_wrappers_default",
620 ]
621 sources += [
622 "sdk/objc/Framework/UnitTests/RTCConfigurationTest.mm",
623 "sdk/objc/Framework/UnitTests/RTCDataChannelConfigurationTest.mm",
624 "sdk/objc/Framework/UnitTests/RTCIceCandidateTest.mm",
625 "sdk/objc/Framework/UnitTests/RTCIceServerTest.mm",
626 "sdk/objc/Framework/UnitTests/RTCMediaConstraintsTest.mm",
627 "sdk/objc/Framework/UnitTests/RTCSessionDescriptionTest.mm",
628 ]
629
630 # TODO(tkchin): Cleanup this warning.
631 cflags = [ "-Wno-objc-property-no-attribute" ]
632
633 # |-ObjC| flag needed to make sure category method implementations
634 # are included:
635 # https://developer.apple.com/library/mac/qa/qa1490/_index.html
636 ldflags = [ "-ObjC" ]
637 }
kjellander@webrtc.org3ee56142016-06-03 15:57:02 +0200638 }
Peter Boström02083222016-06-14 12:52:54 +0200639
ehmaldonado38a21322016-09-02 04:10:34 -0700640 rtc_test("xmllite_xmpp_unittests") {
charujain604fc112016-08-04 01:16:39 -0700641 configs += [
642 ":common_config",
643 ":rtc_unittests_config",
644 ]
645 public_configs = [ ":common_inherited_config" ]
646
647 if (is_clang) {
648 # Suppress warnings from the Chromium Clang plugin.
649 # See http://code.google.com/p/webrtc/issues/detail?id=163 for details.
ehmaldonado38a21322016-09-02 04:10:34 -0700650 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
charujain604fc112016-08-04 01:16:39 -0700651 }
652
653 deps = [
654 "base:rtc_base_tests_utils",
655 "libjingle/xmllite:rtc_xmllite",
656 "libjingle/xmpp:rtc_xmpp",
657 "//testing/gtest",
658 ]
659
660 sources = [
661 "libjingle/xmllite/qname_unittest.cc",
662 "libjingle/xmllite/xmlbuilder_unittest.cc",
663 "libjingle/xmllite/xmlelement_unittest.cc",
664 "libjingle/xmllite/xmlnsstack_unittest.cc",
665 "libjingle/xmllite/xmlparser_unittest.cc",
666 "libjingle/xmllite/xmlprinter_unittest.cc",
667 "libjingle/xmpp/fakexmppclient.h",
668 "libjingle/xmpp/hangoutpubsubclient_unittest.cc",
669 "libjingle/xmpp/jid_unittest.cc",
670 "libjingle/xmpp/mucroomconfigtask_unittest.cc",
671 "libjingle/xmpp/mucroomdiscoverytask_unittest.cc",
672 "libjingle/xmpp/mucroomlookuptask_unittest.cc",
673 "libjingle/xmpp/mucroomuniquehangoutidtask_unittest.cc",
674 "libjingle/xmpp/pingtask_unittest.cc",
675 "libjingle/xmpp/pubsubclient_unittest.cc",
676 "libjingle/xmpp/pubsubtasks_unittest.cc",
677 "libjingle/xmpp/util_unittest.cc",
678 "libjingle/xmpp/util_unittest.h",
679 "libjingle/xmpp/xmppengine_unittest.cc",
680 "libjingle/xmpp/xmpplogintask_unittest.cc",
681 "libjingle/xmpp/xmppstanzaparser_unittest.cc",
682 ]
683 }
684
Peter Boström02083222016-06-14 12:52:54 +0200685 # TODO(pbos): Rename test suite, this is no longer "just" for video targets.
kjellander32c4a202016-08-30 02:53:49 -0700686 if (is_android || is_ios) {
687 video_engine_tests_resources = [
688 "//resources/foreman_cif_short.yuv",
689 "//resources/voice_engine/audio_long16.pcm",
690 ]
691 }
692
693 if (is_ios) {
694 bundle_data("video_engine_tests_bundle_data") {
695 testonly = true
696 sources = video_engine_tests_resources
697 outputs = [
698 "{{bundle_resources_dir}}/{{source_file_part}}",
699 ]
700 }
701 }
702
ehmaldonado38a21322016-09-02 04:10:34 -0700703 rtc_test("video_engine_tests") {
Peter Boström02083222016-06-14 12:52:54 +0200704 testonly = true
705 deps = [
706 "audio:audio_tests",
707 "call:call_tests",
708 "modules/video_capture",
709 "test:test_common",
710 "test:test_main",
711 "video:video_tests",
712 ]
713 if (is_clang) {
714 # Suppress warnings from the Chromium Clang plugin.
715 # See http://code.google.com/p/webrtc/issues/detail?id=163 for details.
ehmaldonado38a21322016-09-02 04:10:34 -0700716 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
Peter Boström02083222016-06-14 12:52:54 +0200717 }
sakal714dd4e2016-08-15 02:29:11 -0700718 if (is_android) {
sakal010f0922016-08-18 00:41:59 -0700719 deps += [ "//testing/android/native_test:native_test_native_code" ]
kjellander32c4a202016-08-30 02:53:49 -0700720 data = video_engine_tests_resources
kjellander28a0ffd2016-08-24 07:48:42 -0700721 shard_timeout = 900
722 }
kjellander32c4a202016-08-30 02:53:49 -0700723
724 if (is_ios) {
725 deps += [ ":video_engine_tests_bundle_data" ]
sakal714dd4e2016-08-15 02:29:11 -0700726 }
Peter Boström02083222016-06-14 12:52:54 +0200727 }
Peter Boströmac968bd2016-06-27 19:31:39 +0200728
ehmaldonado38a21322016-09-02 04:10:34 -0700729 rtc_source_set("video_quality_test") {
ehmaldonado529f83c2016-07-27 08:14:32 -0700730 testonly = true
731 configs += [ ":common_config" ]
732 public_configs = [ ":common_inherited_config" ]
733 sources = [
734 "video/video_quality_test.cc",
735 "video/video_quality_test.h",
736 ]
737 deps = [
738 ":webrtc",
739 "system_wrappers",
740 "//testing/gtest",
741 ]
742 if (!is_android) {
743 deps += [ "modules/video_capture:video_capture_internal_impl" ]
744 }
745 if (is_clang) {
746 # Suppress warnings from the Chromium Clang plugin.
747 # See http://code.google.com/p/webrtc/issues/detail?id=163 for details.
ehmaldonado38a21322016-09-02 04:10:34 -0700748 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
ehmaldonado529f83c2016-07-27 08:14:32 -0700749 }
750 }
751
kjellander32c4a202016-08-30 02:53:49 -0700752 if (is_android || is_ios) {
753 webrtc_perf_tests_resources = [
754 "//resources/audio_coding/speech_mono_16kHz.pcm",
755 "//resources/audio_coding/testfile32kHz.pcm",
756 "//resources/ConferenceMotion_1280_720_50.yuv",
757 "//resources/difficult_photo_1850_1110.yuv",
758 "//resources/foreman_cif.yuv",
759 "//resources/google-wifi-3mbps.rx",
760 "//resources/paris_qcif.yuv",
761 "//resources/photo_1850_1110.yuv",
762 "//resources/presentation_1850_1110.yuv",
763 "//resources/verizon4g-downlink.rx",
764 "//resources/voice_engine/audio_long16.pcm",
765 "//resources/web_screenshot_1850_1110.yuv",
766 ]
767 }
768
769 if (is_ios) {
770 bundle_data("webrtc_perf_tests_bundle_data") {
771 testonly = true
772 sources = webrtc_perf_tests_resources
773 outputs = [
774 "{{bundle_resources_dir}}/{{source_file_part}}",
775 ]
776 }
777 }
778
ehmaldonado38a21322016-09-02 04:10:34 -0700779 rtc_test("webrtc_perf_tests") {
ehmaldonado529f83c2016-07-27 08:14:32 -0700780 testonly = true
781 configs += [
782 ":common_config",
783 ":rtc_unittests_config",
784 ]
785 public_configs = [ ":common_inherited_config" ]
ehmaldonado25f32e72016-08-31 08:22:09 -0700786
787 if (!is_debug) {
ehmaldonado38a21322016-09-02 04:10:34 -0700788 suppressed_configs += [ "//build/config/compiler:default_optimization" ]
ehmaldonado25f32e72016-08-31 08:22:09 -0700789 configs += [ "//build/config/compiler:optimize_max" ]
790 }
791
ehmaldonado529f83c2016-07-27 08:14:32 -0700792 sources = [
793 "call/call_perf_tests.cc",
794 "call/rampup_tests.cc",
795 "call/rampup_tests.h",
796 "modules/audio_coding/neteq/test/neteq_performance_unittest.cc",
797 "modules/audio_processing/audio_processing_performance_unittest.cc",
798 "modules/audio_processing/level_controller/level_controller_complexity_unittest.cc",
799 "modules/remote_bitrate_estimator/remote_bitrate_estimators_test.cc",
800 "video/full_stack.cc",
801 ]
802 deps = [
803 ":video_quality_test",
804 ":webrtc",
805 "modules/audio_coding:neteq_test_support",
806 "modules/audio_processing",
807 "modules/audio_processing:audioproc_test_utils",
808 "modules/remote_bitrate_estimator:bwe_simulator",
809 "modules/rtp_rtcp",
810 "test:channel_transport",
811 "test:test_common",
812 "test:test_main",
813 "test:test_renderer",
814 "voice_engine",
815 "//testing/gmock",
816 "//testing/gtest",
817 ]
818 if (is_android) {
819 deps += [ "//testing/android/native_test:native_test_native_code" ]
kjellander32c4a202016-08-30 02:53:49 -0700820 data = webrtc_perf_tests_resources
sakal714dd4e2016-08-15 02:29:11 -0700821 shard_timeout = 2700
ehmaldonado529f83c2016-07-27 08:14:32 -0700822 }
kjellander32c4a202016-08-30 02:53:49 -0700823 if (is_ios) {
824 deps += [ ":webrtc_perf_tests_bundle_data" ]
825 }
ehmaldonado529f83c2016-07-27 08:14:32 -0700826 if (is_clang) {
827 # Suppress warnings from the Chromium Clang plugin.
828 # See http://code.google.com/p/webrtc/issues/detail?id=163 for details.
ehmaldonado38a21322016-09-02 04:10:34 -0700829 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
ehmaldonado529f83c2016-07-27 08:14:32 -0700830 }
831 }
832
ehmaldonado38a21322016-09-02 04:10:34 -0700833 rtc_test("webrtc_nonparallel_tests") {
Peter Boströmac968bd2016-06-27 19:31:39 +0200834 testonly = true
835 configs += [
836 ":common_config",
837 ":rtc_unittests_config",
838 ]
839 public_configs = [ ":common_inherited_config" ]
840 sources = [
841 "base/nullsocketserver_unittest.cc",
danilchapb7b9dca2016-08-05 05:55:43 -0700842 "base/physicalsocketserver_unittest.cc",
843 "base/socket_unittest.cc",
844 "base/socket_unittest.h",
Peter Boströmac968bd2016-06-27 19:31:39 +0200845 "base/socketaddress_unittest.cc",
846 "base/virtualsocket_unittest.cc",
847 ]
848 deps = [
849 "base:rtc_base",
850 "base:rtc_base_tests_utils",
851 "//testing/gtest",
852 ]
853 if (is_win) {
danilchapb7b9dca2016-08-05 05:55:43 -0700854 sources += [ "base/win32socketserver_unittest.cc" ]
Peter Boströmac968bd2016-06-27 19:31:39 +0200855 }
856 if (is_android) {
857 deps += [ "//testing/android/native_test:native_test_support" ]
sakal714dd4e2016-08-15 02:29:11 -0700858 shard_timeout = 900
Peter Boströmac968bd2016-06-27 19:31:39 +0200859 }
860
861 if (is_mac) {
862 sources += [ "base/macsocketserver_unittest.cc" ]
863 }
864 if (is_ios || (is_mac && target_cpu != "x86")) {
865 defines = [ "CARBON_DEPRECATED=YES" ]
866 }
867 if (is_clang) {
868 # Suppress warnings from the Chromium Clang plugin.
869 # See http://code.google.com/p/webrtc/issues/detail?id=163 for details.
ehmaldonado38a21322016-09-02 04:10:34 -0700870 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
Peter Boströmac968bd2016-06-27 19:31:39 +0200871 }
872 }
kjellander@webrtc.org3ee56142016-06-03 15:57:02 +0200873}