blob: da67c093ec2a046a7538183bdff7e412556b8bbf [file] [log] [blame]
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +00001# Copyright (c) 2014 The WebRTC project authors. All Rights Reserved.
2#
3# Use of this source code is governed by a BSD-style license
4# that can be found in the LICENSE file in the root of the source
5# tree. An additional intellectual property rights grant can be found
6# in the file PATENTS. All contributing project authors may
7# be found in the AUTHORS file in the root of the source tree.
8
kjellander@webrtc.org7497fa72014-06-28 18:05:22 +00009# TODO(kjellander): Rebase this to webrtc/build/common.gypi changes after r6330.
10
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +000011import("//build/config/linux/pkg_config.gni")
Peter Boström62e9bda2015-11-23 15:12:06 +010012import("//build/config/sanitizers/sanitizers.gni")
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +000013import("build/webrtc.gni")
Bjorn Terelius36411852015-07-30 12:45:18 +020014import("//third_party/protobuf/proto_library.gni")
sakal80a5bf12016-09-16 07:22:17 -070015if (is_android) {
16 import("//build/config/android/config.gni")
17 import("//build/config/android/rules.gni")
18}
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +000019
20# Contains the defines and includes in common.gypi that are duplicated both as
21# target_defaults and direct_dependent_settings.
22config("common_inherited_config") {
23 defines = []
Johan Ahlers9ddac182016-07-22 08:57:23 +020024 cflags = []
25 ldflags = []
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +000026 if (build_with_mozilla) {
27 defines += [ "WEBRTC_MOZILLA_BUILD" ]
28 }
29 if (build_with_chromium) {
kjellanderf0e174a2016-05-30 06:27:50 -070030 defines = [
31 # TODO(kjellander): Cleanup unused ones and move defines closer to
32 # the source when webrtc:4256 is completed.
33 "FEATURE_ENABLE_SSL",
34 "FEATURE_ENABLE_VOICEMAIL",
35 "EXPAT_RELATIVE_PATH",
36 "GTEST_RELATIVE_PATH",
37 "NO_MAIN_THREAD_WRAPPING",
38 "NO_SOUND_SYSTEM",
39 "WEBRTC_CHROMIUM_BUILD",
40 ]
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +000041 include_dirs = [
henrikgee2bf412015-09-30 03:48:52 -070042 # The overrides must be included first as that is the mechanism for
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +000043 # selecting the override headers in Chromium.
henrikgee2bf412015-09-30 03:48:52 -070044 "../webrtc_overrides",
Henrik Kjellander57e5fd22015-05-25 12:55:39 +020045
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +000046 # Allow includes to be prefixed with webrtc/ in case it is not an
47 # immediate subdirectory of the top-level.
48 "..",
49 ]
50 }
51 if (is_posix) {
52 defines += [ "WEBRTC_POSIX" ]
53 }
54 if (is_ios) {
55 defines += [
56 "WEBRTC_MAC",
57 "WEBRTC_IOS",
58 ]
59 }
60 if (is_linux) {
61 defines += [ "WEBRTC_LINUX" ]
62 }
63 if (is_mac) {
64 defines += [ "WEBRTC_MAC" ]
65 }
66 if (is_win) {
kjellanderf0e174a2016-05-30 06:27:50 -070067 defines += [
68 "WEBRTC_WIN",
69 "_CRT_SECURE_NO_WARNINGS", # Suppress warnings about _vsnprinf
70 ]
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +000071 }
72 if (is_android) {
73 defines += [
74 "WEBRTC_LINUX",
75 "WEBRTC_ANDROID",
76 ]
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +000077 }
kjellanderf0e174a2016-05-30 06:27:50 -070078 if (is_chromeos) {
79 defines += [ "CHROMEOS" ]
80 }
81
Johan Ahlers9ddac182016-07-22 08:57:23 +020082 if (rtc_sanitize_coverage != "") {
83 assert(is_clang, "sanitizer coverage requires clang")
84 cflags += [ "-fsanitize-coverage=${rtc_sanitize_coverage}" ]
85 ldflags += [ "-fsanitize-coverage=${rtc_sanitize_coverage}" ]
86 }
87
kjellanderf0e174a2016-05-30 06:27:50 -070088 # TODO(GYP): Support these in GN.
89 # if (is_bsd) {
90 # defines += [ "BSD" ]
91 # }
92 # if (is_openbsd) {
93 # defines += [ "OPENBSD" ]
94 # }
95 # if (is_freebsd) {
96 # defines += [ "FREEBSD" ]
97 # }
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +000098}
99
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000100config("common_config") {
kjellander@webrtc.org79ee97c2014-09-04 14:10:49 +0000101 cflags = []
102 cflags_cc = []
kjellanderf0e174a2016-05-30 06:27:50 -0700103 defines = []
104
kjellander@webrtc.org6d08ca62014-09-07 17:36:10 +0000105 if (rtc_restrict_logging) {
kjellanderf0e174a2016-05-30 06:27:50 -0700106 defines += [ "WEBRTC_RESTRICT_LOGGING" ]
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000107 }
108
kjellander82a94492016-06-12 22:12:01 -0700109 if (rtc_include_internal_audio_device) {
110 defines += [ "WEBRTC_INCLUDE_INTERNAL_AUDIO_DEVICE" ]
111 }
112
kjellanderc76dc952016-06-03 03:09:32 -0700113 if (rtc_relative_path) {
114 defines += [ "EXPAT_RELATIVE_PATH" ]
115 }
116
phoglund33603522016-10-05 06:52:22 -0700117 if (!rtc_libvpx_build_vp9) {
118 defines += [ "RTC_DISABLE_VP9" ]
119 }
120
brettw@chromium.org9fe11012014-09-09 19:15:33 +0000121 if (build_with_chromium) {
kjellanderf0e174a2016-05-30 06:27:50 -0700122 defines += [
123 # NOTICE: Since common_inherited_config is used in public_configs for our
124 # targets, there's no point including the defines in that config here.
125 # TODO(kjellander): Cleanup unused ones and move defines closer to the
126 # source when webrtc:4256 is completed.
127 "ENABLE_EXTERNAL_AUTH",
128 "HAVE_OPENSSL_SSL_H",
129 "HAVE_SCTP",
130 "HAVE_SRTP",
131 "HAVE_WEBRTC_VIDEO",
132 "HAVE_WEBRTC_VOICE",
133 "LOGGING_INSIDE_WEBRTC",
kjellanderf0e174a2016-05-30 06:27:50 -0700134 "SSL_USE_OPENSSL",
135 "USE_WEBRTC_DEV_BRANCH",
136 ]
brettw@chromium.org9fe11012014-09-09 19:15:33 +0000137 } else {
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000138 if (is_posix) {
kjellander496c64c2016-11-03 07:57:35 -0700139 # Enable more warnings: -Wextra is currently disabled in Chromium.
140 cflags = [
141 "-Wextra",
Henrik Kjellander57e5fd22015-05-25 12:55:39 +0200142
kjellander496c64c2016-11-03 07:57:35 -0700143 # Repeat some flags that get overridden by -Wextra.
144 "-Wno-unused-parameter",
145 "-Wno-missing-field-initializers",
146 "-Wno-strict-overflow",
147 ]
148 cflags_cc = [
149 "-Wnon-virtual-dtor",
Henrik Kjellander57e5fd22015-05-25 12:55:39 +0200150
kjellander496c64c2016-11-03 07:57:35 -0700151 # This is enabled for clang; enable for gcc as well.
152 "-Woverloaded-virtual",
153 ]
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000154 }
155
156 if (is_clang) {
kjellander3f032cf2016-04-27 07:13:46 -0700157 cflags += [
158 "-Wimplicit-fallthrough",
159 "-Wthread-safety",
nisse4996eaa2016-05-10 23:28:10 -0700160 "-Winconsistent-missing-override",
kwiberg77eab702016-09-28 17:42:01 -0700161 "-Wundef",
kjellander3f032cf2016-04-27 07:13:46 -0700162 ]
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000163 }
164 }
165
kjellander@webrtc.org72273912015-02-23 19:08:31 +0000166 if (current_cpu == "arm64") {
Andrew MacDonaldcb7f8ce2015-05-19 22:20:17 -0700167 defines += [ "WEBRTC_ARCH_ARM64" ]
168 defines += [ "WEBRTC_HAS_NEON" ]
tkchin@webrtc.org14146e42014-10-31 00:14:39 +0000169 }
170
kjellander@webrtc.org72273912015-02-23 19:08:31 +0000171 if (current_cpu == "arm") {
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000172 defines += [ "WEBRTC_ARCH_ARM" ]
andrew@webrtc.orga56a2c52014-11-26 17:01:40 +0000173 if (arm_version >= 7) {
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000174 defines += [ "WEBRTC_ARCH_ARM_V7" ]
175 if (arm_use_neon) {
Andrew MacDonaldcb7f8ce2015-05-19 22:20:17 -0700176 defines += [ "WEBRTC_HAS_NEON" ]
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000177 }
178 }
179 }
180
kjellander@webrtc.org72273912015-02-23 19:08:31 +0000181 if (current_cpu == "mipsel") {
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000182 defines += [ "MIPS32_LE" ]
kjellander@webrtc.org6dab6d72015-03-04 09:50:31 +0000183 if (mips_float_abi == "hard") {
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000184 defines += [ "MIPS_FPU_LE" ]
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000185 }
kjellander@webrtc.orgacb80852015-01-25 19:17:56 +0000186 if (mips_arch_variant == "r2") {
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000187 defines += [ "MIPS32_R2_LE" ]
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000188 }
189 if (mips_dsp_rev == 1) {
190 defines += [ "MIPS_DSP_R1_LE" ]
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000191 } else if (mips_dsp_rev == 2) {
192 defines += [
193 "MIPS_DSP_R1_LE",
194 "MIPS_DSP_R2_LE",
195 ]
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000196 }
197 }
198
Henrik Kjellanderc0c7d2e2015-09-07 12:57:42 +0200199 if (is_android && !is_clang) {
Henrik Kjellander5bfc6cb2015-09-21 16:50:45 +0200200 # The Android NDK doesn"t provide optimized versions of these
201 # functions. Ensure they are disabled for all compilers.
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000202 cflags += [
203 "-fno-builtin-cos",
204 "-fno-builtin-sin",
205 "-fno-builtin-cosf",
206 "-fno-builtin-sinf",
207 ]
208 }
katrielcbf81d682016-05-26 01:03:02 -0700209
metzmanf89a5712016-07-25 02:14:09 -0700210 if (use_libfuzzer || use_drfuzz || use_afl) {
katrielcbf81d682016-05-26 01:03:02 -0700211 # Used in Chromium's overrides to disable logging
212 defines += [ "WEBRTC_UNSAFE_FUZZER_MODE" ]
213 }
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000214}
215
kjellander3bcedd32016-06-08 01:14:15 -0700216config("common_objc") {
tkchin2ddfdba2016-08-07 21:37:45 -0700217 libs = [ "Foundation.framework" ]
kjellander3bcedd32016-06-08 01:14:15 -0700218 precompiled_header = "sdk/objc/WebRTC-Prefix.pch"
219 precompiled_source = "sdk/objc/WebRTC-Prefix.pch"
220}
221
kjellander6ceab082016-10-28 05:44:03 -0700222if (!build_with_chromium) {
223 # Target to build all the WebRTC production code.
kjellanderee996962016-09-27 12:13:13 -0700224 rtc_static_library("webrtc") {
kjellander6ceab082016-10-28 05:44:03 -0700225 # Only the root target should depend on this.
226 visibility = [ "//:default" ]
227
Nico Weber3ab32dc2016-08-02 09:53:25 -0400228 sources = [
kjellanderee996962016-09-27 12:13:13 -0700229 # TODO(kjellander): Remove this whenever possible. GN's static_library
230 # target type requires at least one object to avoid errors linking.
231 "build/no_op_function.cc",
ossuf515ab82016-12-07 04:52:58 -0800232
233 # TODO(ossu): Keep this here until donwstream projects have updated.
234 # http://bugs.webrtc.org/6716
Nico Weber3ab32dc2016-08-02 09:53:25 -0400235 "call.h",
236 "config.h",
kjellander94cee312016-06-10 01:56:57 -0700237 ]
Bjorn Terelius36411852015-07-30 12:45:18 +0200238
Nico Weber3ab32dc2016-08-02 09:53:25 -0400239 defines = []
Nico Weber3ab32dc2016-08-02 09:53:25 -0400240
241 deps = [
242 ":webrtc_common",
kjellander6ceab082016-10-28 05:44:03 -0700243 "api",
aleloia8eb7562016-11-28 07:02:13 -0800244 "api:transport_api",
Nico Weber3ab32dc2016-08-02 09:53:25 -0400245 "audio",
kjellander6ceab082016-10-28 05:44:03 -0700246 "base",
Nico Weber3ab32dc2016-08-02 09:53:25 -0400247 "call",
248 "common_audio",
249 "common_video",
kjellander6ceab082016-10-28 05:44:03 -0700250 "libjingle/xmllite",
251 "libjingle/xmpp",
252 "logging",
253 "media",
Nico Weber3ab32dc2016-08-02 09:53:25 -0400254 "modules",
kjellander6ceab082016-10-28 05:44:03 -0700255 "modules/video_capture:video_capture_internal_impl",
256 "p2p",
257 "pc",
258 "sdk",
hbos615d3012016-08-24 01:33:13 -0700259 "stats",
Nico Weber3ab32dc2016-08-02 09:53:25 -0400260 "system_wrappers",
Nico Weber3ab32dc2016-08-02 09:53:25 -0400261 "video",
262 "voice_engine",
263 ]
264
Nico Weber3ab32dc2016-08-02 09:53:25 -0400265 if (rtc_enable_protobuf) {
266 defines += [ "ENABLE_RTC_EVENT_LOG" ]
skvladcc91d282016-10-03 18:31:22 -0700267 deps += [ "logging:rtc_event_log_proto" ]
Nico Weber3ab32dc2016-08-02 09:53:25 -0400268 }
Bjorn Terelius36411852015-07-30 12:45:18 +0200269 }
kjellander6ceab082016-10-28 05:44:03 -0700270
271 if (rtc_include_tests) {
272 # Target to build all the WebRTC tests (but not examples or tools).
273 # Executable in order to get a target that links all WebRTC code.
274 rtc_executable("webrtc_tests") {
275 testonly = true
276
277 # Only the root target should depend on this.
278 visibility = [ "//:default" ]
279
280 deps = [
281 ":rtc_unittests",
282 ":video_engine_tests",
283 ":webrtc_nonparallel_tests",
284 ":webrtc_perf_tests",
kjellander6ceab082016-10-28 05:44:03 -0700285 "api:peerconnection_unittests",
286 "common_audio:common_audio_unittests",
287 "common_video:common_video_unittests",
kjellandereee9c0e2016-11-08 03:18:38 -0800288 "libjingle:xmllite_xmpp_unittests",
kjellander6ceab082016-10-28 05:44:03 -0700289 "media:rtc_media_unittests",
290 "modules:modules_tests",
291 "modules:modules_unittests",
292 "modules/audio_coding:audio_coding_tests",
293 "modules/audio_processing:audio_processing_tests",
294 "modules/rtp_rtcp:test_packet_masks_metrics",
295 "modules/video_capture:video_capture_internal_impl",
296 "pc:rtc_pc_unittests",
297 "stats:rtc_stats_unittests",
298 "system_wrappers:system_wrappers_unittests",
299 "test",
300 "video:screenshare_loopback",
301 "video:video_loopback",
302 "video:video_tests",
303 "voice_engine:voe_cmd_test",
304 "voice_engine:voice_engine_unittests",
305 ]
306 if (is_android) {
307 deps += [
308 ":android_junit_tests",
magjed768c6482016-12-06 04:29:37 -0800309 "//webrtc/sdk/android:libjingle_peerconnection_android_unittest",
kjellander6ceab082016-10-28 05:44:03 -0700310 ]
311 } else {
312 deps += [ "modules/video_capture:video_capture_tests" ]
313 }
314 if (!is_ios) {
315 deps += [
316 "modules/audio_device:audio_device_tests",
317 "voice_engine:voe_auto_test",
318 ]
319 }
320 }
321 }
kjellander@webrtc.org1227ab82014-06-23 19:21:07 +0000322}
323
kjellanderb62dbbe2016-09-23 00:38:52 -0700324rtc_static_library("webrtc_common") {
kjellander@webrtc.org1227ab82014-06-23 19:21:07 +0000325 sources = [
kwiberg@webrtc.orgac2d27d2015-02-26 13:59:22 +0000326 "common_types.cc",
kjellander@webrtc.orgd7e34e12015-01-26 19:17:26 +0000327 "common_types.h",
kjellander@webrtc.org1227ab82014-06-23 19:21:07 +0000328 "config.cc",
Henrik Kjellander57e5fd22015-05-25 12:55:39 +0200329 "config.h",
kjellander@webrtc.orgd7e34e12015-01-26 19:17:26 +0000330 "typedefs.h",
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000331 ]
kjellander@webrtc.org9bef5512014-07-13 09:02:54 +0000332
kjellandere40a7ee2016-10-16 23:56:12 -0700333 if (!build_with_chromium && is_clang) {
334 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
ehmaldonado38a21322016-09-02 04:10:34 -0700335 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
aluebs688e3082016-01-14 04:32:46 -0800336 }
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000337}
kjellander@webrtc.orgd7e34e12015-01-26 19:17:26 +0000338
metzmanf89a5712016-07-25 02:14:09 -0700339if (use_libfuzzer || use_drfuzz || use_afl) {
Peter Boström1e0cfd92015-12-17 14:28:16 +0100340 # This target is only here for gn to discover fuzzer build targets under
341 # webrtc/test/fuzzers/.
342 group("webrtc_fuzzers_dummy") {
Peter Boström62e9bda2015-11-23 15:12:06 +0100343 testonly = true
344 deps = [
Peter Boström1e0cfd92015-12-17 14:28:16 +0100345 "test/fuzzers:webrtc_fuzzer_main",
Peter Boström62e9bda2015-11-23 15:12:06 +0100346 ]
347 }
348}
kjellander@webrtc.org3ee56142016-06-03 15:57:02 +0200349
kjellander@webrtc.orgaff499c2016-06-06 23:04:31 +0200350if (rtc_include_tests) {
kjellander@webrtc.org3ee56142016-06-03 15:57:02 +0200351 config("rtc_unittests_config") {
352 # GN orders flags on a target before flags from configs. The default config
353 # adds -Wall, and this flag have to be after -Wall -- so they need to
354 # come from a config and can"t be on the target directly.
355 if (is_clang) {
356 cflags = [
357 "-Wno-missing-braces",
358 "-Wno-sign-compare",
359 "-Wno-unused-const-variable",
360 ]
361 }
362 }
363
ehmaldonado38a21322016-09-02 04:10:34 -0700364 rtc_test("rtc_unittests") {
kjellander@webrtc.org3ee56142016-06-03 15:57:02 +0200365 testonly = true
366 sources = [
Honghai Zhangd93f50c2016-10-05 11:47:22 -0700367 "api/fakemetricsobserver.cc",
minyue69b627d2016-11-24 11:01:09 -0800368 "base/analytics/exp_filter_unittest.cc",
tereliuscb861e02016-11-30 06:51:57 -0800369 "base/analytics/percentile_filter_unittest.cc",
kjellander@webrtc.org3ee56142016-06-03 15:57:02 +0200370 "base/array_view_unittest.cc",
371 "base/atomicops_unittest.cc",
372 "base/autodetectproxy_unittest.cc",
kjellander@webrtc.org3ee56142016-06-03 15:57:02 +0200373 "base/base64_unittest.cc",
374 "base/basictypes_unittest.cc",
375 "base/bind_unittest.cc",
376 "base/bitbuffer_unittest.cc",
377 "base/buffer_unittest.cc",
378 "base/bufferqueue_unittest.cc",
379 "base/bytebuffer_unittest.cc",
380 "base/byteorder_unittest.cc",
381 "base/callback_unittest.cc",
382 "base/copyonwritebuffer_unittest.cc",
383 "base/crc32_unittest.cc",
384 "base/criticalsection_unittest.cc",
385 "base/event_tracer_unittest.cc",
386 "base/event_unittest.cc",
Viktor Palmkvist4ec6a0c2016-09-02 13:38:32 +0200387 "base/file_unittest.cc",
kjellander@webrtc.org3ee56142016-06-03 15:57:02 +0200388 "base/filerotatingstream_unittest.cc",
389 "base/fileutils_unittest.cc",
kwiberg24c7c122016-09-28 11:57:10 -0700390 "base/function_view_unittest.cc",
kjellander@webrtc.org3ee56142016-06-03 15:57:02 +0200391 "base/helpers_unittest.cc",
392 "base/httpbase_unittest.cc",
393 "base/httpcommon_unittest.cc",
394 "base/httpserver_unittest.cc",
395 "base/ipaddress_unittest.cc",
396 "base/logging_unittest.cc",
397 "base/md5digest_unittest.cc",
398 "base/messagedigest_unittest.cc",
399 "base/messagequeue_unittest.cc",
400 "base/mod_ops_unittest.cc",
kjellander@webrtc.org3ee56142016-06-03 15:57:02 +0200401 "base/nat_unittest.cc",
402 "base/network_unittest.cc",
403 "base/onetimeevent_unittest.cc",
404 "base/optional_unittest.cc",
405 "base/optionsfile_unittest.cc",
406 "base/pathutils_unittest.cc",
407 "base/platform_thread_unittest.cc",
kjellander@webrtc.org3ee56142016-06-03 15:57:02 +0200408 "base/proxy_unittest.cc",
409 "base/proxydetect_unittest.cc",
410 "base/random_unittest.cc",
sprangcd349d92016-07-13 09:11:28 -0700411 "base/rate_limiter_unittest.cc",
kjellander@webrtc.org3ee56142016-06-03 15:57:02 +0200412 "base/rate_statistics_unittest.cc",
413 "base/ratelimiter_unittest.cc",
414 "base/ratetracker_unittest.cc",
perkj0489e492016-10-20 00:24:01 -0700415 "base/refcountedobject_unittest.cc",
kjellander@webrtc.org3ee56142016-06-03 15:57:02 +0200416 "base/rollingaccumulator_unittest.cc",
417 "base/rtccertificate_unittest.cc",
418 "base/rtccertificategenerator_unittest.cc",
kwiberg8a44e1d2016-11-01 12:04:26 -0700419 "base/safe_compare_unittest.cc",
kjellander@webrtc.org3ee56142016-06-03 15:57:02 +0200420 "base/scopedptrcollection_unittest.cc",
perkj9c16fe82016-07-12 15:04:07 -0700421 "base/sequenced_task_checker_unittest.cc",
kjellander@webrtc.org3ee56142016-06-03 15:57:02 +0200422 "base/sha1digest_unittest.cc",
423 "base/sharedexclusivelock_unittest.cc",
424 "base/signalthread_unittest.cc",
425 "base/sigslot_unittest.cc",
kjellander1d081002016-12-05 06:14:29 -0800426 "base/sigslottester_unittest.cc",
kjellander@webrtc.org3ee56142016-06-03 15:57:02 +0200427 "base/stream_unittest.cc",
428 "base/stringencode_unittest.cc",
429 "base/stringutils_unittest.cc",
430 "base/swap_queue_unittest.cc",
skvladffb865f2016-12-16 16:48:28 -0800431
432 # TODO(ronghuawu): Reenable this test.
433 # "systeminfo_unittest.cc",
kjellander@webrtc.org3ee56142016-06-03 15:57:02 +0200434 "base/task_queue_unittest.cc",
435 "base/task_unittest.cc",
436 "base/testclient_unittest.cc",
danilchap01404082016-10-24 06:07:25 -0700437 "base/thread_annotations_unittest.cc",
kjellander@webrtc.org3ee56142016-06-03 15:57:02 +0200438 "base/thread_checker_unittest.cc",
439 "base/thread_unittest.cc",
nisse191b3592016-06-22 08:36:53 -0700440 "base/timestampaligner_unittest.cc",
kjellander@webrtc.org3ee56142016-06-03 15:57:02 +0200441 "base/timeutils_unittest.cc",
perkj8ff860a2016-10-03 00:30:04 -0700442 "base/weak_ptr_unittest.cc",
kjellander3283cf92016-10-13 06:35:45 -0700443 "p2p/base/asyncstuntcpsocket_unittest.cc",
kjellander@webrtc.org3ee56142016-06-03 15:57:02 +0200444 "p2p/base/dtlstransportchannel_unittest.cc",
445 "p2p/base/fakeportallocator.h",
446 "p2p/base/faketransportcontroller.h",
deadbeef49f34fd2016-12-06 16:22:06 -0800447 "p2p/base/jseptransport_unittest.cc",
kjellander@webrtc.org3ee56142016-06-03 15:57:02 +0200448 "p2p/base/p2ptransportchannel_unittest.cc",
449 "p2p/base/port_unittest.cc",
450 "p2p/base/portallocator_unittest.cc",
451 "p2p/base/pseudotcp_unittest.cc",
452 "p2p/base/relayport_unittest.cc",
453 "p2p/base/relayserver_unittest.cc",
454 "p2p/base/stun_unittest.cc",
455 "p2p/base/stunport_unittest.cc",
456 "p2p/base/stunrequest_unittest.cc",
457 "p2p/base/stunserver_unittest.cc",
458 "p2p/base/tcpport_unittest.cc",
459 "p2p/base/testrelayserver.h",
460 "p2p/base/teststunserver.h",
461 "p2p/base/testturnserver.h",
kjellander@webrtc.org3ee56142016-06-03 15:57:02 +0200462 "p2p/base/transportcontroller_unittest.cc",
463 "p2p/base/transportdescriptionfactory_unittest.cc",
464 "p2p/base/turnport_unittest.cc",
Taylor Brandstetter734262c2016-08-01 16:37:14 -0700465 "p2p/base/turnserver_unittest.cc",
johan6bedebf2016-11-09 13:44:09 -0800466 "p2p/base/udptransportchannel_unittest.cc",
kjellander@webrtc.org3ee56142016-06-03 15:57:02 +0200467 "p2p/client/basicportallocator_unittest.cc",
468 "p2p/stunprober/stunprober_unittest.cc",
469 ]
470
kjellander@webrtc.org3ee56142016-06-03 15:57:02 +0200471 if (is_win) {
472 sources += [
473 "base/win32_unittest.cc",
kjellander@webrtc.org3ee56142016-06-03 15:57:02 +0200474 "base/win32window_unittest.cc",
kjellander@webrtc.org3ee56142016-06-03 15:57:02 +0200475 ]
476 }
477
478 if (is_mac) {
479 sources += [ "base/macutils_unittest.cc" ]
480 }
481
482 if (is_posix) {
483 sources += [
484 "base/ssladapter_unittest.cc",
485 "base/sslidentity_unittest.cc",
486 "base/sslstreamadapter_unittest.cc",
487 ]
488 }
kjellander@webrtc.org3ee56142016-06-03 15:57:02 +0200489 if (rtc_use_quic) {
490 sources += [
491 "p2p/quic/quicconnectionhelper_unittest.cc",
492 "p2p/quic/quicsession_unittest.cc",
493 "p2p/quic/quictransport_unittest.cc",
494 "p2p/quic/quictransportchannel_unittest.cc",
495 "p2p/quic/reliablequicstream_unittest.cc",
496 ]
497 }
498
ehmaldonado7a2ce0b2016-09-05 01:35:44 -0700499 configs += [ ":rtc_unittests_config" ]
kjellander@webrtc.org3ee56142016-06-03 15:57:02 +0200500
kjellandere40a7ee2016-10-16 23:56:12 -0700501 if (!build_with_chromium && is_clang) {
502 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
ehmaldonado38a21322016-09-02 04:10:34 -0700503 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
kjellander@webrtc.org3ee56142016-06-03 15:57:02 +0200504 }
505
506 deps = [
minyue69b627d2016-11-24 11:01:09 -0800507 "base:rtc_analytics",
kjellander@webrtc.org3ee56142016-06-03 15:57:02 +0200508 "base:rtc_base",
kjellander82a94492016-06-12 22:12:01 -0700509 "base:rtc_base_tests_utils",
kjellander@webrtc.org3ee56142016-06-03 15:57:02 +0200510 "base:rtc_task_queue",
511 "p2p:libstunprober",
512 "p2p:rtc_p2p",
513 "//testing/gmock",
514 "//testing/gtest",
515 ]
516
skvlade9cac752016-09-19 14:42:02 -0700517 if (rtc_enable_protobuf) {
skvladcc91d282016-10-03 18:31:22 -0700518 deps += [ "logging:rtc_event_log_tests" ]
skvlade9cac752016-09-19 14:42:02 -0700519 }
520
kjellander@webrtc.org3ee56142016-06-03 15:57:02 +0200521 if (is_android) {
522 deps += [ "//testing/android/native_test:native_test_support" ]
sakal714dd4e2016-08-15 02:29:11 -0700523 shard_timeout = 900
kjellander@webrtc.org3ee56142016-06-03 15:57:02 +0200524 }
kjellander3bcedd32016-06-08 01:14:15 -0700525
kthelgasoncc2d1c62016-11-09 07:44:27 -0800526 if (is_ios || is_mac) {
kjellander3bcedd32016-06-08 01:14:15 -0700527 deps += [
528 "sdk:rtc_sdk_peerconnection_objc",
529 "system_wrappers:system_wrappers_default",
denicija28c24872016-12-06 05:22:49 -0800530 "//third_party/ocmock",
kjellander3bcedd32016-06-08 01:14:15 -0700531 ]
532 sources += [
533 "sdk/objc/Framework/UnitTests/RTCConfigurationTest.mm",
534 "sdk/objc/Framework/UnitTests/RTCDataChannelConfigurationTest.mm",
535 "sdk/objc/Framework/UnitTests/RTCIceCandidateTest.mm",
536 "sdk/objc/Framework/UnitTests/RTCIceServerTest.mm",
537 "sdk/objc/Framework/UnitTests/RTCMediaConstraintsTest.mm",
538 "sdk/objc/Framework/UnitTests/RTCSessionDescriptionTest.mm",
denicija28c24872016-12-06 05:22:49 -0800539 "sdk/objc/Framework/UnitTests/avformatmappertests.mm",
kjellander3bcedd32016-06-08 01:14:15 -0700540 ]
541
542 # TODO(tkchin): Cleanup this warning.
543 cflags = [ "-Wno-objc-property-no-attribute" ]
544
545 # |-ObjC| flag needed to make sure category method implementations
546 # are included:
547 # https://developer.apple.com/library/mac/qa/qa1490/_index.html
548 ldflags = [ "-ObjC" ]
549 }
kjellander@webrtc.org3ee56142016-06-03 15:57:02 +0200550 }
Peter Boström02083222016-06-14 12:52:54 +0200551
552 # TODO(pbos): Rename test suite, this is no longer "just" for video targets.
ehmaldonado3a7f35b2016-09-14 05:10:01 -0700553 video_engine_tests_resources = [
554 "//resources/foreman_cif_short.yuv",
555 "//resources/voice_engine/audio_long16.pcm",
556 ]
kjellander32c4a202016-08-30 02:53:49 -0700557
558 if (is_ios) {
559 bundle_data("video_engine_tests_bundle_data") {
560 testonly = true
561 sources = video_engine_tests_resources
562 outputs = [
563 "{{bundle_resources_dir}}/{{source_file_part}}",
564 ]
565 }
566 }
567
ehmaldonado38a21322016-09-02 04:10:34 -0700568 rtc_test("video_engine_tests") {
Peter Boström02083222016-06-14 12:52:54 +0200569 testonly = true
570 deps = [
571 "audio:audio_tests",
572 "call:call_tests",
573 "modules/video_capture",
574 "test:test_common",
575 "test:test_main",
576 "video:video_tests",
577 ]
ehmaldonado3a7f35b2016-09-14 05:10:01 -0700578 data = video_engine_tests_resources
kjellandere40a7ee2016-10-16 23:56:12 -0700579 if (!build_with_chromium && is_clang) {
580 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
ehmaldonado38a21322016-09-02 04:10:34 -0700581 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
Peter Boström02083222016-06-14 12:52:54 +0200582 }
sakal714dd4e2016-08-15 02:29:11 -0700583 if (is_android) {
sakal010f0922016-08-18 00:41:59 -0700584 deps += [ "//testing/android/native_test:native_test_native_code" ]
kjellander28a0ffd2016-08-24 07:48:42 -0700585 shard_timeout = 900
586 }
kjellander32c4a202016-08-30 02:53:49 -0700587 if (is_ios) {
588 deps += [ ":video_engine_tests_bundle_data" ]
sakal714dd4e2016-08-15 02:29:11 -0700589 }
Peter Boström02083222016-06-14 12:52:54 +0200590 }
Peter Boströmac968bd2016-06-27 19:31:39 +0200591
ehmaldonado3a7f35b2016-09-14 05:10:01 -0700592 webrtc_perf_tests_resources = [
593 "//resources/audio_coding/speech_mono_16kHz.pcm",
henrik.lundin8c1dd8d2016-12-19 06:18:35 -0800594 "//resources/audio_coding/speech_mono_32_48kHz.pcm",
ehmaldonado3a7f35b2016-09-14 05:10:01 -0700595 "//resources/audio_coding/testfile32kHz.pcm",
596 "//resources/ConferenceMotion_1280_720_50.yuv",
597 "//resources/difficult_photo_1850_1110.yuv",
598 "//resources/foreman_cif.yuv",
599 "//resources/google-wifi-3mbps.rx",
600 "//resources/paris_qcif.yuv",
601 "//resources/photo_1850_1110.yuv",
602 "//resources/presentation_1850_1110.yuv",
603 "//resources/verizon4g-downlink.rx",
604 "//resources/voice_engine/audio_long16.pcm",
605 "//resources/web_screenshot_1850_1110.yuv",
606 ]
kjellander32c4a202016-08-30 02:53:49 -0700607
608 if (is_ios) {
609 bundle_data("webrtc_perf_tests_bundle_data") {
610 testonly = true
611 sources = webrtc_perf_tests_resources
612 outputs = [
613 "{{bundle_resources_dir}}/{{source_file_part}}",
614 ]
615 }
616 }
617
ehmaldonado38a21322016-09-02 04:10:34 -0700618 rtc_test("webrtc_perf_tests") {
ehmaldonado529f83c2016-07-27 08:14:32 -0700619 testonly = true
ehmaldonado7a2ce0b2016-09-05 01:35:44 -0700620 configs += [ ":rtc_unittests_config" ]
ehmaldonado25f32e72016-08-31 08:22:09 -0700621
ehmaldonado529f83c2016-07-27 08:14:32 -0700622 sources = [
623 "call/call_perf_tests.cc",
624 "call/rampup_tests.cc",
625 "call/rampup_tests.h",
henrik.lundin875862c2016-11-22 02:07:54 -0800626 "modules/audio_coding/codecs/opus/opus_complexity_unittest.cc",
ehmaldonado529f83c2016-07-27 08:14:32 -0700627 "modules/audio_coding/neteq/test/neteq_performance_unittest.cc",
628 "modules/audio_processing/audio_processing_performance_unittest.cc",
629 "modules/audio_processing/level_controller/level_controller_complexity_unittest.cc",
ivoc3cfb3ef2016-11-24 04:17:28 -0800630 "modules/audio_processing/residual_echo_detector_complexity_unittest.cc",
ehmaldonado529f83c2016-07-27 08:14:32 -0700631 "modules/remote_bitrate_estimator/remote_bitrate_estimators_test.cc",
brandtraa354c92016-12-01 00:20:06 -0800632 "video/full_stack_tests.cc",
ehmaldonado529f83c2016-07-27 08:14:32 -0700633 ]
634 deps = [
ehmaldonado529f83c2016-07-27 08:14:32 -0700635 "modules/audio_coding:neteq_test_support",
636 "modules/audio_processing",
637 "modules/audio_processing:audioproc_test_utils",
terelius3dcfd642016-10-07 00:39:56 -0700638 "modules/remote_bitrate_estimator:bwe_simulator_lib",
ehmaldonado529f83c2016-07-27 08:14:32 -0700639 "modules/rtp_rtcp",
ehmaldonado529f83c2016-07-27 08:14:32 -0700640 "test:test_common",
641 "test:test_main",
642 "test:test_renderer",
kjellandera3cac052016-10-24 01:52:39 -0700643 "video:video_quality_test",
ehmaldonado529f83c2016-07-27 08:14:32 -0700644 "voice_engine",
645 "//testing/gmock",
646 "//testing/gtest",
647 ]
peahd29e3ea2016-09-13 21:42:39 -0700648
649 if (rtc_enable_intelligibility_enhancer) {
650 defines = [ "WEBRTC_INTELLIGIBILITY_ENHANCER=1" ]
651 } else {
652 defines = [ "WEBRTC_INTELLIGIBILITY_ENHANCER=0" ]
653 }
654
ehmaldonado3a7f35b2016-09-14 05:10:01 -0700655 data = webrtc_perf_tests_resources
ehmaldonado529f83c2016-07-27 08:14:32 -0700656 if (is_android) {
657 deps += [ "//testing/android/native_test:native_test_native_code" ]
sakal714dd4e2016-08-15 02:29:11 -0700658 shard_timeout = 2700
ehmaldonado529f83c2016-07-27 08:14:32 -0700659 }
kjellander32c4a202016-08-30 02:53:49 -0700660 if (is_ios) {
661 deps += [ ":webrtc_perf_tests_bundle_data" ]
662 }
kjellandere40a7ee2016-10-16 23:56:12 -0700663 if (!build_with_chromium && is_clang) {
664 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
ehmaldonado38a21322016-09-02 04:10:34 -0700665 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
ehmaldonado529f83c2016-07-27 08:14:32 -0700666 }
brandtrdd369c62016-11-16 23:56:57 -0800667 if (rtc_use_h264) {
668 defines += [ "WEBRTC_USE_H264" ]
669 }
ehmaldonado529f83c2016-07-27 08:14:32 -0700670 }
671
ehmaldonado38a21322016-09-02 04:10:34 -0700672 rtc_test("webrtc_nonparallel_tests") {
Peter Boströmac968bd2016-06-27 19:31:39 +0200673 testonly = true
ehmaldonado7a2ce0b2016-09-05 01:35:44 -0700674 configs += [ ":rtc_unittests_config" ]
Peter Boströmac968bd2016-06-27 19:31:39 +0200675 sources = [
676 "base/nullsocketserver_unittest.cc",
danilchapb7b9dca2016-08-05 05:55:43 -0700677 "base/physicalsocketserver_unittest.cc",
678 "base/socket_unittest.cc",
679 "base/socket_unittest.h",
Peter Boströmac968bd2016-06-27 19:31:39 +0200680 "base/socketaddress_unittest.cc",
681 "base/virtualsocket_unittest.cc",
682 ]
683 deps = [
684 "base:rtc_base",
685 "base:rtc_base_tests_utils",
686 "//testing/gtest",
687 ]
688 if (is_win) {
danilchapb7b9dca2016-08-05 05:55:43 -0700689 sources += [ "base/win32socketserver_unittest.cc" ]
Peter Boströmac968bd2016-06-27 19:31:39 +0200690 }
691 if (is_android) {
692 deps += [ "//testing/android/native_test:native_test_support" ]
sakal714dd4e2016-08-15 02:29:11 -0700693 shard_timeout = 900
Peter Boströmac968bd2016-06-27 19:31:39 +0200694 }
695
kjellandere40a7ee2016-10-16 23:56:12 -0700696 if (!build_with_chromium && is_clang) {
697 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
ehmaldonado38a21322016-09-02 04:10:34 -0700698 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
Peter Boströmac968bd2016-06-27 19:31:39 +0200699 }
700 }
sakal80a5bf12016-09-16 07:22:17 -0700701
702 if (is_android) {
703 junit_binary("android_junit_tests") {
kjellander4bb04982016-09-19 08:53:23 -0700704 java_files = [
705 "androidjunit/src/org/webrtc/CameraEnumerationTest.java",
706 "examples/androidjunit/src/org/appspot/apprtc/DirectRTCClientTest.java",
707 "examples/androidjunit/src/org/appspot/apprtc/TCPChannelClientTest.java",
henrikac3c2f312016-12-14 07:36:56 -0800708 "examples/androidjunit/src/org/appspot/apprtc/BluetoothManagerTest.java",
kjellander4bb04982016-09-19 08:53:23 -0700709 ]
sakal80a5bf12016-09-16 07:22:17 -0700710
711 deps = [
ehmaldonadoeb5040a2016-09-30 00:20:06 -0700712 "//base:base_java_test_support",
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200713 "//webrtc/examples:AppRTCMobile_javalib",
magjed768c6482016-12-06 04:29:37 -0800714 "//webrtc/sdk/android:libjingle_peerconnection_java",
sakal80a5bf12016-09-16 07:22:17 -0700715 ]
716 }
717 }
kjellander@webrtc.org3ee56142016-06-03 15:57:02 +0200718}