blob: 2a4adf8f6563ad03b254fff96f365ab4acce87ba [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")
kjellander@webrtc.org3ee56142016-06-03 15:57:02 +020014import("//testing/test.gni")
Bjorn Terelius36411852015-07-30 12:45:18 +020015import("//third_party/protobuf/proto_library.gni")
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +000016
17# Contains the defines and includes in common.gypi that are duplicated both as
18# target_defaults and direct_dependent_settings.
19config("common_inherited_config") {
20 defines = []
Johan Ahlers9ddac182016-07-22 08:57:23 +020021 cflags = []
22 ldflags = []
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +000023 if (build_with_mozilla) {
24 defines += [ "WEBRTC_MOZILLA_BUILD" ]
25 }
26 if (build_with_chromium) {
kjellanderf0e174a2016-05-30 06:27:50 -070027 defines = [
28 # TODO(kjellander): Cleanup unused ones and move defines closer to
29 # the source when webrtc:4256 is completed.
30 "FEATURE_ENABLE_SSL",
31 "FEATURE_ENABLE_VOICEMAIL",
32 "EXPAT_RELATIVE_PATH",
33 "GTEST_RELATIVE_PATH",
34 "NO_MAIN_THREAD_WRAPPING",
35 "NO_SOUND_SYSTEM",
36 "WEBRTC_CHROMIUM_BUILD",
37 ]
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +000038 include_dirs = [
henrikgee2bf412015-09-30 03:48:52 -070039 # The overrides must be included first as that is the mechanism for
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +000040 # selecting the override headers in Chromium.
henrikgee2bf412015-09-30 03:48:52 -070041 "../webrtc_overrides",
Henrik Kjellander57e5fd22015-05-25 12:55:39 +020042
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +000043 # Allow includes to be prefixed with webrtc/ in case it is not an
44 # immediate subdirectory of the top-level.
45 "..",
46 ]
47 }
48 if (is_posix) {
49 defines += [ "WEBRTC_POSIX" ]
50 }
51 if (is_ios) {
52 defines += [
53 "WEBRTC_MAC",
54 "WEBRTC_IOS",
55 ]
56 }
Zeke Chin71f6f442015-06-29 14:34:58 -070057 if (is_ios && rtc_use_objc_h264) {
58 defines += [ "WEBRTC_OBJC_H264" ]
59 }
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +000060 if (is_linux) {
61 defines += [ "WEBRTC_LINUX" ]
62 }
63 if (is_mac) {
64 defines += [ "WEBRTC_MAC" ]
65 }
66 if (is_win) {
kjellanderf0e174a2016-05-30 06:27:50 -070067 defines += [
68 "WEBRTC_WIN",
69 "_CRT_SECURE_NO_WARNINGS", # Suppress warnings about _vsnprinf
70 ]
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +000071 }
72 if (is_android) {
73 defines += [
74 "WEBRTC_LINUX",
75 "WEBRTC_ANDROID",
76 ]
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +000077 }
kjellanderf0e174a2016-05-30 06:27:50 -070078 if (is_chromeos) {
79 defines += [ "CHROMEOS" ]
80 }
81
Johan Ahlers9ddac182016-07-22 08:57:23 +020082 if (rtc_sanitize_coverage != "") {
83 assert(is_clang, "sanitizer coverage requires clang")
84 cflags += [ "-fsanitize-coverage=${rtc_sanitize_coverage}" ]
85 ldflags += [ "-fsanitize-coverage=${rtc_sanitize_coverage}" ]
86 }
87
kjellanderf0e174a2016-05-30 06:27:50 -070088 # TODO(GYP): Support these in GN.
89 # if (is_bsd) {
90 # defines += [ "BSD" ]
91 # }
92 # if (is_openbsd) {
93 # defines += [ "OPENBSD" ]
94 # }
95 # if (is_freebsd) {
96 # defines += [ "FREEBSD" ]
97 # }
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +000098}
99
kjellander@webrtc.org6d08ca62014-09-07 17:36:10 +0000100if (rtc_have_dbus_glib) {
kjellander@webrtc.org7497fa72014-06-28 18:05:22 +0000101 pkg_config("dbus-glib") {
102 packages = [ "dbus-glib-1" ]
103 }
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000104}
105
106config("common_config") {
kjellander@webrtc.org79ee97c2014-09-04 14:10:49 +0000107 cflags = []
108 cflags_cc = []
kjellanderf0e174a2016-05-30 06:27:50 -0700109 defines = []
110
kjellander@webrtc.org6d08ca62014-09-07 17:36:10 +0000111 if (rtc_restrict_logging) {
kjellanderf0e174a2016-05-30 06:27:50 -0700112 defines += [ "WEBRTC_RESTRICT_LOGGING" ]
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000113 }
114
kjellander82a94492016-06-12 22:12:01 -0700115 if (rtc_include_internal_audio_device) {
116 defines += [ "WEBRTC_INCLUDE_INTERNAL_AUDIO_DEVICE" ]
117 }
118
kjellander@webrtc.org6d08ca62014-09-07 17:36:10 +0000119 if (rtc_have_dbus_glib) {
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000120 defines += [ "HAVE_DBUS_GLIB" ]
Henrik Kjellander57e5fd22015-05-25 12:55:39 +0200121
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000122 # TODO(kjellander): Investigate this, it seems like include <dbus/dbus.h>
123 # is still not found even if the execution of
124 # build/config/linux/pkg-config.py dbus-glib-1 returns correct include
125 # dirs on Linux.
126 all_dependent_configs = [ "dbus-glib" ]
127 }
128
kjellanderc76dc952016-06-03 03:09:32 -0700129 if (rtc_relative_path) {
130 defines += [ "EXPAT_RELATIVE_PATH" ]
131 }
132
brettw@chromium.org9fe11012014-09-09 19:15:33 +0000133 if (build_with_chromium) {
kjellanderf0e174a2016-05-30 06:27:50 -0700134 defines += [
135 # NOTICE: Since common_inherited_config is used in public_configs for our
136 # targets, there's no point including the defines in that config here.
137 # TODO(kjellander): Cleanup unused ones and move defines closer to the
138 # source when webrtc:4256 is completed.
139 "ENABLE_EXTERNAL_AUTH",
140 "HAVE_OPENSSL_SSL_H",
141 "HAVE_SCTP",
142 "HAVE_SRTP",
143 "HAVE_WEBRTC_VIDEO",
144 "HAVE_WEBRTC_VOICE",
145 "LOGGING_INSIDE_WEBRTC",
146 "SRTP_RELATIVE_PATH",
147 "SSL_USE_OPENSSL",
148 "USE_WEBRTC_DEV_BRANCH",
149 ]
brettw@chromium.org9fe11012014-09-09 19:15:33 +0000150 } else {
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000151 if (is_posix) {
152 # -Wextra is currently disabled in Chromium"s common.gypi. Enable
153 # for targets that can handle it. For Android/arm64 right now
154 # there will be an "enumeral and non-enumeral type in conditional
155 # expression" warning in android_tools/ndk_experimental"s version
156 # of stlport.
157 # See: https://code.google.com/p/chromium/issues/detail?id=379699
kjellander@webrtc.org72273912015-02-23 19:08:31 +0000158 if (current_cpu != "arm64" || !is_android) {
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000159 cflags = [
160 "-Wextra",
Henrik Kjellander57e5fd22015-05-25 12:55:39 +0200161
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000162 # We need to repeat some flags from Chromium"s common.gypi
163 # here that get overridden by -Wextra.
164 "-Wno-unused-parameter",
165 "-Wno-missing-field-initializers",
166 "-Wno-strict-overflow",
167 ]
168 cflags_cc = [
169 "-Wnon-virtual-dtor",
Henrik Kjellander57e5fd22015-05-25 12:55:39 +0200170
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000171 # This is enabled for clang; enable for gcc as well.
172 "-Woverloaded-virtual",
173 ]
174 }
175 }
176
177 if (is_clang) {
kjellander3f032cf2016-04-27 07:13:46 -0700178 cflags += [
179 "-Wimplicit-fallthrough",
180 "-Wthread-safety",
nisse4996eaa2016-05-10 23:28:10 -0700181 "-Winconsistent-missing-override",
kjellander3f032cf2016-04-27 07:13:46 -0700182 ]
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000183 }
184 }
185
kjellander@webrtc.org72273912015-02-23 19:08:31 +0000186 if (current_cpu == "arm64") {
Andrew MacDonaldcb7f8ce2015-05-19 22:20:17 -0700187 defines += [ "WEBRTC_ARCH_ARM64" ]
188 defines += [ "WEBRTC_HAS_NEON" ]
tkchin@webrtc.org14146e42014-10-31 00:14:39 +0000189 }
190
kjellander@webrtc.org72273912015-02-23 19:08:31 +0000191 if (current_cpu == "arm") {
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000192 defines += [ "WEBRTC_ARCH_ARM" ]
andrew@webrtc.orga56a2c52014-11-26 17:01:40 +0000193 if (arm_version >= 7) {
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000194 defines += [ "WEBRTC_ARCH_ARM_V7" ]
195 if (arm_use_neon) {
Andrew MacDonaldcb7f8ce2015-05-19 22:20:17 -0700196 defines += [ "WEBRTC_HAS_NEON" ]
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000197 }
198 }
199 }
200
kjellander@webrtc.org72273912015-02-23 19:08:31 +0000201 if (current_cpu == "mipsel") {
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000202 defines += [ "MIPS32_LE" ]
kjellander@webrtc.org6dab6d72015-03-04 09:50:31 +0000203 if (mips_float_abi == "hard") {
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000204 defines += [ "MIPS_FPU_LE" ]
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000205 }
kjellander@webrtc.orgacb80852015-01-25 19:17:56 +0000206 if (mips_arch_variant == "r2") {
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000207 defines += [ "MIPS32_R2_LE" ]
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000208 }
209 if (mips_dsp_rev == 1) {
210 defines += [ "MIPS_DSP_R1_LE" ]
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000211 } else if (mips_dsp_rev == 2) {
212 defines += [
213 "MIPS_DSP_R1_LE",
214 "MIPS_DSP_R2_LE",
215 ]
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000216 }
217 }
218
Henrik Kjellanderc0c7d2e2015-09-07 12:57:42 +0200219 if (is_android && !is_clang) {
Henrik Kjellander5bfc6cb2015-09-21 16:50:45 +0200220 # The Android NDK doesn"t provide optimized versions of these
221 # functions. Ensure they are disabled for all compilers.
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000222 cflags += [
223 "-fno-builtin-cos",
224 "-fno-builtin-sin",
225 "-fno-builtin-cosf",
226 "-fno-builtin-sinf",
227 ]
228 }
katrielcbf81d682016-05-26 01:03:02 -0700229
metzmanf89a5712016-07-25 02:14:09 -0700230 if (use_libfuzzer || use_drfuzz || use_afl) {
katrielcbf81d682016-05-26 01:03:02 -0700231 # Used in Chromium's overrides to disable logging
232 defines += [ "WEBRTC_UNSAFE_FUZZER_MODE" ]
233 }
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000234}
235
kjellander3bcedd32016-06-08 01:14:15 -0700236config("common_objc") {
237 cflags = [ "-Wobjc-missing-property-synthesis" ]
238
239 precompiled_header = "sdk/objc/WebRTC-Prefix.pch"
240 precompiled_source = "sdk/objc/WebRTC-Prefix.pch"
241}
242
Nico Weber3ab32dc2016-08-02 09:53:25 -0400243if (!is_ios || !build_with_chromium) {
244 source_set("webrtc") {
245 sources = [
246 "call.h",
247 "config.h",
248 "transport.h",
kjellander94cee312016-06-10 01:56:57 -0700249 ]
Bjorn Terelius36411852015-07-30 12:45:18 +0200250
Nico Weber3ab32dc2016-08-02 09:53:25 -0400251 defines = []
252 configs += [ ":common_config" ]
253 public_configs = [ ":common_inherited_config" ]
254
255 deps = [
256 ":webrtc_common",
257 "audio",
258 "base:rtc_base",
259 "call",
260 "common_audio",
261 "common_video",
262 "modules",
263 "system_wrappers",
264 "tools",
265 "video",
266 "voice_engine",
267 ]
268
269 if (build_with_chromium) {
270 deps += [ "modules/video_capture" ]
271 } else {
272 # TODO(kjellander): Enable for Chromium as well when bugs.webrtc.org/4256
273 # is fixed. Right now it's not possible due to circular dependencies.
274 deps += [
275 "api",
276 "media",
277 "p2p",
278 "pc",
279 ]
280 }
281
282 if (rtc_enable_protobuf) {
283 defines += [ "ENABLE_RTC_EVENT_LOG" ]
284 deps += [ ":rtc_event_log_proto" ]
285 }
Bjorn Terelius36411852015-07-30 12:45:18 +0200286 }
kjellander@webrtc.org1227ab82014-06-23 19:21:07 +0000287}
288
kjellander@webrtc.orgb8caf6a2014-09-30 18:05:02 +0000289if (!build_with_chromium) {
290 executable("webrtc_tests") {
291 testonly = true
292 deps = [
293 ":webrtc",
kjellander@webrtc.orgb8caf6a2014-09-30 18:05:02 +0000294 "modules/video_capture:video_capture_internal_impl",
295 "test",
296 ]
297 }
298}
299
kjellander@webrtc.org1227ab82014-06-23 19:21:07 +0000300source_set("webrtc_common") {
301 sources = [
kjellander@webrtc.org50772f12016-02-29 06:49:43 +0100302 "audio_sink.h",
kwiberg@webrtc.orgac2d27d2015-02-26 13:59:22 +0000303 "common_types.cc",
kjellander@webrtc.orgd7e34e12015-01-26 19:17:26 +0000304 "common_types.h",
kjellander@webrtc.org1227ab82014-06-23 19:21:07 +0000305 "config.cc",
Henrik Kjellander57e5fd22015-05-25 12:55:39 +0200306 "config.h",
kjellander@webrtc.orgd7e34e12015-01-26 19:17:26 +0000307 "engine_configurations.h",
308 "typedefs.h",
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000309 ]
kjellander@webrtc.org9bef5512014-07-13 09:02:54 +0000310
kjellander@webrtc.orgf21ea912014-09-28 17:37:22 +0000311 configs += [ ":common_config" ]
312 public_configs = [ ":common_inherited_config" ]
aluebs688e3082016-01-14 04:32:46 -0800313
314 if (is_clang && !is_nacl) {
315 # Suppress warnings from Chrome's Clang plugins.
316 # See http://code.google.com/p/webrtc/issues/detail?id=163 for details.
317 configs -= [ "//build/config/clang:find_bad_constructs" ]
318 }
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000319}
kjellander@webrtc.orgd7e34e12015-01-26 19:17:26 +0000320
Bjorn Terelius36411852015-07-30 12:45:18 +0200321if (rtc_enable_protobuf) {
322 proto_library("rtc_event_log_proto") {
323 sources = [
Peter Boström5c389d32015-09-25 13:58:30 +0200324 "call/rtc_event_log.proto",
Bjorn Terelius36411852015-07-30 12:45:18 +0200325 ]
Peter Boström5c389d32015-09-25 13:58:30 +0200326 proto_out_dir = "webrtc/call"
Bjorn Terelius36411852015-07-30 12:45:18 +0200327 }
328}
329
330source_set("rtc_event_log") {
331 sources = [
Peter Boström5c389d32015-09-25 13:58:30 +0200332 "call/rtc_event_log.cc",
333 "call/rtc_event_log.h",
terelius4311ba52016-04-22 12:40:37 -0700334 "call/rtc_event_log_helper_thread.cc",
335 "call/rtc_event_log_helper_thread.h",
Bjorn Terelius36411852015-07-30 12:45:18 +0200336 ]
337
338 defines = []
339 configs += [ ":common_config" ]
340 public_configs = [ ":common_inherited_config" ]
341
342 deps = [
343 ":webrtc_common",
sakal06bfe1f2016-08-04 07:54:04 -0700344 "modules/rtp_rtcp",
Bjorn Terelius36411852015-07-30 12:45:18 +0200345 ]
346
347 if (rtc_enable_protobuf) {
348 defines += [ "ENABLE_RTC_EVENT_LOG" ]
349 deps += [ ":rtc_event_log_proto" ]
350 }
sergeyu4df08ff2015-09-02 14:22:40 -0700351 if (is_clang && !is_nacl) {
Bjorn Terelius36411852015-07-30 12:45:18 +0200352 # Suppress warnings from Chrome's Clang plugins.
353 # See http://code.google.com/p/webrtc/issues/detail?id=163 for details.
354 configs -= [ "//build/config/clang:find_bad_constructs" ]
355 }
356}
Peter Boström62e9bda2015-11-23 15:12:06 +0100357
tereliusd5c1a0b2016-05-13 00:42:59 -0700358if (rtc_enable_protobuf) {
359 source_set("rtc_event_log_parser") {
360 sources = [
361 "call/rtc_event_log_parser.cc",
362 "call/rtc_event_log_parser.h",
363 ]
364
365 configs += [ ":common_config" ]
366 public_configs = [ ":common_inherited_config" ]
367
terelius54ce6802016-07-13 06:44:41 -0700368 public_deps = [
tereliusd5c1a0b2016-05-13 00:42:59 -0700369 ":rtc_event_log_proto",
370 ":webrtc_common",
371 ]
372
373 if (is_clang && !is_nacl) {
374 # Suppress warnings from Chrome's Clang plugins.
375 # See http://code.google.com/p/webrtc/issues/detail?id=163 for details.
376 configs -= [ "//build/config/clang:find_bad_constructs" ]
377 }
378 }
379}
380
metzmanf89a5712016-07-25 02:14:09 -0700381if (use_libfuzzer || use_drfuzz || use_afl) {
Peter Boström1e0cfd92015-12-17 14:28:16 +0100382 # This target is only here for gn to discover fuzzer build targets under
383 # webrtc/test/fuzzers/.
384 group("webrtc_fuzzers_dummy") {
Peter Boström62e9bda2015-11-23 15:12:06 +0100385 testonly = true
386 deps = [
Peter Boström1e0cfd92015-12-17 14:28:16 +0100387 "test/fuzzers:webrtc_fuzzer_main",
Peter Boström62e9bda2015-11-23 15:12:06 +0100388 ]
389 }
390}
kjellander@webrtc.org3ee56142016-06-03 15:57:02 +0200391
kjellander@webrtc.orgaff499c2016-06-06 23:04:31 +0200392if (rtc_include_tests) {
kjellander@webrtc.org3ee56142016-06-03 15:57:02 +0200393 config("rtc_unittests_config") {
394 # GN orders flags on a target before flags from configs. The default config
395 # adds -Wall, and this flag have to be after -Wall -- so they need to
396 # come from a config and can"t be on the target directly.
397 if (is_clang) {
398 cflags = [
399 "-Wno-missing-braces",
400 "-Wno-sign-compare",
401 "-Wno-unused-const-variable",
402 ]
403 }
404 }
405
406 test("rtc_unittests") {
407 testonly = true
408 sources = [
409 "base/array_view_unittest.cc",
410 "base/atomicops_unittest.cc",
411 "base/autodetectproxy_unittest.cc",
412 "base/bandwidthsmoother_unittest.cc",
413 "base/base64_unittest.cc",
414 "base/basictypes_unittest.cc",
415 "base/bind_unittest.cc",
416 "base/bitbuffer_unittest.cc",
417 "base/buffer_unittest.cc",
418 "base/bufferqueue_unittest.cc",
419 "base/bytebuffer_unittest.cc",
420 "base/byteorder_unittest.cc",
421 "base/callback_unittest.cc",
422 "base/copyonwritebuffer_unittest.cc",
423 "base/crc32_unittest.cc",
424 "base/criticalsection_unittest.cc",
425 "base/event_tracer_unittest.cc",
426 "base/event_unittest.cc",
427 "base/exp_filter_unittest.cc",
kjellander@webrtc.org3ee56142016-06-03 15:57:02 +0200428 "base/filerotatingstream_unittest.cc",
429 "base/fileutils_unittest.cc",
430 "base/helpers_unittest.cc",
431 "base/httpbase_unittest.cc",
432 "base/httpcommon_unittest.cc",
433 "base/httpserver_unittest.cc",
434 "base/ipaddress_unittest.cc",
435 "base/logging_unittest.cc",
436 "base/md5digest_unittest.cc",
437 "base/messagedigest_unittest.cc",
438 "base/messagequeue_unittest.cc",
439 "base/mod_ops_unittest.cc",
440 "base/multipart_unittest.cc",
441 "base/nat_unittest.cc",
442 "base/network_unittest.cc",
443 "base/onetimeevent_unittest.cc",
444 "base/optional_unittest.cc",
445 "base/optionsfile_unittest.cc",
446 "base/pathutils_unittest.cc",
447 "base/platform_thread_unittest.cc",
448 "base/profiler_unittest.cc",
449 "base/proxy_unittest.cc",
450 "base/proxydetect_unittest.cc",
451 "base/random_unittest.cc",
sprangcd349d92016-07-13 09:11:28 -0700452 "base/rate_limiter_unittest.cc",
kjellander@webrtc.org3ee56142016-06-03 15:57:02 +0200453 "base/rate_statistics_unittest.cc",
454 "base/ratelimiter_unittest.cc",
455 "base/ratetracker_unittest.cc",
456 "base/referencecountedsingletonfactory_unittest.cc",
457 "base/rollingaccumulator_unittest.cc",
458 "base/rtccertificate_unittest.cc",
459 "base/rtccertificategenerator_unittest.cc",
460 "base/scopedptrcollection_unittest.cc",
perkj9c16fe82016-07-12 15:04:07 -0700461 "base/sequenced_task_checker_unittest.cc",
kjellander@webrtc.org3ee56142016-06-03 15:57:02 +0200462 "base/sha1digest_unittest.cc",
463 "base/sharedexclusivelock_unittest.cc",
464 "base/signalthread_unittest.cc",
465 "base/sigslot_unittest.cc",
466 "base/sigslottester.h",
467 "base/sigslottester.h.pump",
468 "base/stream_unittest.cc",
469 "base/stringencode_unittest.cc",
470 "base/stringutils_unittest.cc",
471 "base/swap_queue_unittest.cc",
472
473 # TODO(ronghuawu): Reenable this test.
474 # "systeminfo_unittest.cc",
475 "base/task_queue_unittest.cc",
476 "base/task_unittest.cc",
477 "base/testclient_unittest.cc",
478 "base/thread_checker_unittest.cc",
479 "base/thread_unittest.cc",
nisse191b3592016-06-22 08:36:53 -0700480 "base/timestampaligner_unittest.cc",
kjellander@webrtc.org3ee56142016-06-03 15:57:02 +0200481 "base/timeutils_unittest.cc",
482 "base/urlencode_unittest.cc",
483 "base/versionparsing_unittest.cc",
484
485 # TODO(ronghuawu): Reenable this test.
486 # "windowpicker_unittest.cc",
487 "p2p/base/dtlstransportchannel_unittest.cc",
488 "p2p/base/fakeportallocator.h",
489 "p2p/base/faketransportcontroller.h",
490 "p2p/base/p2ptransportchannel_unittest.cc",
491 "p2p/base/port_unittest.cc",
492 "p2p/base/portallocator_unittest.cc",
493 "p2p/base/pseudotcp_unittest.cc",
494 "p2p/base/relayport_unittest.cc",
495 "p2p/base/relayserver_unittest.cc",
496 "p2p/base/stun_unittest.cc",
497 "p2p/base/stunport_unittest.cc",
498 "p2p/base/stunrequest_unittest.cc",
499 "p2p/base/stunserver_unittest.cc",
500 "p2p/base/tcpport_unittest.cc",
501 "p2p/base/testrelayserver.h",
502 "p2p/base/teststunserver.h",
503 "p2p/base/testturnserver.h",
504 "p2p/base/transport_unittest.cc",
505 "p2p/base/transportcontroller_unittest.cc",
506 "p2p/base/transportdescriptionfactory_unittest.cc",
507 "p2p/base/turnport_unittest.cc",
Taylor Brandstetter734262c2016-08-01 16:37:14 -0700508 "p2p/base/turnserver_unittest.cc",
kjellander@webrtc.org3ee56142016-06-03 15:57:02 +0200509 "p2p/client/basicportallocator_unittest.cc",
510 "p2p/stunprober/stunprober_unittest.cc",
511 ]
512
513 if (is_linux) {
514 sources += [
515 "base/latebindingsymboltable_unittest.cc",
516
517 # TODO(ronghuawu): Reenable this test.
518 # "linux_unittest.cc",
519 "base/linuxfdwalk_unittest.cc",
520 ]
521 }
522
523 if (is_win) {
524 sources += [
525 "base/win32_unittest.cc",
526 "base/win32regkey_unittest.cc",
527 "base/win32window_unittest.cc",
528 "base/win32windowpicker_unittest.cc",
529 "base/winfirewall_unittest.cc",
530 ]
531 }
532
533 if (is_mac) {
534 sources += [ "base/macutils_unittest.cc" ]
535 }
536
537 if (is_posix) {
538 sources += [
539 "base/ssladapter_unittest.cc",
540 "base/sslidentity_unittest.cc",
541 "base/sslstreamadapter_unittest.cc",
542 ]
543 }
544 if (is_ios || (is_mac && target_cpu != "x86")) {
545 defines = [ "CARBON_DEPRECATED=YES" ]
546 }
547
548 if (rtc_use_quic) {
549 sources += [
550 "p2p/quic/quicconnectionhelper_unittest.cc",
551 "p2p/quic/quicsession_unittest.cc",
552 "p2p/quic/quictransport_unittest.cc",
553 "p2p/quic/quictransportchannel_unittest.cc",
554 "p2p/quic/reliablequicstream_unittest.cc",
555 ]
556 }
557
558 configs += [
559 ":common_config",
560 ":rtc_unittests_config",
561 ]
562 public_configs = [ ":common_inherited_config" ]
563
564 if (is_clang) {
565 # Suppress warnings from the Chromium Clang plugin.
566 # See http://code.google.com/p/webrtc/issues/detail?id=163 for details.
567 configs -= [ "//build/config/clang:find_bad_constructs" ]
568 }
569
570 deps = [
571 "base:rtc_base",
kjellander82a94492016-06-12 22:12:01 -0700572 "base:rtc_base_tests_utils",
kjellander@webrtc.org3ee56142016-06-03 15:57:02 +0200573 "base:rtc_task_queue",
574 "p2p:libstunprober",
575 "p2p:rtc_p2p",
576 "//testing/gmock",
577 "//testing/gtest",
578 ]
579
580 if (is_android) {
581 deps += [ "//testing/android/native_test:native_test_support" ]
582 }
kjellander3bcedd32016-06-08 01:14:15 -0700583
584 if (is_ios || (is_mac && mac_deployment_target == "10.7")) {
585 deps += [
586 "sdk:rtc_sdk_peerconnection_objc",
587 "system_wrappers:system_wrappers_default",
588 ]
589 sources += [
590 "sdk/objc/Framework/UnitTests/RTCConfigurationTest.mm",
591 "sdk/objc/Framework/UnitTests/RTCDataChannelConfigurationTest.mm",
592 "sdk/objc/Framework/UnitTests/RTCIceCandidateTest.mm",
593 "sdk/objc/Framework/UnitTests/RTCIceServerTest.mm",
594 "sdk/objc/Framework/UnitTests/RTCMediaConstraintsTest.mm",
595 "sdk/objc/Framework/UnitTests/RTCSessionDescriptionTest.mm",
596 ]
597
598 # TODO(tkchin): Cleanup this warning.
599 cflags = [ "-Wno-objc-property-no-attribute" ]
600
601 # |-ObjC| flag needed to make sure category method implementations
602 # are included:
603 # https://developer.apple.com/library/mac/qa/qa1490/_index.html
604 ldflags = [ "-ObjC" ]
605 }
kjellander@webrtc.org3ee56142016-06-03 15:57:02 +0200606 }
Peter Boström02083222016-06-14 12:52:54 +0200607
charujain604fc112016-08-04 01:16:39 -0700608 test("xmllite_xmpp_unittests") {
609 configs += [
610 ":common_config",
611 ":rtc_unittests_config",
612 ]
613 public_configs = [ ":common_inherited_config" ]
614
615 if (is_clang) {
616 # Suppress warnings from the Chromium Clang plugin.
617 # See http://code.google.com/p/webrtc/issues/detail?id=163 for details.
618 configs -= [ "//build/config/clang:find_bad_constructs" ]
619 }
620
621 deps = [
622 "base:rtc_base_tests_utils",
623 "libjingle/xmllite:rtc_xmllite",
624 "libjingle/xmpp:rtc_xmpp",
625 "//testing/gtest",
626 ]
627
628 sources = [
629 "libjingle/xmllite/qname_unittest.cc",
630 "libjingle/xmllite/xmlbuilder_unittest.cc",
631 "libjingle/xmllite/xmlelement_unittest.cc",
632 "libjingle/xmllite/xmlnsstack_unittest.cc",
633 "libjingle/xmllite/xmlparser_unittest.cc",
634 "libjingle/xmllite/xmlprinter_unittest.cc",
635 "libjingle/xmpp/fakexmppclient.h",
636 "libjingle/xmpp/hangoutpubsubclient_unittest.cc",
637 "libjingle/xmpp/jid_unittest.cc",
638 "libjingle/xmpp/mucroomconfigtask_unittest.cc",
639 "libjingle/xmpp/mucroomdiscoverytask_unittest.cc",
640 "libjingle/xmpp/mucroomlookuptask_unittest.cc",
641 "libjingle/xmpp/mucroomuniquehangoutidtask_unittest.cc",
642 "libjingle/xmpp/pingtask_unittest.cc",
643 "libjingle/xmpp/pubsubclient_unittest.cc",
644 "libjingle/xmpp/pubsubtasks_unittest.cc",
645 "libjingle/xmpp/util_unittest.cc",
646 "libjingle/xmpp/util_unittest.h",
647 "libjingle/xmpp/xmppengine_unittest.cc",
648 "libjingle/xmpp/xmpplogintask_unittest.cc",
649 "libjingle/xmpp/xmppstanzaparser_unittest.cc",
650 ]
651 }
652
Peter Boström02083222016-06-14 12:52:54 +0200653 # TODO(pbos): Rename test suite, this is no longer "just" for video targets.
654 test("video_engine_tests") {
655 testonly = true
656 deps = [
657 "audio:audio_tests",
658 "call:call_tests",
659 "modules/video_capture",
660 "test:test_common",
661 "test:test_main",
662 "video:video_tests",
663 ]
664 if (is_clang) {
665 # Suppress warnings from the Chromium Clang plugin.
666 # See http://code.google.com/p/webrtc/issues/detail?id=163 for details.
667 configs -= [ "//build/config/clang:find_bad_constructs" ]
668 }
669 }
Peter Boströmac968bd2016-06-27 19:31:39 +0200670
ehmaldonado529f83c2016-07-27 08:14:32 -0700671 source_set("video_quality_test") {
672 testonly = true
673 configs += [ ":common_config" ]
674 public_configs = [ ":common_inherited_config" ]
675 sources = [
676 "video/video_quality_test.cc",
677 "video/video_quality_test.h",
678 ]
679 deps = [
680 ":webrtc",
681 "system_wrappers",
682 "//testing/gtest",
683 ]
684 if (!is_android) {
685 deps += [ "modules/video_capture:video_capture_internal_impl" ]
686 }
687 if (is_clang) {
688 # Suppress warnings from the Chromium Clang plugin.
689 # See http://code.google.com/p/webrtc/issues/detail?id=163 for details.
690 configs -= [ "//build/config/clang:find_bad_constructs" ]
691 }
692 }
693
694 test("webrtc_perf_tests") {
695 testonly = true
696 configs += [
697 ":common_config",
698 ":rtc_unittests_config",
699 ]
700 public_configs = [ ":common_inherited_config" ]
701 sources = [
702 "call/call_perf_tests.cc",
703 "call/rampup_tests.cc",
704 "call/rampup_tests.h",
705 "modules/audio_coding/neteq/test/neteq_performance_unittest.cc",
706 "modules/audio_processing/audio_processing_performance_unittest.cc",
707 "modules/audio_processing/level_controller/level_controller_complexity_unittest.cc",
708 "modules/remote_bitrate_estimator/remote_bitrate_estimators_test.cc",
709 "video/full_stack.cc",
710 ]
711 deps = [
712 ":video_quality_test",
713 ":webrtc",
714 "modules/audio_coding:neteq_test_support",
715 "modules/audio_processing",
716 "modules/audio_processing:audioproc_test_utils",
717 "modules/remote_bitrate_estimator:bwe_simulator",
718 "modules/rtp_rtcp",
719 "test:channel_transport",
720 "test:test_common",
721 "test:test_main",
722 "test:test_renderer",
723 "voice_engine",
724 "//testing/gmock",
725 "//testing/gtest",
726 ]
727 if (is_android) {
728 deps += [ "//testing/android/native_test:native_test_native_code" ]
729 }
730 if (is_clang) {
731 # Suppress warnings from the Chromium Clang plugin.
732 # See http://code.google.com/p/webrtc/issues/detail?id=163 for details.
733 configs -= [ "//build/config/clang:find_bad_constructs" ]
734 }
735 }
736
Peter Boströmac968bd2016-06-27 19:31:39 +0200737 test("webrtc_nonparallel_tests") {
738 testonly = true
739 configs += [
740 ":common_config",
741 ":rtc_unittests_config",
742 ]
743 public_configs = [ ":common_inherited_config" ]
744 sources = [
745 "base/nullsocketserver_unittest.cc",
danilchapb7b9dca2016-08-05 05:55:43 -0700746 "base/physicalsocketserver_unittest.cc",
747 "base/socket_unittest.cc",
748 "base/socket_unittest.h",
Peter Boströmac968bd2016-06-27 19:31:39 +0200749 "base/socketaddress_unittest.cc",
750 "base/virtualsocket_unittest.cc",
751 ]
752 deps = [
753 "base:rtc_base",
754 "base:rtc_base_tests_utils",
755 "//testing/gtest",
756 ]
757 if (is_win) {
danilchapb7b9dca2016-08-05 05:55:43 -0700758 sources += [ "base/win32socketserver_unittest.cc" ]
Peter Boströmac968bd2016-06-27 19:31:39 +0200759 }
760 if (is_android) {
761 deps += [ "//testing/android/native_test:native_test_support" ]
762 }
763
764 if (is_mac) {
765 sources += [ "base/macsocketserver_unittest.cc" ]
766 }
767 if (is_ios || (is_mac && target_cpu != "x86")) {
768 defines = [ "CARBON_DEPRECATED=YES" ]
769 }
770 if (is_clang) {
771 # Suppress warnings from the Chromium Clang plugin.
772 # See http://code.google.com/p/webrtc/issues/detail?id=163 for details.
773 configs -= [ "//build/config/clang:find_bad_constructs" ]
774 }
775 }
kjellander@webrtc.org3ee56142016-06-03 15:57:02 +0200776}