blob: aaa1d72f96bdb3eb457d40a426022355d30d24ea [file] [log] [blame]
kjellander@webrtc.org851a09e2014-06-17 08:54:031# 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:229# TODO(kjellander): Rebase this to webrtc/build/common.gypi changes after r6330.
10
kjellander@webrtc.org851a09e2014-06-17 08:54:0311import("//build/config/linux/pkg_config.gni")
Peter Boström62e9bda2015-11-23 14:12:0612import("//build/config/sanitizers/sanitizers.gni")
kjellander@webrtc.org851a09e2014-06-17 08:54:0313import("build/webrtc.gni")
Bjorn Terelius36411852015-07-30 10:45:1814import("//third_party/protobuf/proto_library.gni")
kjellander@webrtc.org851a09e2014-06-17 08:54:0315
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 06:57:2320 cflags = []
21 ldflags = []
kjellander@webrtc.org851a09e2014-06-17 08:54:0322 if (build_with_mozilla) {
23 defines += [ "WEBRTC_MOZILLA_BUILD" ]
24 }
25 if (build_with_chromium) {
kjellanderf0e174a2016-05-30 13:27:5026 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:0337 include_dirs = [
henrikgee2bf412015-09-30 10:48:5238 # The overrides must be included first as that is the mechanism for
kjellander@webrtc.org851a09e2014-06-17 08:54:0339 # selecting the override headers in Chromium.
henrikgee2bf412015-09-30 10:48:5240 "../webrtc_overrides",
Henrik Kjellander57e5fd22015-05-25 10:55:3941
kjellander@webrtc.org851a09e2014-06-17 08:54:0342 # 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 21:34:5856 if (is_ios && rtc_use_objc_h264) {
57 defines += [ "WEBRTC_OBJC_H264" ]
58 }
kjellander@webrtc.org851a09e2014-06-17 08:54:0359 if (is_linux) {
60 defines += [ "WEBRTC_LINUX" ]
61 }
62 if (is_mac) {
63 defines += [ "WEBRTC_MAC" ]
64 }
65 if (is_win) {
kjellanderf0e174a2016-05-30 13:27:5066 defines += [
67 "WEBRTC_WIN",
68 "_CRT_SECURE_NO_WARNINGS", # Suppress warnings about _vsnprinf
69 ]
kjellander@webrtc.org851a09e2014-06-17 08:54:0370 }
71 if (is_android) {
72 defines += [
73 "WEBRTC_LINUX",
74 "WEBRTC_ANDROID",
75 ]
kjellander@webrtc.org851a09e2014-06-17 08:54:0376 }
kjellanderf0e174a2016-05-30 13:27:5077 if (is_chromeos) {
78 defines += [ "CHROMEOS" ]
79 }
80
Johan Ahlers9ddac182016-07-22 06:57:2381 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 13:27:5087 # 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:0397}
98
kjellander@webrtc.org6d08ca62014-09-07 17:36:1099if (rtc_have_dbus_glib) {
kjellander@webrtc.org7497fa72014-06-28 18:05:22100 pkg_config("dbus-glib") {
101 packages = [ "dbus-glib-1" ]
102 }
kjellander@webrtc.org851a09e2014-06-17 08:54:03103}
104
105config("common_config") {
kjellander@webrtc.org79ee97c2014-09-04 14:10:49106 cflags = []
107 cflags_cc = []
kjellanderf0e174a2016-05-30 13:27:50108 defines = []
109
kjellander@webrtc.org6d08ca62014-09-07 17:36:10110 if (rtc_restrict_logging) {
kjellanderf0e174a2016-05-30 13:27:50111 defines += [ "WEBRTC_RESTRICT_LOGGING" ]
kjellander@webrtc.org851a09e2014-06-17 08:54:03112 }
113
kjellander82a94492016-06-13 05:12:01114 if (rtc_include_internal_audio_device) {
115 defines += [ "WEBRTC_INCLUDE_INTERNAL_AUDIO_DEVICE" ]
116 }
117
kjellander@webrtc.org6d08ca62014-09-07 17:36:10118 if (rtc_have_dbus_glib) {
kjellander@webrtc.org851a09e2014-06-17 08:54:03119 defines += [ "HAVE_DBUS_GLIB" ]
Henrik Kjellander57e5fd22015-05-25 10:55:39120
kjellander@webrtc.org851a09e2014-06-17 08:54:03121 # 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 10:09:32128 if (rtc_relative_path) {
129 defines += [ "EXPAT_RELATIVE_PATH" ]
130 }
131
brettw@chromium.org9fe11012014-09-09 19:15:33132 if (build_with_chromium) {
kjellanderf0e174a2016-05-30 13:27:50133 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:33149 } else {
kjellander@webrtc.org851a09e2014-06-17 08:54:03150 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:31157 if (current_cpu != "arm64" || !is_android) {
kjellander@webrtc.org851a09e2014-06-17 08:54:03158 cflags = [
159 "-Wextra",
Henrik Kjellander57e5fd22015-05-25 10:55:39160
kjellander@webrtc.org851a09e2014-06-17 08:54:03161 # 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 10:55:39169
kjellander@webrtc.org851a09e2014-06-17 08:54:03170 # This is enabled for clang; enable for gcc as well.
171 "-Woverloaded-virtual",
172 ]
173 }
174 }
175
176 if (is_clang) {
kjellander3f032cf2016-04-27 14:13:46177 cflags += [
178 "-Wimplicit-fallthrough",
179 "-Wthread-safety",
nisse4996eaa2016-05-11 06:28:10180 "-Winconsistent-missing-override",
kjellander3f032cf2016-04-27 14:13:46181 ]
kjellander@webrtc.org851a09e2014-06-17 08:54:03182 }
183 }
184
kjellander@webrtc.org72273912015-02-23 19:08:31185 if (current_cpu == "arm64") {
Andrew MacDonaldcb7f8ce2015-05-20 05:20:17186 defines += [ "WEBRTC_ARCH_ARM64" ]
187 defines += [ "WEBRTC_HAS_NEON" ]
tkchin@webrtc.org14146e42014-10-31 00:14:39188 }
189
kjellander@webrtc.org72273912015-02-23 19:08:31190 if (current_cpu == "arm") {
kjellander@webrtc.org851a09e2014-06-17 08:54:03191 defines += [ "WEBRTC_ARCH_ARM" ]
andrew@webrtc.orga56a2c52014-11-26 17:01:40192 if (arm_version >= 7) {
kjellander@webrtc.org851a09e2014-06-17 08:54:03193 defines += [ "WEBRTC_ARCH_ARM_V7" ]
194 if (arm_use_neon) {
Andrew MacDonaldcb7f8ce2015-05-20 05:20:17195 defines += [ "WEBRTC_HAS_NEON" ]
kjellander@webrtc.org851a09e2014-06-17 08:54:03196 }
197 }
198 }
199
kjellander@webrtc.org72273912015-02-23 19:08:31200 if (current_cpu == "mipsel") {
kjellander@webrtc.org851a09e2014-06-17 08:54:03201 defines += [ "MIPS32_LE" ]
kjellander@webrtc.org6dab6d72015-03-04 09:50:31202 if (mips_float_abi == "hard") {
kjellander@webrtc.org851a09e2014-06-17 08:54:03203 defines += [ "MIPS_FPU_LE" ]
kjellander@webrtc.org851a09e2014-06-17 08:54:03204 }
kjellander@webrtc.orgacb80852015-01-25 19:17:56205 if (mips_arch_variant == "r2") {
kjellander@webrtc.org851a09e2014-06-17 08:54:03206 defines += [ "MIPS32_R2_LE" ]
kjellander@webrtc.org851a09e2014-06-17 08:54:03207 }
208 if (mips_dsp_rev == 1) {
209 defines += [ "MIPS_DSP_R1_LE" ]
kjellander@webrtc.org851a09e2014-06-17 08:54:03210 } 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:03215 }
216 }
217
Henrik Kjellanderc0c7d2e2015-09-07 10:57:42218 if (is_android && !is_clang) {
Henrik Kjellander5bfc6cb2015-09-21 14:50:45219 # 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:03221 cflags += [
222 "-fno-builtin-cos",
223 "-fno-builtin-sin",
224 "-fno-builtin-cosf",
225 "-fno-builtin-sinf",
226 ]
227 }
katrielcbf81d682016-05-26 08:03:02228
metzmanf89a5712016-07-25 09:14:09229 if (use_libfuzzer || use_drfuzz || use_afl) {
katrielcbf81d682016-05-26 08:03:02230 # Used in Chromium's overrides to disable logging
231 defines += [ "WEBRTC_UNSAFE_FUZZER_MODE" ]
232 }
kjellander@webrtc.org851a09e2014-06-17 08:54:03233}
234
kjellander3bcedd32016-06-08 08:14:15235config("common_objc") {
tkchin2ddfdba2016-08-08 04:37:45236 libs = [ "Foundation.framework" ]
kjellander3bcedd32016-06-08 08:14:15237 precompiled_header = "sdk/objc/WebRTC-Prefix.pch"
238 precompiled_source = "sdk/objc/WebRTC-Prefix.pch"
239}
240
Nico Weber3ab32dc2016-08-02 13:53:25241if (!is_ios || !build_with_chromium) {
ehmaldonado38a21322016-09-02 11:10:34242 rtc_source_set("webrtc") {
Nico Weber3ab32dc2016-08-02 13:53:25243 sources = [
244 "call.h",
245 "config.h",
246 "transport.h",
kjellander94cee312016-06-10 08:56:57247 ]
Bjorn Terelius36411852015-07-30 10:45:18248
Nico Weber3ab32dc2016-08-02 13:53:25249 defines = []
Nico Weber3ab32dc2016-08-02 13:53:25250 public_configs = [ ":common_inherited_config" ]
251
252 deps = [
253 ":webrtc_common",
254 "audio",
255 "base:rtc_base",
256 "call",
257 "common_audio",
258 "common_video",
259 "modules",
hbos615d3012016-08-24 08:33:13260 "stats",
Nico Weber3ab32dc2016-08-02 13:53:25261 "system_wrappers",
262 "tools",
263 "video",
264 "voice_engine",
265 ]
266
267 if (build_with_chromium) {
268 deps += [ "modules/video_capture" ]
269 } else {
270 # TODO(kjellander): Enable for Chromium as well when bugs.webrtc.org/4256
271 # is fixed. Right now it's not possible due to circular dependencies.
272 deps += [
273 "api",
274 "media",
275 "p2p",
276 "pc",
277 ]
278 }
279
280 if (rtc_enable_protobuf) {
281 defines += [ "ENABLE_RTC_EVENT_LOG" ]
282 deps += [ ":rtc_event_log_proto" ]
283 }
Bjorn Terelius36411852015-07-30 10:45:18284 }
kjellander@webrtc.org1227ab82014-06-23 19:21:07285}
286
kjellander@webrtc.orgb8caf6a2014-09-30 18:05:02287if (!build_with_chromium) {
ehmaldonado38a21322016-09-02 11:10:34288 rtc_executable("webrtc_tests") {
kjellander@webrtc.orgb8caf6a2014-09-30 18:05:02289 testonly = true
290 deps = [
291 ":webrtc",
kjellander@webrtc.orgb8caf6a2014-09-30 18:05:02292 "modules/video_capture:video_capture_internal_impl",
293 "test",
294 ]
295 }
stefan3ab66142016-08-15 13:29:10296
ehmaldonado38a21322016-09-02 11:10:34297 rtc_executable("video_loopback") {
stefan3ab66142016-08-15 13:29:10298 testonly = true
299 sources = [
300 "test/run_test.h",
301 "video/video_loopback.cc",
302 ]
303
304 if (is_mac) {
305 sources += [ "test/mac/run_test.mm" ]
306 } else {
307 sources += [ "test/run_test.cc" ]
308 }
309 deps = [
310 ":video_quality_test",
311 "system_wrappers:metrics_default",
312 "test:field_trial",
313 "test:test_common",
314 "test:test_renderer",
315 "//testing/gmock",
316 "//testing/gtest",
317 "//third_party/gflags",
318 ]
319 if (is_clang && !is_nacl) {
320 # Suppress warnings from Chrome's Clang plugins.
321 # See http://code.google.com/p/webrtc/issues/detail?id=163 for details.
ehmaldonado38a21322016-09-02 11:10:34322 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
stefan3ab66142016-08-15 13:29:10323 }
324 }
kjellander@webrtc.orgb8caf6a2014-09-30 18:05:02325}
326
ehmaldonado38a21322016-09-02 11:10:34327rtc_source_set("webrtc_common") {
kjellander@webrtc.org1227ab82014-06-23 19:21:07328 sources = [
kjellander@webrtc.org50772f12016-02-29 05:49:43329 "audio_sink.h",
kwiberg65fc8b92016-08-29 17:05:24330 "common.cc",
331 "common.h",
kwiberg@webrtc.orgac2d27d2015-02-26 13:59:22332 "common_types.cc",
kjellander@webrtc.orgd7e34e12015-01-26 19:17:26333 "common_types.h",
kjellander@webrtc.org1227ab82014-06-23 19:21:07334 "config.cc",
Henrik Kjellander57e5fd22015-05-25 10:55:39335 "config.h",
kjellander@webrtc.orgd7e34e12015-01-26 19:17:26336 "engine_configurations.h",
337 "typedefs.h",
kjellander@webrtc.org851a09e2014-06-17 08:54:03338 ]
kjellander@webrtc.org9bef5512014-07-13 09:02:54339
kjellander@webrtc.orgf21ea912014-09-28 17:37:22340 public_configs = [ ":common_inherited_config" ]
aluebs688e3082016-01-14 12:32:46341
342 if (is_clang && !is_nacl) {
343 # Suppress warnings from Chrome's Clang plugins.
344 # See http://code.google.com/p/webrtc/issues/detail?id=163 for details.
ehmaldonado38a21322016-09-02 11:10:34345 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
aluebs688e3082016-01-14 12:32:46346 }
kjellander@webrtc.org851a09e2014-06-17 08:54:03347}
kjellander@webrtc.orgd7e34e12015-01-26 19:17:26348
Bjorn Terelius36411852015-07-30 10:45:18349if (rtc_enable_protobuf) {
350 proto_library("rtc_event_log_proto") {
351 sources = [
Peter Boström5c389d32015-09-25 11:58:30352 "call/rtc_event_log.proto",
Bjorn Terelius36411852015-07-30 10:45:18353 ]
Peter Boström5c389d32015-09-25 11:58:30354 proto_out_dir = "webrtc/call"
Bjorn Terelius36411852015-07-30 10:45:18355 }
356}
357
ehmaldonado38a21322016-09-02 11:10:34358rtc_source_set("rtc_event_log") {
Bjorn Terelius36411852015-07-30 10:45:18359 sources = [
Peter Boström5c389d32015-09-25 11:58:30360 "call/rtc_event_log.cc",
361 "call/rtc_event_log.h",
terelius4311ba52016-04-22 19:40:37362 "call/rtc_event_log_helper_thread.cc",
363 "call/rtc_event_log_helper_thread.h",
Bjorn Terelius36411852015-07-30 10:45:18364 ]
365
366 defines = []
Bjorn Terelius36411852015-07-30 10:45:18367 public_configs = [ ":common_inherited_config" ]
368
369 deps = [
370 ":webrtc_common",
sakal06bfe1f2016-08-04 14:54:04371 "modules/rtp_rtcp",
Bjorn Terelius36411852015-07-30 10:45:18372 ]
373
374 if (rtc_enable_protobuf) {
375 defines += [ "ENABLE_RTC_EVENT_LOG" ]
376 deps += [ ":rtc_event_log_proto" ]
377 }
sergeyu4df08ff2015-09-02 21:22:40378 if (is_clang && !is_nacl) {
Bjorn Terelius36411852015-07-30 10:45:18379 # Suppress warnings from Chrome's Clang plugins.
380 # See http://code.google.com/p/webrtc/issues/detail?id=163 for details.
ehmaldonado38a21322016-09-02 11:10:34381 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
Bjorn Terelius36411852015-07-30 10:45:18382 }
383}
Peter Boström62e9bda2015-11-23 14:12:06384
tereliusd5c1a0b2016-05-13 07:42:59385if (rtc_enable_protobuf) {
ehmaldonado38a21322016-09-02 11:10:34386 rtc_source_set("rtc_event_log_parser") {
tereliusd5c1a0b2016-05-13 07:42:59387 sources = [
388 "call/rtc_event_log_parser.cc",
389 "call/rtc_event_log_parser.h",
390 ]
391
tereliusd5c1a0b2016-05-13 07:42:59392 public_configs = [ ":common_inherited_config" ]
393
terelius54ce6802016-07-13 13:44:41394 public_deps = [
tereliusd5c1a0b2016-05-13 07:42:59395 ":rtc_event_log_proto",
396 ":webrtc_common",
397 ]
398
399 if (is_clang && !is_nacl) {
400 # Suppress warnings from Chrome's Clang plugins.
401 # See http://code.google.com/p/webrtc/issues/detail?id=163 for details.
ehmaldonado38a21322016-09-02 11:10:34402 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
tereliusd5c1a0b2016-05-13 07:42:59403 }
404 }
405}
406
metzmanf89a5712016-07-25 09:14:09407if (use_libfuzzer || use_drfuzz || use_afl) {
Peter Boström1e0cfd92015-12-17 13:28:16408 # This target is only here for gn to discover fuzzer build targets under
409 # webrtc/test/fuzzers/.
410 group("webrtc_fuzzers_dummy") {
Peter Boström62e9bda2015-11-23 14:12:06411 testonly = true
412 deps = [
Peter Boström1e0cfd92015-12-17 13:28:16413 "test/fuzzers:webrtc_fuzzer_main",
Peter Boström62e9bda2015-11-23 14:12:06414 ]
415 }
416}
kjellander@webrtc.org3ee56142016-06-03 13:57:02417
kjellander@webrtc.orgaff499c92016-06-06 21:04:31418if (rtc_include_tests) {
kjellander@webrtc.org3ee56142016-06-03 13:57:02419 config("rtc_unittests_config") {
420 # GN orders flags on a target before flags from configs. The default config
421 # adds -Wall, and this flag have to be after -Wall -- so they need to
422 # come from a config and can"t be on the target directly.
423 if (is_clang) {
424 cflags = [
425 "-Wno-missing-braces",
426 "-Wno-sign-compare",
427 "-Wno-unused-const-variable",
428 ]
429 }
430 }
431
ehmaldonado38a21322016-09-02 11:10:34432 rtc_test("rtc_unittests") {
kjellander@webrtc.org3ee56142016-06-03 13:57:02433 testonly = true
434 sources = [
435 "base/array_view_unittest.cc",
436 "base/atomicops_unittest.cc",
437 "base/autodetectproxy_unittest.cc",
438 "base/bandwidthsmoother_unittest.cc",
439 "base/base64_unittest.cc",
440 "base/basictypes_unittest.cc",
441 "base/bind_unittest.cc",
442 "base/bitbuffer_unittest.cc",
443 "base/buffer_unittest.cc",
444 "base/bufferqueue_unittest.cc",
445 "base/bytebuffer_unittest.cc",
446 "base/byteorder_unittest.cc",
447 "base/callback_unittest.cc",
448 "base/copyonwritebuffer_unittest.cc",
449 "base/crc32_unittest.cc",
450 "base/criticalsection_unittest.cc",
451 "base/event_tracer_unittest.cc",
452 "base/event_unittest.cc",
453 "base/exp_filter_unittest.cc",
Viktor Palmkvist4ec6a0c2016-09-02 11:38:32454 "base/file_unittest.cc",
kjellander@webrtc.org3ee56142016-06-03 13:57:02455 "base/filerotatingstream_unittest.cc",
456 "base/fileutils_unittest.cc",
457 "base/helpers_unittest.cc",
458 "base/httpbase_unittest.cc",
459 "base/httpcommon_unittest.cc",
460 "base/httpserver_unittest.cc",
461 "base/ipaddress_unittest.cc",
462 "base/logging_unittest.cc",
463 "base/md5digest_unittest.cc",
464 "base/messagedigest_unittest.cc",
465 "base/messagequeue_unittest.cc",
466 "base/mod_ops_unittest.cc",
467 "base/multipart_unittest.cc",
468 "base/nat_unittest.cc",
469 "base/network_unittest.cc",
470 "base/onetimeevent_unittest.cc",
471 "base/optional_unittest.cc",
472 "base/optionsfile_unittest.cc",
473 "base/pathutils_unittest.cc",
474 "base/platform_thread_unittest.cc",
475 "base/profiler_unittest.cc",
476 "base/proxy_unittest.cc",
477 "base/proxydetect_unittest.cc",
478 "base/random_unittest.cc",
sprangcd349d92016-07-13 16:11:28479 "base/rate_limiter_unittest.cc",
kjellander@webrtc.org3ee56142016-06-03 13:57:02480 "base/rate_statistics_unittest.cc",
481 "base/ratelimiter_unittest.cc",
482 "base/ratetracker_unittest.cc",
483 "base/referencecountedsingletonfactory_unittest.cc",
484 "base/rollingaccumulator_unittest.cc",
485 "base/rtccertificate_unittest.cc",
486 "base/rtccertificategenerator_unittest.cc",
487 "base/scopedptrcollection_unittest.cc",
perkj9c16fe82016-07-12 22:04:07488 "base/sequenced_task_checker_unittest.cc",
kjellander@webrtc.org3ee56142016-06-03 13:57:02489 "base/sha1digest_unittest.cc",
490 "base/sharedexclusivelock_unittest.cc",
491 "base/signalthread_unittest.cc",
492 "base/sigslot_unittest.cc",
493 "base/sigslottester.h",
494 "base/sigslottester.h.pump",
495 "base/stream_unittest.cc",
496 "base/stringencode_unittest.cc",
497 "base/stringutils_unittest.cc",
498 "base/swap_queue_unittest.cc",
499
500 # TODO(ronghuawu): Reenable this test.
501 # "systeminfo_unittest.cc",
502 "base/task_queue_unittest.cc",
503 "base/task_unittest.cc",
504 "base/testclient_unittest.cc",
505 "base/thread_checker_unittest.cc",
506 "base/thread_unittest.cc",
nisse191b3592016-06-22 15:36:53507 "base/timestampaligner_unittest.cc",
kjellander@webrtc.org3ee56142016-06-03 13:57:02508 "base/timeutils_unittest.cc",
509 "base/urlencode_unittest.cc",
510 "base/versionparsing_unittest.cc",
511
512 # TODO(ronghuawu): Reenable this test.
513 # "windowpicker_unittest.cc",
514 "p2p/base/dtlstransportchannel_unittest.cc",
515 "p2p/base/fakeportallocator.h",
516 "p2p/base/faketransportcontroller.h",
517 "p2p/base/p2ptransportchannel_unittest.cc",
518 "p2p/base/port_unittest.cc",
519 "p2p/base/portallocator_unittest.cc",
520 "p2p/base/pseudotcp_unittest.cc",
521 "p2p/base/relayport_unittest.cc",
522 "p2p/base/relayserver_unittest.cc",
523 "p2p/base/stun_unittest.cc",
524 "p2p/base/stunport_unittest.cc",
525 "p2p/base/stunrequest_unittest.cc",
526 "p2p/base/stunserver_unittest.cc",
527 "p2p/base/tcpport_unittest.cc",
528 "p2p/base/testrelayserver.h",
529 "p2p/base/teststunserver.h",
530 "p2p/base/testturnserver.h",
531 "p2p/base/transport_unittest.cc",
532 "p2p/base/transportcontroller_unittest.cc",
533 "p2p/base/transportdescriptionfactory_unittest.cc",
534 "p2p/base/turnport_unittest.cc",
Taylor Brandstetter734262c2016-08-01 23:37:14535 "p2p/base/turnserver_unittest.cc",
kjellander@webrtc.org3ee56142016-06-03 13:57:02536 "p2p/client/basicportallocator_unittest.cc",
537 "p2p/stunprober/stunprober_unittest.cc",
538 ]
539
540 if (is_linux) {
541 sources += [
542 "base/latebindingsymboltable_unittest.cc",
543
544 # TODO(ronghuawu): Reenable this test.
545 # "linux_unittest.cc",
546 "base/linuxfdwalk_unittest.cc",
547 ]
548 }
549
550 if (is_win) {
551 sources += [
552 "base/win32_unittest.cc",
553 "base/win32regkey_unittest.cc",
554 "base/win32window_unittest.cc",
555 "base/win32windowpicker_unittest.cc",
556 "base/winfirewall_unittest.cc",
557 ]
558 }
559
560 if (is_mac) {
561 sources += [ "base/macutils_unittest.cc" ]
562 }
563
564 if (is_posix) {
565 sources += [
566 "base/ssladapter_unittest.cc",
567 "base/sslidentity_unittest.cc",
568 "base/sslstreamadapter_unittest.cc",
569 ]
570 }
571 if (is_ios || (is_mac && target_cpu != "x86")) {
572 defines = [ "CARBON_DEPRECATED=YES" ]
573 }
574
575 if (rtc_use_quic) {
576 sources += [
577 "p2p/quic/quicconnectionhelper_unittest.cc",
578 "p2p/quic/quicsession_unittest.cc",
579 "p2p/quic/quictransport_unittest.cc",
580 "p2p/quic/quictransportchannel_unittest.cc",
581 "p2p/quic/reliablequicstream_unittest.cc",
582 ]
583 }
584
ehmaldonado7a2ce0b2016-09-05 08:35:44585 configs += [ ":rtc_unittests_config" ]
kjellander@webrtc.org3ee56142016-06-03 13:57:02586 public_configs = [ ":common_inherited_config" ]
587
588 if (is_clang) {
589 # Suppress warnings from the Chromium Clang plugin.
590 # See http://code.google.com/p/webrtc/issues/detail?id=163 for details.
ehmaldonado38a21322016-09-02 11:10:34591 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
kjellander@webrtc.org3ee56142016-06-03 13:57:02592 }
593
594 deps = [
595 "base:rtc_base",
kjellander82a94492016-06-13 05:12:01596 "base:rtc_base_tests_utils",
kjellander@webrtc.org3ee56142016-06-03 13:57:02597 "base:rtc_task_queue",
598 "p2p:libstunprober",
599 "p2p:rtc_p2p",
600 "//testing/gmock",
601 "//testing/gtest",
602 ]
603
604 if (is_android) {
605 deps += [ "//testing/android/native_test:native_test_support" ]
sakal714dd4e2016-08-15 09:29:11606 shard_timeout = 900
kjellander@webrtc.org3ee56142016-06-03 13:57:02607 }
kjellander3bcedd32016-06-08 08:14:15608
609 if (is_ios || (is_mac && mac_deployment_target == "10.7")) {
610 deps += [
611 "sdk:rtc_sdk_peerconnection_objc",
612 "system_wrappers:system_wrappers_default",
613 ]
614 sources += [
615 "sdk/objc/Framework/UnitTests/RTCConfigurationTest.mm",
616 "sdk/objc/Framework/UnitTests/RTCDataChannelConfigurationTest.mm",
617 "sdk/objc/Framework/UnitTests/RTCIceCandidateTest.mm",
618 "sdk/objc/Framework/UnitTests/RTCIceServerTest.mm",
619 "sdk/objc/Framework/UnitTests/RTCMediaConstraintsTest.mm",
620 "sdk/objc/Framework/UnitTests/RTCSessionDescriptionTest.mm",
621 ]
622
623 # TODO(tkchin): Cleanup this warning.
624 cflags = [ "-Wno-objc-property-no-attribute" ]
625
626 # |-ObjC| flag needed to make sure category method implementations
627 # are included:
628 # https://developer.apple.com/library/mac/qa/qa1490/_index.html
629 ldflags = [ "-ObjC" ]
630 }
kjellander@webrtc.org3ee56142016-06-03 13:57:02631 }
Peter Boström02083222016-06-14 10:52:54632
ehmaldonado38a21322016-09-02 11:10:34633 rtc_test("xmllite_xmpp_unittests") {
ehmaldonado7a2ce0b2016-09-05 08:35:44634 configs += [ ":rtc_unittests_config" ]
charujain604fc112016-08-04 08:16:39635 public_configs = [ ":common_inherited_config" ]
636
637 if (is_clang) {
638 # Suppress warnings from the Chromium Clang plugin.
639 # See http://code.google.com/p/webrtc/issues/detail?id=163 for details.
ehmaldonado38a21322016-09-02 11:10:34640 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
charujain604fc112016-08-04 08:16:39641 }
642
643 deps = [
644 "base:rtc_base_tests_utils",
645 "libjingle/xmllite:rtc_xmllite",
646 "libjingle/xmpp:rtc_xmpp",
647 "//testing/gtest",
648 ]
649
650 sources = [
651 "libjingle/xmllite/qname_unittest.cc",
652 "libjingle/xmllite/xmlbuilder_unittest.cc",
653 "libjingle/xmllite/xmlelement_unittest.cc",
654 "libjingle/xmllite/xmlnsstack_unittest.cc",
655 "libjingle/xmllite/xmlparser_unittest.cc",
656 "libjingle/xmllite/xmlprinter_unittest.cc",
657 "libjingle/xmpp/fakexmppclient.h",
658 "libjingle/xmpp/hangoutpubsubclient_unittest.cc",
659 "libjingle/xmpp/jid_unittest.cc",
660 "libjingle/xmpp/mucroomconfigtask_unittest.cc",
661 "libjingle/xmpp/mucroomdiscoverytask_unittest.cc",
662 "libjingle/xmpp/mucroomlookuptask_unittest.cc",
663 "libjingle/xmpp/mucroomuniquehangoutidtask_unittest.cc",
664 "libjingle/xmpp/pingtask_unittest.cc",
665 "libjingle/xmpp/pubsubclient_unittest.cc",
666 "libjingle/xmpp/pubsubtasks_unittest.cc",
667 "libjingle/xmpp/util_unittest.cc",
668 "libjingle/xmpp/util_unittest.h",
669 "libjingle/xmpp/xmppengine_unittest.cc",
670 "libjingle/xmpp/xmpplogintask_unittest.cc",
671 "libjingle/xmpp/xmppstanzaparser_unittest.cc",
672 ]
673 }
674
Peter Boström02083222016-06-14 10:52:54675 # TODO(pbos): Rename test suite, this is no longer "just" for video targets.
kjellander32c4a202016-08-30 09:53:49676 if (is_android || is_ios) {
677 video_engine_tests_resources = [
678 "//resources/foreman_cif_short.yuv",
679 "//resources/voice_engine/audio_long16.pcm",
680 ]
681 }
682
683 if (is_ios) {
684 bundle_data("video_engine_tests_bundle_data") {
685 testonly = true
686 sources = video_engine_tests_resources
687 outputs = [
688 "{{bundle_resources_dir}}/{{source_file_part}}",
689 ]
690 }
691 }
692
ehmaldonado38a21322016-09-02 11:10:34693 rtc_test("video_engine_tests") {
Peter Boström02083222016-06-14 10:52:54694 testonly = true
695 deps = [
696 "audio:audio_tests",
697 "call:call_tests",
698 "modules/video_capture",
699 "test:test_common",
700 "test:test_main",
701 "video:video_tests",
702 ]
703 if (is_clang) {
704 # Suppress warnings from the Chromium Clang plugin.
705 # See http://code.google.com/p/webrtc/issues/detail?id=163 for details.
ehmaldonado38a21322016-09-02 11:10:34706 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
Peter Boström02083222016-06-14 10:52:54707 }
sakal714dd4e2016-08-15 09:29:11708 if (is_android) {
sakal010f0922016-08-18 07:41:59709 deps += [ "//testing/android/native_test:native_test_native_code" ]
kjellander32c4a202016-08-30 09:53:49710 data = video_engine_tests_resources
kjellander28a0ffd2016-08-24 14:48:42711 shard_timeout = 900
712 }
kjellander32c4a202016-08-30 09:53:49713
714 if (is_ios) {
715 deps += [ ":video_engine_tests_bundle_data" ]
sakal714dd4e2016-08-15 09:29:11716 }
Peter Boström02083222016-06-14 10:52:54717 }
Peter Boströmac968bd2016-06-27 17:31:39718
ehmaldonado38a21322016-09-02 11:10:34719 rtc_source_set("video_quality_test") {
ehmaldonado529f83c2016-07-27 15:14:32720 testonly = true
ehmaldonado529f83c2016-07-27 15:14:32721 public_configs = [ ":common_inherited_config" ]
722 sources = [
723 "video/video_quality_test.cc",
724 "video/video_quality_test.h",
725 ]
726 deps = [
727 ":webrtc",
728 "system_wrappers",
729 "//testing/gtest",
730 ]
731 if (!is_android) {
732 deps += [ "modules/video_capture:video_capture_internal_impl" ]
733 }
734 if (is_clang) {
735 # Suppress warnings from the Chromium Clang plugin.
736 # See http://code.google.com/p/webrtc/issues/detail?id=163 for details.
ehmaldonado38a21322016-09-02 11:10:34737 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
ehmaldonado529f83c2016-07-27 15:14:32738 }
739 }
740
kjellander32c4a202016-08-30 09:53:49741 if (is_android || is_ios) {
742 webrtc_perf_tests_resources = [
743 "//resources/audio_coding/speech_mono_16kHz.pcm",
744 "//resources/audio_coding/testfile32kHz.pcm",
745 "//resources/ConferenceMotion_1280_720_50.yuv",
746 "//resources/difficult_photo_1850_1110.yuv",
747 "//resources/foreman_cif.yuv",
748 "//resources/google-wifi-3mbps.rx",
749 "//resources/paris_qcif.yuv",
750 "//resources/photo_1850_1110.yuv",
751 "//resources/presentation_1850_1110.yuv",
752 "//resources/verizon4g-downlink.rx",
753 "//resources/voice_engine/audio_long16.pcm",
754 "//resources/web_screenshot_1850_1110.yuv",
755 ]
756 }
757
758 if (is_ios) {
759 bundle_data("webrtc_perf_tests_bundle_data") {
760 testonly = true
761 sources = webrtc_perf_tests_resources
762 outputs = [
763 "{{bundle_resources_dir}}/{{source_file_part}}",
764 ]
765 }
766 }
767
ehmaldonado38a21322016-09-02 11:10:34768 rtc_test("webrtc_perf_tests") {
ehmaldonado529f83c2016-07-27 15:14:32769 testonly = true
ehmaldonado7a2ce0b2016-09-05 08:35:44770 configs += [ ":rtc_unittests_config" ]
ehmaldonado529f83c2016-07-27 15:14:32771 public_configs = [ ":common_inherited_config" ]
ehmaldonado25f32e72016-08-31 15:22:09772
773 if (!is_debug) {
ehmaldonado38a21322016-09-02 11:10:34774 suppressed_configs += [ "//build/config/compiler:default_optimization" ]
ehmaldonado25f32e72016-08-31 15:22:09775 configs += [ "//build/config/compiler:optimize_max" ]
776 }
777
ehmaldonado529f83c2016-07-27 15:14:32778 sources = [
779 "call/call_perf_tests.cc",
780 "call/rampup_tests.cc",
781 "call/rampup_tests.h",
782 "modules/audio_coding/neteq/test/neteq_performance_unittest.cc",
783 "modules/audio_processing/audio_processing_performance_unittest.cc",
784 "modules/audio_processing/level_controller/level_controller_complexity_unittest.cc",
785 "modules/remote_bitrate_estimator/remote_bitrate_estimators_test.cc",
786 "video/full_stack.cc",
787 ]
788 deps = [
789 ":video_quality_test",
790 ":webrtc",
791 "modules/audio_coding:neteq_test_support",
792 "modules/audio_processing",
793 "modules/audio_processing:audioproc_test_utils",
794 "modules/remote_bitrate_estimator:bwe_simulator",
795 "modules/rtp_rtcp",
796 "test:channel_transport",
797 "test:test_common",
798 "test:test_main",
799 "test:test_renderer",
800 "voice_engine",
801 "//testing/gmock",
802 "//testing/gtest",
803 ]
804 if (is_android) {
805 deps += [ "//testing/android/native_test:native_test_native_code" ]
kjellander32c4a202016-08-30 09:53:49806 data = webrtc_perf_tests_resources
sakal714dd4e2016-08-15 09:29:11807 shard_timeout = 2700
ehmaldonado529f83c2016-07-27 15:14:32808 }
kjellander32c4a202016-08-30 09:53:49809 if (is_ios) {
810 deps += [ ":webrtc_perf_tests_bundle_data" ]
811 }
ehmaldonado529f83c2016-07-27 15:14:32812 if (is_clang) {
813 # Suppress warnings from the Chromium Clang plugin.
814 # See http://code.google.com/p/webrtc/issues/detail?id=163 for details.
ehmaldonado38a21322016-09-02 11:10:34815 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
ehmaldonado529f83c2016-07-27 15:14:32816 }
817 }
818
ehmaldonado38a21322016-09-02 11:10:34819 rtc_test("webrtc_nonparallel_tests") {
Peter Boströmac968bd2016-06-27 17:31:39820 testonly = true
ehmaldonado7a2ce0b2016-09-05 08:35:44821 configs += [ ":rtc_unittests_config" ]
Peter Boströmac968bd2016-06-27 17:31:39822 public_configs = [ ":common_inherited_config" ]
823 sources = [
824 "base/nullsocketserver_unittest.cc",
danilchapb7b9dca2016-08-05 12:55:43825 "base/physicalsocketserver_unittest.cc",
826 "base/socket_unittest.cc",
827 "base/socket_unittest.h",
Peter Boströmac968bd2016-06-27 17:31:39828 "base/socketaddress_unittest.cc",
829 "base/virtualsocket_unittest.cc",
830 ]
831 deps = [
832 "base:rtc_base",
833 "base:rtc_base_tests_utils",
834 "//testing/gtest",
835 ]
836 if (is_win) {
danilchapb7b9dca2016-08-05 12:55:43837 sources += [ "base/win32socketserver_unittest.cc" ]
Peter Boströmac968bd2016-06-27 17:31:39838 }
839 if (is_android) {
840 deps += [ "//testing/android/native_test:native_test_support" ]
sakal714dd4e2016-08-15 09:29:11841 shard_timeout = 900
Peter Boströmac968bd2016-06-27 17:31:39842 }
843
844 if (is_mac) {
845 sources += [ "base/macsocketserver_unittest.cc" ]
846 }
847 if (is_ios || (is_mac && target_cpu != "x86")) {
848 defines = [ "CARBON_DEPRECATED=YES" ]
849 }
850 if (is_clang) {
851 # Suppress warnings from the Chromium Clang plugin.
852 # See http://code.google.com/p/webrtc/issues/detail?id=163 for details.
ehmaldonado38a21322016-09-02 11:10:34853 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
Peter Boströmac968bd2016-06-27 17:31:39854 }
855 }
kjellander@webrtc.org3ee56142016-06-03 13:57:02856}