blob: 1d14c906f311db4c3c55a643590538d34219190b [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")
sakal80a5bf12016-09-16 14:22:1715if (is_android) {
16 import("//build/config/android/config.gni")
17 import("//build/config/android/rules.gni")
18}
kjellander@webrtc.org851a09e2014-06-17 08:54:0319
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 06:57:2324 cflags = []
25 ldflags = []
kjellander@webrtc.org851a09e2014-06-17 08:54:0326 if (build_with_mozilla) {
27 defines += [ "WEBRTC_MOZILLA_BUILD" ]
28 }
29 if (build_with_chromium) {
kjellanderf0e174a2016-05-30 13:27:5030 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:0341 include_dirs = [
henrikgee2bf412015-09-30 10:48:5242 # The overrides must be included first as that is the mechanism for
kjellander@webrtc.org851a09e2014-06-17 08:54:0343 # selecting the override headers in Chromium.
henrikgee2bf412015-09-30 10:48:5244 "../webrtc_overrides",
Henrik Kjellander57e5fd22015-05-25 10:55:3945
kjellander@webrtc.org851a09e2014-06-17 08:54:0346 # 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 13:27:5067 defines += [
68 "WEBRTC_WIN",
69 "_CRT_SECURE_NO_WARNINGS", # Suppress warnings about _vsnprinf
70 ]
kjellander@webrtc.org851a09e2014-06-17 08:54:0371 }
72 if (is_android) {
73 defines += [
74 "WEBRTC_LINUX",
75 "WEBRTC_ANDROID",
76 ]
kjellander@webrtc.org851a09e2014-06-17 08:54:0377 }
kjellanderf0e174a2016-05-30 13:27:5078 if (is_chromeos) {
79 defines += [ "CHROMEOS" ]
80 }
81
Johan Ahlers9ddac182016-07-22 06:57:2382 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 13:27:5088 # 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:0398}
99
kjellander@webrtc.org6d08ca62014-09-07 17:36:10100if (rtc_have_dbus_glib) {
kjellander@webrtc.org7497fa72014-06-28 18:05:22101 pkg_config("dbus-glib") {
102 packages = [ "dbus-glib-1" ]
103 }
kjellander@webrtc.org851a09e2014-06-17 08:54:03104}
105
106config("common_config") {
kjellander@webrtc.org79ee97c2014-09-04 14:10:49107 cflags = []
108 cflags_cc = []
kjellanderf0e174a2016-05-30 13:27:50109 defines = []
110
kjellander@webrtc.org6d08ca62014-09-07 17:36:10111 if (rtc_restrict_logging) {
kjellanderf0e174a2016-05-30 13:27:50112 defines += [ "WEBRTC_RESTRICT_LOGGING" ]
kjellander@webrtc.org851a09e2014-06-17 08:54:03113 }
114
kjellander82a94492016-06-13 05:12:01115 if (rtc_include_internal_audio_device) {
116 defines += [ "WEBRTC_INCLUDE_INTERNAL_AUDIO_DEVICE" ]
117 }
118
kjellander@webrtc.org6d08ca62014-09-07 17:36:10119 if (rtc_have_dbus_glib) {
kjellander@webrtc.org851a09e2014-06-17 08:54:03120 defines += [ "HAVE_DBUS_GLIB" ]
Henrik Kjellander57e5fd22015-05-25 10:55:39121
kjellander@webrtc.org851a09e2014-06-17 08:54:03122 # 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 10:09:32129 if (rtc_relative_path) {
130 defines += [ "EXPAT_RELATIVE_PATH" ]
131 }
132
phoglund33603522016-10-05 13:52:22133 if (!rtc_libvpx_build_vp9) {
134 defines += [ "RTC_DISABLE_VP9" ]
135 }
136
brettw@chromium.org9fe11012014-09-09 19:15:33137 if (build_with_chromium) {
kjellanderf0e174a2016-05-30 13:27:50138 defines += [
139 # NOTICE: Since common_inherited_config is used in public_configs for our
140 # targets, there's no point including the defines in that config here.
141 # TODO(kjellander): Cleanup unused ones and move defines closer to the
142 # source when webrtc:4256 is completed.
143 "ENABLE_EXTERNAL_AUTH",
144 "HAVE_OPENSSL_SSL_H",
145 "HAVE_SCTP",
146 "HAVE_SRTP",
147 "HAVE_WEBRTC_VIDEO",
148 "HAVE_WEBRTC_VOICE",
149 "LOGGING_INSIDE_WEBRTC",
kjellanderf0e174a2016-05-30 13:27:50150 "SSL_USE_OPENSSL",
151 "USE_WEBRTC_DEV_BRANCH",
152 ]
brettw@chromium.org9fe11012014-09-09 19:15:33153 } else {
kjellander@webrtc.org851a09e2014-06-17 08:54:03154 if (is_posix) {
kjellander496c64c2016-11-03 14:57:35155 # Enable more warnings: -Wextra is currently disabled in Chromium.
156 cflags = [
157 "-Wextra",
Henrik Kjellander57e5fd22015-05-25 10:55:39158
kjellander496c64c2016-11-03 14:57:35159 # Repeat some flags that get overridden by -Wextra.
160 "-Wno-unused-parameter",
161 "-Wno-missing-field-initializers",
162 "-Wno-strict-overflow",
163 ]
164 cflags_cc = [
165 "-Wnon-virtual-dtor",
Henrik Kjellander57e5fd22015-05-25 10:55:39166
kjellander496c64c2016-11-03 14:57:35167 # This is enabled for clang; enable for gcc as well.
168 "-Woverloaded-virtual",
169 ]
kjellander@webrtc.org851a09e2014-06-17 08:54:03170 }
171
172 if (is_clang) {
kjellander3f032cf2016-04-27 14:13:46173 cflags += [
174 "-Wimplicit-fallthrough",
175 "-Wthread-safety",
nisse4996eaa2016-05-11 06:28:10176 "-Winconsistent-missing-override",
kwiberg77eab702016-09-29 00:42:01177 "-Wundef",
kjellander3f032cf2016-04-27 14:13:46178 ]
kjellander@webrtc.org851a09e2014-06-17 08:54:03179 }
180 }
181
kjellander@webrtc.org72273912015-02-23 19:08:31182 if (current_cpu == "arm64") {
Andrew MacDonaldcb7f8ce2015-05-20 05:20:17183 defines += [ "WEBRTC_ARCH_ARM64" ]
184 defines += [ "WEBRTC_HAS_NEON" ]
tkchin@webrtc.org14146e42014-10-31 00:14:39185 }
186
kjellander@webrtc.org72273912015-02-23 19:08:31187 if (current_cpu == "arm") {
kjellander@webrtc.org851a09e2014-06-17 08:54:03188 defines += [ "WEBRTC_ARCH_ARM" ]
andrew@webrtc.orga56a2c52014-11-26 17:01:40189 if (arm_version >= 7) {
kjellander@webrtc.org851a09e2014-06-17 08:54:03190 defines += [ "WEBRTC_ARCH_ARM_V7" ]
191 if (arm_use_neon) {
Andrew MacDonaldcb7f8ce2015-05-20 05:20:17192 defines += [ "WEBRTC_HAS_NEON" ]
kjellander@webrtc.org851a09e2014-06-17 08:54:03193 }
194 }
195 }
196
kjellander@webrtc.org72273912015-02-23 19:08:31197 if (current_cpu == "mipsel") {
kjellander@webrtc.org851a09e2014-06-17 08:54:03198 defines += [ "MIPS32_LE" ]
kjellander@webrtc.org6dab6d72015-03-04 09:50:31199 if (mips_float_abi == "hard") {
kjellander@webrtc.org851a09e2014-06-17 08:54:03200 defines += [ "MIPS_FPU_LE" ]
kjellander@webrtc.org851a09e2014-06-17 08:54:03201 }
kjellander@webrtc.orgacb80852015-01-25 19:17:56202 if (mips_arch_variant == "r2") {
kjellander@webrtc.org851a09e2014-06-17 08:54:03203 defines += [ "MIPS32_R2_LE" ]
kjellander@webrtc.org851a09e2014-06-17 08:54:03204 }
205 if (mips_dsp_rev == 1) {
206 defines += [ "MIPS_DSP_R1_LE" ]
kjellander@webrtc.org851a09e2014-06-17 08:54:03207 } else if (mips_dsp_rev == 2) {
208 defines += [
209 "MIPS_DSP_R1_LE",
210 "MIPS_DSP_R2_LE",
211 ]
kjellander@webrtc.org851a09e2014-06-17 08:54:03212 }
213 }
214
Henrik Kjellanderc0c7d2e2015-09-07 10:57:42215 if (is_android && !is_clang) {
Henrik Kjellander5bfc6cb2015-09-21 14:50:45216 # The Android NDK doesn"t provide optimized versions of these
217 # functions. Ensure they are disabled for all compilers.
kjellander@webrtc.org851a09e2014-06-17 08:54:03218 cflags += [
219 "-fno-builtin-cos",
220 "-fno-builtin-sin",
221 "-fno-builtin-cosf",
222 "-fno-builtin-sinf",
223 ]
224 }
katrielcbf81d682016-05-26 08:03:02225
metzmanf89a5712016-07-25 09:14:09226 if (use_libfuzzer || use_drfuzz || use_afl) {
katrielcbf81d682016-05-26 08:03:02227 # Used in Chromium's overrides to disable logging
228 defines += [ "WEBRTC_UNSAFE_FUZZER_MODE" ]
229 }
kjellander@webrtc.org851a09e2014-06-17 08:54:03230}
231
kjellander3bcedd32016-06-08 08:14:15232config("common_objc") {
tkchin2ddfdba2016-08-08 04:37:45233 libs = [ "Foundation.framework" ]
kjellander3bcedd32016-06-08 08:14:15234 precompiled_header = "sdk/objc/WebRTC-Prefix.pch"
235 precompiled_source = "sdk/objc/WebRTC-Prefix.pch"
236}
237
kjellander6ceab082016-10-28 12:44:03238if (!build_with_chromium) {
239 # Target to build all the WebRTC production code.
kjellanderee996962016-09-27 19:13:13240 rtc_static_library("webrtc") {
kjellander6ceab082016-10-28 12:44:03241 # Only the root target should depend on this.
242 visibility = [ "//:default" ]
243
Nico Weber3ab32dc2016-08-02 13:53:25244 sources = [
kjellanderee996962016-09-27 19:13:13245 # TODO(kjellander): Remove this whenever possible. GN's static_library
246 # target type requires at least one object to avoid errors linking.
247 "build/no_op_function.cc",
Nico Weber3ab32dc2016-08-02 13:53:25248 "call.h",
249 "config.h",
250 "transport.h",
kjellander94cee312016-06-10 08:56:57251 ]
Bjorn Terelius36411852015-07-30 10:45:18252
Nico Weber3ab32dc2016-08-02 13:53:25253 defines = []
Nico Weber3ab32dc2016-08-02 13:53:25254
255 deps = [
256 ":webrtc_common",
kjellander6ceab082016-10-28 12:44:03257 "api",
Nico Weber3ab32dc2016-08-02 13:53:25258 "audio",
kjellander6ceab082016-10-28 12:44:03259 "base",
Nico Weber3ab32dc2016-08-02 13:53:25260 "call",
261 "common_audio",
262 "common_video",
kjellander6ceab082016-10-28 12:44:03263 "libjingle/xmllite",
264 "libjingle/xmpp",
265 "logging",
266 "media",
Nico Weber3ab32dc2016-08-02 13:53:25267 "modules",
kjellander6ceab082016-10-28 12:44:03268 "modules/video_capture:video_capture_internal_impl",
269 "p2p",
270 "pc",
271 "sdk",
hbos615d3012016-08-24 08:33:13272 "stats",
Nico Weber3ab32dc2016-08-02 13:53:25273 "system_wrappers",
Nico Weber3ab32dc2016-08-02 13:53:25274 "video",
275 "voice_engine",
276 ]
277
Nico Weber3ab32dc2016-08-02 13:53:25278 if (rtc_enable_protobuf) {
279 defines += [ "ENABLE_RTC_EVENT_LOG" ]
skvladcc91d282016-10-04 01:31:22280 deps += [ "logging:rtc_event_log_proto" ]
Nico Weber3ab32dc2016-08-02 13:53:25281 }
Bjorn Terelius36411852015-07-30 10:45:18282 }
kjellander6ceab082016-10-28 12:44:03283
284 if (rtc_include_tests) {
285 # Target to build all the WebRTC tests (but not examples or tools).
286 # Executable in order to get a target that links all WebRTC code.
287 rtc_executable("webrtc_tests") {
288 testonly = true
289
290 # Only the root target should depend on this.
291 visibility = [ "//:default" ]
292
293 deps = [
294 ":rtc_unittests",
295 ":video_engine_tests",
296 ":webrtc_nonparallel_tests",
297 ":webrtc_perf_tests",
kjellander6ceab082016-10-28 12:44:03298 "api:peerconnection_unittests",
299 "common_audio:common_audio_unittests",
300 "common_video:common_video_unittests",
kjellandereee9c0e2016-11-08 11:18:38301 "libjingle:xmllite_xmpp_unittests",
kjellander6ceab082016-10-28 12:44:03302 "media:rtc_media_unittests",
303 "modules:modules_tests",
304 "modules:modules_unittests",
305 "modules/audio_coding:audio_coding_tests",
306 "modules/audio_processing:audio_processing_tests",
307 "modules/rtp_rtcp:test_packet_masks_metrics",
308 "modules/video_capture:video_capture_internal_impl",
309 "pc:rtc_pc_unittests",
310 "stats:rtc_stats_unittests",
311 "system_wrappers:system_wrappers_unittests",
312 "test",
313 "video:screenshare_loopback",
314 "video:video_loopback",
315 "video:video_tests",
316 "voice_engine:voe_cmd_test",
317 "voice_engine:voice_engine_unittests",
318 ]
319 if (is_android) {
320 deps += [
321 ":android_junit_tests",
322 "api:libjingle_peerconnection_android_unittest",
323 ]
324 } else {
325 deps += [ "modules/video_capture:video_capture_tests" ]
326 }
327 if (!is_ios) {
328 deps += [
329 "modules/audio_device:audio_device_tests",
330 "voice_engine:voe_auto_test",
331 ]
332 }
333 }
334 }
kjellander@webrtc.org1227ab82014-06-23 19:21:07335}
336
kjellanderb62dbbe2016-09-23 07:38:52337rtc_static_library("webrtc_common") {
kjellander@webrtc.org1227ab82014-06-23 19:21:07338 sources = [
kwiberg@webrtc.orgac2d27d2015-02-26 13:59:22339 "common_types.cc",
kjellander@webrtc.orgd7e34e12015-01-26 19:17:26340 "common_types.h",
kjellander@webrtc.org1227ab82014-06-23 19:21:07341 "config.cc",
Henrik Kjellander57e5fd22015-05-25 10:55:39342 "config.h",
kjellander@webrtc.orgd7e34e12015-01-26 19:17:26343 "typedefs.h",
mflodman7056be92016-10-07 05:07:28344 "voice_engine_configurations.h",
kjellander@webrtc.org851a09e2014-06-17 08:54:03345 ]
kjellander@webrtc.org9bef5512014-07-13 09:02:54346
kjellandere40a7ee2016-10-17 06:56:12347 if (!build_with_chromium && is_clang) {
348 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
ehmaldonado38a21322016-09-02 11:10:34349 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
aluebs688e3082016-01-14 12:32:46350 }
kjellander@webrtc.org851a09e2014-06-17 08:54:03351}
kjellander@webrtc.orgd7e34e12015-01-26 19:17:26352
metzmanf89a5712016-07-25 09:14:09353if (use_libfuzzer || use_drfuzz || use_afl) {
Peter Boström1e0cfd92015-12-17 13:28:16354 # This target is only here for gn to discover fuzzer build targets under
355 # webrtc/test/fuzzers/.
356 group("webrtc_fuzzers_dummy") {
Peter Boström62e9bda2015-11-23 14:12:06357 testonly = true
358 deps = [
Peter Boström1e0cfd92015-12-17 13:28:16359 "test/fuzzers:webrtc_fuzzer_main",
Peter Boström62e9bda2015-11-23 14:12:06360 ]
361 }
362}
kjellander@webrtc.org3ee56142016-06-03 13:57:02363
kjellander@webrtc.orgaff499c92016-06-06 21:04:31364if (rtc_include_tests) {
kjellander@webrtc.org3ee56142016-06-03 13:57:02365 config("rtc_unittests_config") {
366 # GN orders flags on a target before flags from configs. The default config
367 # adds -Wall, and this flag have to be after -Wall -- so they need to
368 # come from a config and can"t be on the target directly.
369 if (is_clang) {
370 cflags = [
371 "-Wno-missing-braces",
372 "-Wno-sign-compare",
373 "-Wno-unused-const-variable",
374 ]
375 }
376 }
377
ehmaldonado38a21322016-09-02 11:10:34378 rtc_test("rtc_unittests") {
kjellander@webrtc.org3ee56142016-06-03 13:57:02379 testonly = true
380 sources = [
Honghai Zhangd93f50c2016-10-05 18:47:22381 "api/fakemetricsobserver.cc",
kjellander@webrtc.org3ee56142016-06-03 13:57:02382 "base/array_view_unittest.cc",
383 "base/atomicops_unittest.cc",
384 "base/autodetectproxy_unittest.cc",
kjellander@webrtc.org3ee56142016-06-03 13:57:02385 "base/base64_unittest.cc",
386 "base/basictypes_unittest.cc",
387 "base/bind_unittest.cc",
388 "base/bitbuffer_unittest.cc",
389 "base/buffer_unittest.cc",
390 "base/bufferqueue_unittest.cc",
391 "base/bytebuffer_unittest.cc",
392 "base/byteorder_unittest.cc",
393 "base/callback_unittest.cc",
394 "base/copyonwritebuffer_unittest.cc",
395 "base/crc32_unittest.cc",
396 "base/criticalsection_unittest.cc",
397 "base/event_tracer_unittest.cc",
398 "base/event_unittest.cc",
399 "base/exp_filter_unittest.cc",
Viktor Palmkvist4ec6a0c2016-09-02 11:38:32400 "base/file_unittest.cc",
kjellander@webrtc.org3ee56142016-06-03 13:57:02401 "base/filerotatingstream_unittest.cc",
402 "base/fileutils_unittest.cc",
kwiberg24c7c122016-09-28 18:57:10403 "base/function_view_unittest.cc",
kjellander@webrtc.org3ee56142016-06-03 13:57:02404 "base/helpers_unittest.cc",
405 "base/httpbase_unittest.cc",
406 "base/httpcommon_unittest.cc",
407 "base/httpserver_unittest.cc",
408 "base/ipaddress_unittest.cc",
409 "base/logging_unittest.cc",
410 "base/md5digest_unittest.cc",
411 "base/messagedigest_unittest.cc",
412 "base/messagequeue_unittest.cc",
413 "base/mod_ops_unittest.cc",
kjellander@webrtc.org3ee56142016-06-03 13:57:02414 "base/nat_unittest.cc",
415 "base/network_unittest.cc",
416 "base/onetimeevent_unittest.cc",
417 "base/optional_unittest.cc",
418 "base/optionsfile_unittest.cc",
419 "base/pathutils_unittest.cc",
420 "base/platform_thread_unittest.cc",
kjellander@webrtc.org3ee56142016-06-03 13:57:02421 "base/proxy_unittest.cc",
422 "base/proxydetect_unittest.cc",
423 "base/random_unittest.cc",
sprangcd349d92016-07-13 16:11:28424 "base/rate_limiter_unittest.cc",
kjellander@webrtc.org3ee56142016-06-03 13:57:02425 "base/rate_statistics_unittest.cc",
426 "base/ratelimiter_unittest.cc",
427 "base/ratetracker_unittest.cc",
perkj0489e492016-10-20 07:24:01428 "base/refcountedobject_unittest.cc",
kjellander@webrtc.org3ee56142016-06-03 13:57:02429 "base/rollingaccumulator_unittest.cc",
430 "base/rtccertificate_unittest.cc",
431 "base/rtccertificategenerator_unittest.cc",
kwiberg8a44e1d2016-11-01 19:04:26432 "base/safe_compare_unittest.cc",
kjellander@webrtc.org3ee56142016-06-03 13:57:02433 "base/scopedptrcollection_unittest.cc",
perkj9c16fe82016-07-12 22:04:07434 "base/sequenced_task_checker_unittest.cc",
kjellander@webrtc.org3ee56142016-06-03 13:57:02435 "base/sha1digest_unittest.cc",
436 "base/sharedexclusivelock_unittest.cc",
437 "base/signalthread_unittest.cc",
438 "base/sigslot_unittest.cc",
439 "base/sigslottester.h",
440 "base/sigslottester.h.pump",
441 "base/stream_unittest.cc",
442 "base/stringencode_unittest.cc",
443 "base/stringutils_unittest.cc",
444 "base/swap_queue_unittest.cc",
445
446 # TODO(ronghuawu): Reenable this test.
447 # "systeminfo_unittest.cc",
448 "base/task_queue_unittest.cc",
449 "base/task_unittest.cc",
450 "base/testclient_unittest.cc",
danilchap01404082016-10-24 13:07:25451 "base/thread_annotations_unittest.cc",
kjellander@webrtc.org3ee56142016-06-03 13:57:02452 "base/thread_checker_unittest.cc",
453 "base/thread_unittest.cc",
nisse191b3592016-06-22 15:36:53454 "base/timestampaligner_unittest.cc",
kjellander@webrtc.org3ee56142016-06-03 13:57:02455 "base/timeutils_unittest.cc",
456 "base/urlencode_unittest.cc",
perkj8ff860a2016-10-03 07:30:04457 "base/weak_ptr_unittest.cc",
kjellander@webrtc.org3ee56142016-06-03 13:57:02458
459 # TODO(ronghuawu): Reenable this test.
460 # "windowpicker_unittest.cc",
kjellander3283cf92016-10-13 13:35:45461 "p2p/base/asyncstuntcpsocket_unittest.cc",
kjellander@webrtc.org3ee56142016-06-03 13:57:02462 "p2p/base/dtlstransportchannel_unittest.cc",
463 "p2p/base/fakeportallocator.h",
464 "p2p/base/faketransportcontroller.h",
465 "p2p/base/p2ptransportchannel_unittest.cc",
466 "p2p/base/port_unittest.cc",
467 "p2p/base/portallocator_unittest.cc",
468 "p2p/base/pseudotcp_unittest.cc",
469 "p2p/base/relayport_unittest.cc",
470 "p2p/base/relayserver_unittest.cc",
471 "p2p/base/stun_unittest.cc",
472 "p2p/base/stunport_unittest.cc",
473 "p2p/base/stunrequest_unittest.cc",
474 "p2p/base/stunserver_unittest.cc",
475 "p2p/base/tcpport_unittest.cc",
476 "p2p/base/testrelayserver.h",
477 "p2p/base/teststunserver.h",
478 "p2p/base/testturnserver.h",
479 "p2p/base/transport_unittest.cc",
480 "p2p/base/transportcontroller_unittest.cc",
481 "p2p/base/transportdescriptionfactory_unittest.cc",
482 "p2p/base/turnport_unittest.cc",
Taylor Brandstetter734262c2016-08-01 23:37:14483 "p2p/base/turnserver_unittest.cc",
johan6bedebf2016-11-09 21:44:09484 "p2p/base/udptransportchannel_unittest.cc",
kjellander@webrtc.org3ee56142016-06-03 13:57:02485 "p2p/client/basicportallocator_unittest.cc",
486 "p2p/stunprober/stunprober_unittest.cc",
487 ]
488
489 if (is_linux) {
490 sources += [
491 "base/latebindingsymboltable_unittest.cc",
492
493 # TODO(ronghuawu): Reenable this test.
494 # "linux_unittest.cc",
495 "base/linuxfdwalk_unittest.cc",
496 ]
497 }
498
499 if (is_win) {
500 sources += [
501 "base/win32_unittest.cc",
502 "base/win32regkey_unittest.cc",
503 "base/win32window_unittest.cc",
504 "base/win32windowpicker_unittest.cc",
kjellander@webrtc.org3ee56142016-06-03 13:57:02505 ]
506 }
507
508 if (is_mac) {
509 sources += [ "base/macutils_unittest.cc" ]
510 }
511
512 if (is_posix) {
513 sources += [
514 "base/ssladapter_unittest.cc",
515 "base/sslidentity_unittest.cc",
516 "base/sslstreamadapter_unittest.cc",
517 ]
518 }
kjellander@webrtc.org3ee56142016-06-03 13:57:02519 if (rtc_use_quic) {
520 sources += [
521 "p2p/quic/quicconnectionhelper_unittest.cc",
522 "p2p/quic/quicsession_unittest.cc",
523 "p2p/quic/quictransport_unittest.cc",
524 "p2p/quic/quictransportchannel_unittest.cc",
525 "p2p/quic/reliablequicstream_unittest.cc",
526 ]
527 }
528
ehmaldonado7a2ce0b2016-09-05 08:35:44529 configs += [ ":rtc_unittests_config" ]
kjellander@webrtc.org3ee56142016-06-03 13:57:02530
kjellandere40a7ee2016-10-17 06:56:12531 if (!build_with_chromium && is_clang) {
532 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
ehmaldonado38a21322016-09-02 11:10:34533 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
kjellander@webrtc.org3ee56142016-06-03 13:57:02534 }
535
536 deps = [
537 "base:rtc_base",
kjellander82a94492016-06-13 05:12:01538 "base:rtc_base_tests_utils",
kjellander@webrtc.org3ee56142016-06-03 13:57:02539 "base:rtc_task_queue",
540 "p2p:libstunprober",
541 "p2p:rtc_p2p",
542 "//testing/gmock",
543 "//testing/gtest",
544 ]
545
skvlade9cac752016-09-19 21:42:02546 if (rtc_enable_protobuf) {
skvladcc91d282016-10-04 01:31:22547 deps += [ "logging:rtc_event_log_tests" ]
skvlade9cac752016-09-19 21:42:02548 }
549
kjellander@webrtc.org3ee56142016-06-03 13:57:02550 if (is_android) {
551 deps += [ "//testing/android/native_test:native_test_support" ]
sakal714dd4e2016-08-15 09:29:11552 shard_timeout = 900
kjellander@webrtc.org3ee56142016-06-03 13:57:02553 }
kjellander3bcedd32016-06-08 08:14:15554
kthelgasoncc2d1c62016-11-09 15:44:27555 if (is_ios || is_mac) {
kjellander3bcedd32016-06-08 08:14:15556 deps += [
557 "sdk:rtc_sdk_peerconnection_objc",
558 "system_wrappers:system_wrappers_default",
559 ]
560 sources += [
561 "sdk/objc/Framework/UnitTests/RTCConfigurationTest.mm",
562 "sdk/objc/Framework/UnitTests/RTCDataChannelConfigurationTest.mm",
563 "sdk/objc/Framework/UnitTests/RTCIceCandidateTest.mm",
564 "sdk/objc/Framework/UnitTests/RTCIceServerTest.mm",
565 "sdk/objc/Framework/UnitTests/RTCMediaConstraintsTest.mm",
566 "sdk/objc/Framework/UnitTests/RTCSessionDescriptionTest.mm",
567 ]
568
569 # TODO(tkchin): Cleanup this warning.
570 cflags = [ "-Wno-objc-property-no-attribute" ]
571
572 # |-ObjC| flag needed to make sure category method implementations
573 # are included:
574 # https://developer.apple.com/library/mac/qa/qa1490/_index.html
575 ldflags = [ "-ObjC" ]
576 }
kjellander@webrtc.org3ee56142016-06-03 13:57:02577 }
Peter Boström02083222016-06-14 10:52:54578
579 # TODO(pbos): Rename test suite, this is no longer "just" for video targets.
ehmaldonado3a7f35b2016-09-14 12:10:01580 video_engine_tests_resources = [
581 "//resources/foreman_cif_short.yuv",
582 "//resources/voice_engine/audio_long16.pcm",
583 ]
kjellander32c4a202016-08-30 09:53:49584
585 if (is_ios) {
586 bundle_data("video_engine_tests_bundle_data") {
587 testonly = true
588 sources = video_engine_tests_resources
589 outputs = [
590 "{{bundle_resources_dir}}/{{source_file_part}}",
591 ]
592 }
593 }
594
ehmaldonado38a21322016-09-02 11:10:34595 rtc_test("video_engine_tests") {
Peter Boström02083222016-06-14 10:52:54596 testonly = true
597 deps = [
598 "audio:audio_tests",
599 "call:call_tests",
600 "modules/video_capture",
601 "test:test_common",
602 "test:test_main",
603 "video:video_tests",
604 ]
ehmaldonado3a7f35b2016-09-14 12:10:01605 data = video_engine_tests_resources
kjellandere40a7ee2016-10-17 06:56:12606 if (!build_with_chromium && is_clang) {
607 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
ehmaldonado38a21322016-09-02 11:10:34608 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
Peter Boström02083222016-06-14 10:52:54609 }
sakal714dd4e2016-08-15 09:29:11610 if (is_android) {
sakal010f0922016-08-18 07:41:59611 deps += [ "//testing/android/native_test:native_test_native_code" ]
kjellander28a0ffd2016-08-24 14:48:42612 shard_timeout = 900
613 }
kjellander32c4a202016-08-30 09:53:49614 if (is_ios) {
615 deps += [ ":video_engine_tests_bundle_data" ]
sakal714dd4e2016-08-15 09:29:11616 }
Peter Boström02083222016-06-14 10:52:54617 }
Peter Boströmac968bd2016-06-27 17:31:39618
ehmaldonado3a7f35b2016-09-14 12:10:01619 webrtc_perf_tests_resources = [
620 "//resources/audio_coding/speech_mono_16kHz.pcm",
621 "//resources/audio_coding/testfile32kHz.pcm",
622 "//resources/ConferenceMotion_1280_720_50.yuv",
623 "//resources/difficult_photo_1850_1110.yuv",
624 "//resources/foreman_cif.yuv",
625 "//resources/google-wifi-3mbps.rx",
626 "//resources/paris_qcif.yuv",
627 "//resources/photo_1850_1110.yuv",
628 "//resources/presentation_1850_1110.yuv",
629 "//resources/verizon4g-downlink.rx",
630 "//resources/voice_engine/audio_long16.pcm",
631 "//resources/web_screenshot_1850_1110.yuv",
632 ]
kjellander32c4a202016-08-30 09:53:49633
634 if (is_ios) {
635 bundle_data("webrtc_perf_tests_bundle_data") {
636 testonly = true
637 sources = webrtc_perf_tests_resources
638 outputs = [
639 "{{bundle_resources_dir}}/{{source_file_part}}",
640 ]
641 }
642 }
643
ehmaldonado38a21322016-09-02 11:10:34644 rtc_test("webrtc_perf_tests") {
ehmaldonado529f83c2016-07-27 15:14:32645 testonly = true
ehmaldonado7a2ce0b2016-09-05 08:35:44646 configs += [ ":rtc_unittests_config" ]
ehmaldonado25f32e72016-08-31 15:22:09647
ehmaldonado529f83c2016-07-27 15:14:32648 sources = [
649 "call/call_perf_tests.cc",
650 "call/rampup_tests.cc",
651 "call/rampup_tests.h",
652 "modules/audio_coding/neteq/test/neteq_performance_unittest.cc",
653 "modules/audio_processing/audio_processing_performance_unittest.cc",
654 "modules/audio_processing/level_controller/level_controller_complexity_unittest.cc",
655 "modules/remote_bitrate_estimator/remote_bitrate_estimators_test.cc",
656 "video/full_stack.cc",
657 ]
658 deps = [
ehmaldonado529f83c2016-07-27 15:14:32659 "modules/audio_coding:neteq_test_support",
660 "modules/audio_processing",
661 "modules/audio_processing:audioproc_test_utils",
terelius3dcfd642016-10-07 07:39:56662 "modules/remote_bitrate_estimator:bwe_simulator_lib",
ehmaldonado529f83c2016-07-27 15:14:32663 "modules/rtp_rtcp",
ehmaldonado529f83c2016-07-27 15:14:32664 "test:test_common",
665 "test:test_main",
666 "test:test_renderer",
kjellandera3cac052016-10-24 08:52:39667 "video:video_quality_test",
ehmaldonado529f83c2016-07-27 15:14:32668 "voice_engine",
669 "//testing/gmock",
670 "//testing/gtest",
671 ]
peahd29e3ea2016-09-14 04:42:39672
673 if (rtc_enable_intelligibility_enhancer) {
674 defines = [ "WEBRTC_INTELLIGIBILITY_ENHANCER=1" ]
675 } else {
676 defines = [ "WEBRTC_INTELLIGIBILITY_ENHANCER=0" ]
677 }
678
ehmaldonado3a7f35b2016-09-14 12:10:01679 data = webrtc_perf_tests_resources
ehmaldonado529f83c2016-07-27 15:14:32680 if (is_android) {
681 deps += [ "//testing/android/native_test:native_test_native_code" ]
sakal714dd4e2016-08-15 09:29:11682 shard_timeout = 2700
ehmaldonado529f83c2016-07-27 15:14:32683 }
kjellander32c4a202016-08-30 09:53:49684 if (is_ios) {
685 deps += [ ":webrtc_perf_tests_bundle_data" ]
686 }
kjellandere40a7ee2016-10-17 06:56:12687 if (!build_with_chromium && is_clang) {
688 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
ehmaldonado38a21322016-09-02 11:10:34689 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
ehmaldonado529f83c2016-07-27 15:14:32690 }
brandtrdd369c62016-11-17 07:56:57691 if (rtc_use_h264) {
692 defines += [ "WEBRTC_USE_H264" ]
693 }
ehmaldonado529f83c2016-07-27 15:14:32694 }
695
ehmaldonado38a21322016-09-02 11:10:34696 rtc_test("webrtc_nonparallel_tests") {
Peter Boströmac968bd2016-06-27 17:31:39697 testonly = true
ehmaldonado7a2ce0b2016-09-05 08:35:44698 configs += [ ":rtc_unittests_config" ]
Peter Boströmac968bd2016-06-27 17:31:39699 sources = [
700 "base/nullsocketserver_unittest.cc",
danilchapb7b9dca2016-08-05 12:55:43701 "base/physicalsocketserver_unittest.cc",
702 "base/socket_unittest.cc",
703 "base/socket_unittest.h",
Peter Boströmac968bd2016-06-27 17:31:39704 "base/socketaddress_unittest.cc",
705 "base/virtualsocket_unittest.cc",
706 ]
707 deps = [
708 "base:rtc_base",
709 "base:rtc_base_tests_utils",
710 "//testing/gtest",
711 ]
712 if (is_win) {
danilchapb7b9dca2016-08-05 12:55:43713 sources += [ "base/win32socketserver_unittest.cc" ]
Peter Boströmac968bd2016-06-27 17:31:39714 }
715 if (is_android) {
716 deps += [ "//testing/android/native_test:native_test_support" ]
sakal714dd4e2016-08-15 09:29:11717 shard_timeout = 900
Peter Boströmac968bd2016-06-27 17:31:39718 }
719
kjellandere40a7ee2016-10-17 06:56:12720 if (!build_with_chromium && is_clang) {
721 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
ehmaldonado38a21322016-09-02 11:10:34722 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
Peter Boströmac968bd2016-06-27 17:31:39723 }
724 }
sakal80a5bf12016-09-16 14:22:17725
726 if (is_android) {
727 junit_binary("android_junit_tests") {
kjellander4bb04982016-09-19 15:53:23728 java_files = [
729 "androidjunit/src/org/webrtc/CameraEnumerationTest.java",
730 "examples/androidjunit/src/org/appspot/apprtc/DirectRTCClientTest.java",
731 "examples/androidjunit/src/org/appspot/apprtc/TCPChannelClientTest.java",
732 ]
sakal80a5bf12016-09-16 14:22:17733
734 deps = [
ehmaldonadoeb5040a2016-09-30 07:20:06735 "//base:base_java_test_support",
sakal80a5bf12016-09-16 14:22:17736 "//webrtc/api:libjingle_peerconnection_java",
737 "//webrtc/api:libjingle_peerconnection_jni",
Magnus Jedvertc1815cf2016-09-27 08:10:41738 "//webrtc/examples:AppRTCMobile_javalib",
sakal80a5bf12016-09-16 14:22:17739 ]
740 }
741 }
kjellander@webrtc.org3ee56142016-06-03 13:57:02742}