blob: 2857cb29aed084c07c6813feefbde0e8ca4fe870 [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 = []
21 if (build_with_mozilla) {
22 defines += [ "WEBRTC_MOZILLA_BUILD" ]
23 }
24 if (build_with_chromium) {
kjellanderf0e174a2016-05-30 06:27:50 -070025 defines = [
26 # TODO(kjellander): Cleanup unused ones and move defines closer to
27 # the source when webrtc:4256 is completed.
28 "FEATURE_ENABLE_SSL",
29 "FEATURE_ENABLE_VOICEMAIL",
30 "EXPAT_RELATIVE_PATH",
31 "GTEST_RELATIVE_PATH",
32 "NO_MAIN_THREAD_WRAPPING",
33 "NO_SOUND_SYSTEM",
34 "WEBRTC_CHROMIUM_BUILD",
35 ]
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +000036 include_dirs = [
henrikgee2bf412015-09-30 03:48:52 -070037 # The overrides must be included first as that is the mechanism for
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +000038 # selecting the override headers in Chromium.
henrikgee2bf412015-09-30 03:48:52 -070039 "../webrtc_overrides",
Henrik Kjellander57e5fd22015-05-25 12:55:39 +020040
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +000041 # Allow includes to be prefixed with webrtc/ in case it is not an
42 # immediate subdirectory of the top-level.
43 "..",
44 ]
45 }
46 if (is_posix) {
47 defines += [ "WEBRTC_POSIX" ]
48 }
49 if (is_ios) {
50 defines += [
51 "WEBRTC_MAC",
52 "WEBRTC_IOS",
53 ]
54 }
Zeke Chin71f6f442015-06-29 14:34:58 -070055 if (is_ios && rtc_use_objc_h264) {
56 defines += [ "WEBRTC_OBJC_H264" ]
57 }
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +000058 if (is_linux) {
59 defines += [ "WEBRTC_LINUX" ]
60 }
61 if (is_mac) {
62 defines += [ "WEBRTC_MAC" ]
63 }
64 if (is_win) {
kjellanderf0e174a2016-05-30 06:27:50 -070065 defines += [
66 "WEBRTC_WIN",
67 "_CRT_SECURE_NO_WARNINGS", # Suppress warnings about _vsnprinf
68 ]
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +000069 }
70 if (is_android) {
71 defines += [
72 "WEBRTC_LINUX",
73 "WEBRTC_ANDROID",
74 ]
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +000075 }
kjellanderf0e174a2016-05-30 06:27:50 -070076 if (is_chromeos) {
77 defines += [ "CHROMEOS" ]
78 }
79
80 # TODO(GYP): Support these in GN.
81 # if (is_bsd) {
82 # defines += [ "BSD" ]
83 # }
84 # if (is_openbsd) {
85 # defines += [ "OPENBSD" ]
86 # }
87 # if (is_freebsd) {
88 # defines += [ "FREEBSD" ]
89 # }
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +000090}
91
kjellander@webrtc.org6d08ca62014-09-07 17:36:10 +000092if (rtc_have_dbus_glib) {
kjellander@webrtc.org7497fa72014-06-28 18:05:22 +000093 pkg_config("dbus-glib") {
94 packages = [ "dbus-glib-1" ]
95 }
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +000096}
97
98config("common_config") {
kjellander@webrtc.org79ee97c2014-09-04 14:10:49 +000099 cflags = []
100 cflags_cc = []
kjellanderf0e174a2016-05-30 06:27:50 -0700101 defines = []
102
kjellander@webrtc.org6d08ca62014-09-07 17:36:10 +0000103 if (rtc_restrict_logging) {
kjellanderf0e174a2016-05-30 06:27:50 -0700104 defines += [ "WEBRTC_RESTRICT_LOGGING" ]
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000105 }
106
kjellander82a94492016-06-12 22:12:01 -0700107 if (rtc_include_internal_audio_device) {
108 defines += [ "WEBRTC_INCLUDE_INTERNAL_AUDIO_DEVICE" ]
109 }
110
kjellander@webrtc.org6d08ca62014-09-07 17:36:10 +0000111 if (rtc_have_dbus_glib) {
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000112 defines += [ "HAVE_DBUS_GLIB" ]
Henrik Kjellander57e5fd22015-05-25 12:55:39 +0200113
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000114 # TODO(kjellander): Investigate this, it seems like include <dbus/dbus.h>
115 # is still not found even if the execution of
116 # build/config/linux/pkg-config.py dbus-glib-1 returns correct include
117 # dirs on Linux.
118 all_dependent_configs = [ "dbus-glib" ]
119 }
120
kjellanderc76dc952016-06-03 03:09:32 -0700121 if (rtc_relative_path) {
122 defines += [ "EXPAT_RELATIVE_PATH" ]
123 }
124
brettw@chromium.org9fe11012014-09-09 19:15:33 +0000125 if (build_with_chromium) {
kjellanderf0e174a2016-05-30 06:27:50 -0700126 defines += [
127 # NOTICE: Since common_inherited_config is used in public_configs for our
128 # targets, there's no point including the defines in that config here.
129 # TODO(kjellander): Cleanup unused ones and move defines closer to the
130 # source when webrtc:4256 is completed.
131 "ENABLE_EXTERNAL_AUTH",
132 "HAVE_OPENSSL_SSL_H",
133 "HAVE_SCTP",
134 "HAVE_SRTP",
135 "HAVE_WEBRTC_VIDEO",
136 "HAVE_WEBRTC_VOICE",
137 "LOGGING_INSIDE_WEBRTC",
138 "SRTP_RELATIVE_PATH",
139 "SSL_USE_OPENSSL",
140 "USE_WEBRTC_DEV_BRANCH",
141 ]
brettw@chromium.org9fe11012014-09-09 19:15:33 +0000142 } else {
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000143 if (is_posix) {
144 # -Wextra is currently disabled in Chromium"s common.gypi. Enable
145 # for targets that can handle it. For Android/arm64 right now
146 # there will be an "enumeral and non-enumeral type in conditional
147 # expression" warning in android_tools/ndk_experimental"s version
148 # of stlport.
149 # See: https://code.google.com/p/chromium/issues/detail?id=379699
kjellander@webrtc.org72273912015-02-23 19:08:31 +0000150 if (current_cpu != "arm64" || !is_android) {
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000151 cflags = [
152 "-Wextra",
Henrik Kjellander57e5fd22015-05-25 12:55:39 +0200153
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000154 # We need to repeat some flags from Chromium"s common.gypi
155 # here that get overridden by -Wextra.
156 "-Wno-unused-parameter",
157 "-Wno-missing-field-initializers",
158 "-Wno-strict-overflow",
159 ]
160 cflags_cc = [
161 "-Wnon-virtual-dtor",
Henrik Kjellander57e5fd22015-05-25 12:55:39 +0200162
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000163 # This is enabled for clang; enable for gcc as well.
164 "-Woverloaded-virtual",
165 ]
166 }
167 }
168
169 if (is_clang) {
kjellander3f032cf2016-04-27 07:13:46 -0700170 cflags += [
171 "-Wimplicit-fallthrough",
172 "-Wthread-safety",
nisse4996eaa2016-05-10 23:28:10 -0700173 "-Winconsistent-missing-override",
kjellander3f032cf2016-04-27 07:13:46 -0700174 ]
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000175 }
176 }
177
phoglundff274392016-05-17 03:44:28 -0700178 if (rtc_enable_libevent) {
179 defines += [ "WEBRTC_BUILD_LIBEVENT" ]
180 }
181
kjellander@webrtc.org72273912015-02-23 19:08:31 +0000182 if (current_cpu == "arm64") {
Andrew MacDonaldcb7f8ce2015-05-19 22:20:17 -0700183 defines += [ "WEBRTC_ARCH_ARM64" ]
184 defines += [ "WEBRTC_HAS_NEON" ]
tkchin@webrtc.org14146e42014-10-31 00:14:39 +0000185 }
186
kjellander@webrtc.org72273912015-02-23 19:08:31 +0000187 if (current_cpu == "arm") {
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000188 defines += [ "WEBRTC_ARCH_ARM" ]
andrew@webrtc.orga56a2c52014-11-26 17:01:40 +0000189 if (arm_version >= 7) {
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000190 defines += [ "WEBRTC_ARCH_ARM_V7" ]
191 if (arm_use_neon) {
Andrew MacDonaldcb7f8ce2015-05-19 22:20:17 -0700192 defines += [ "WEBRTC_HAS_NEON" ]
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000193 }
194 }
195 }
196
kjellander@webrtc.org72273912015-02-23 19:08:31 +0000197 if (current_cpu == "mipsel") {
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000198 defines += [ "MIPS32_LE" ]
kjellander@webrtc.org6dab6d72015-03-04 09:50:31 +0000199 if (mips_float_abi == "hard") {
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000200 defines += [ "MIPS_FPU_LE" ]
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000201 }
kjellander@webrtc.orgacb80852015-01-25 19:17:56 +0000202 if (mips_arch_variant == "r2") {
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000203 defines += [ "MIPS32_R2_LE" ]
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000204 }
205 if (mips_dsp_rev == 1) {
206 defines += [ "MIPS_DSP_R1_LE" ]
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000207 } 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:03 +0000212 }
213 }
214
Henrik Kjellanderc0c7d2e2015-09-07 12:57:42 +0200215 if (is_android && !is_clang) {
Henrik Kjellander5bfc6cb2015-09-21 16:50:45 +0200216 # 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:03 +0000218 cflags += [
219 "-fno-builtin-cos",
220 "-fno-builtin-sin",
221 "-fno-builtin-cosf",
222 "-fno-builtin-sinf",
223 ]
224 }
katrielcbf81d682016-05-26 01:03:02 -0700225
226 if (use_libfuzzer || use_drfuzz) {
227 # Used in Chromium's overrides to disable logging
228 defines += [ "WEBRTC_UNSAFE_FUZZER_MODE" ]
229 }
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000230}
231
kjellander3bcedd32016-06-08 01:14:15 -0700232config("common_objc") {
233 cflags = [ "-Wobjc-missing-property-synthesis" ]
234
235 precompiled_header = "sdk/objc/WebRTC-Prefix.pch"
236 precompiled_source = "sdk/objc/WebRTC-Prefix.pch"
237}
238
kjellander@webrtc.org14ea50a2014-11-12 07:56:21 +0000239source_set("webrtc") {
kjellander@webrtc.org1227ab82014-06-23 19:21:07 +0000240 sources = [
241 "call.h",
kjellander84f8df72016-05-18 05:00:50 -0700242 "config.h",
kjellander7324eb92016-02-25 08:36:42 -0800243 "transport.h",
kjellander@webrtc.org1227ab82014-06-23 19:21:07 +0000244 ]
245
Bjorn Terelius36411852015-07-30 12:45:18 +0200246 defines = []
kjellander@webrtc.orgf21ea912014-09-28 17:37:22 +0000247 configs += [ ":common_config" ]
Henrik Kjellander57e5fd22015-05-25 12:55:39 +0200248 public_configs = [ ":common_inherited_config" ]
kjellander@webrtc.org9bef5512014-07-13 09:02:54 +0000249
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000250 deps = [
Henrik Kjellanderc4ef1432015-10-26 17:39:11 +0100251 ":webrtc_common",
Peter Boström62e9bda2015-11-23 15:12:06 +0100252 "audio",
kjellander@webrtc.orgc429b822015-01-21 20:22:33 +0000253 "base:rtc_base",
Peter Boström5c389d32015-09-25 13:58:30 +0200254 "call",
kjellander@webrtc.org1227ab82014-06-23 19:21:07 +0000255 "common_audio",
256 "common_video",
kjellanderfb114242016-06-13 00:19:48 -0700257 "modules",
kjellander@webrtc.org78f440c2014-06-21 14:25:16 +0000258 "system_wrappers",
kjellander@webrtc.orgb8caf6a2014-09-30 18:05:02 +0000259 "tools",
kjellander@webrtc.org1227ab82014-06-23 19:21:07 +0000260 "video",
kjellander@webrtc.org1227ab82014-06-23 19:21:07 +0000261 "voice_engine",
262 ]
kjellander@webrtc.orgf58fe0a2015-02-11 07:47:00 +0000263
264 if (build_with_chromium) {
nisseb99395a2016-04-29 00:58:42 -0700265 deps += [ "modules/video_capture" ]
kjellander94cee312016-06-10 01:56:57 -0700266 } else {
267 # TODO(kjellander): Enable for Chromium as well when bugs.webrtc.org/4256 is
268 # fixed. Right now it's not possible due to circular dependencies.
269 deps += [
270 "api",
271 "media",
272 "p2p",
273 "pc",
274 ]
kjellander@webrtc.orgf58fe0a2015-02-11 07:47:00 +0000275 }
Bjorn Terelius36411852015-07-30 12:45:18 +0200276
277 if (rtc_enable_protobuf) {
278 defines += [ "ENABLE_RTC_EVENT_LOG" ]
279 deps += [ ":rtc_event_log_proto" ]
280 }
kjellander@webrtc.org1227ab82014-06-23 19:21:07 +0000281}
282
kjellander@webrtc.orgb8caf6a2014-09-30 18:05:02 +0000283if (!build_with_chromium) {
284 executable("webrtc_tests") {
285 testonly = true
286 deps = [
287 ":webrtc",
kjellander@webrtc.orgb8caf6a2014-09-30 18:05:02 +0000288 "modules/video_capture:video_capture_internal_impl",
289 "test",
290 ]
291 }
292}
293
kjellander@webrtc.org1227ab82014-06-23 19:21:07 +0000294source_set("webrtc_common") {
295 sources = [
kjellander@webrtc.org50772f12016-02-29 06:49:43 +0100296 "audio_sink.h",
kwiberg@webrtc.orgac2d27d2015-02-26 13:59:22 +0000297 "common_types.cc",
kjellander@webrtc.orgd7e34e12015-01-26 19:17:26 +0000298 "common_types.h",
kjellander@webrtc.org1227ab82014-06-23 19:21:07 +0000299 "config.cc",
Henrik Kjellander57e5fd22015-05-25 12:55:39 +0200300 "config.h",
kjellander@webrtc.orgd7e34e12015-01-26 19:17:26 +0000301 "engine_configurations.h",
302 "typedefs.h",
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000303 ]
kjellander@webrtc.org9bef5512014-07-13 09:02:54 +0000304
kjellander@webrtc.orgf21ea912014-09-28 17:37:22 +0000305 configs += [ ":common_config" ]
306 public_configs = [ ":common_inherited_config" ]
aluebs688e3082016-01-14 04:32:46 -0800307
308 if (is_clang && !is_nacl) {
309 # Suppress warnings from Chrome's Clang plugins.
310 # See http://code.google.com/p/webrtc/issues/detail?id=163 for details.
311 configs -= [ "//build/config/clang:find_bad_constructs" ]
312 }
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000313}
kjellander@webrtc.orgd7e34e12015-01-26 19:17:26 +0000314
Bjorn Terelius36411852015-07-30 12:45:18 +0200315if (rtc_enable_protobuf) {
316 proto_library("rtc_event_log_proto") {
317 sources = [
Peter Boström5c389d32015-09-25 13:58:30 +0200318 "call/rtc_event_log.proto",
Bjorn Terelius36411852015-07-30 12:45:18 +0200319 ]
Peter Boström5c389d32015-09-25 13:58:30 +0200320 proto_out_dir = "webrtc/call"
Bjorn Terelius36411852015-07-30 12:45:18 +0200321 }
322}
323
324source_set("rtc_event_log") {
325 sources = [
Peter Boström5c389d32015-09-25 13:58:30 +0200326 "call/rtc_event_log.cc",
327 "call/rtc_event_log.h",
terelius4311ba52016-04-22 12:40:37 -0700328 "call/rtc_event_log_helper_thread.cc",
329 "call/rtc_event_log_helper_thread.h",
Bjorn Terelius36411852015-07-30 12:45:18 +0200330 ]
331
332 defines = []
333 configs += [ ":common_config" ]
334 public_configs = [ ":common_inherited_config" ]
335
336 deps = [
337 ":webrtc_common",
338 ]
339
340 if (rtc_enable_protobuf) {
341 defines += [ "ENABLE_RTC_EVENT_LOG" ]
342 deps += [ ":rtc_event_log_proto" ]
343 }
sergeyu4df08ff2015-09-02 14:22:40 -0700344 if (is_clang && !is_nacl) {
Bjorn Terelius36411852015-07-30 12:45:18 +0200345 # Suppress warnings from Chrome's Clang plugins.
346 # See http://code.google.com/p/webrtc/issues/detail?id=163 for details.
347 configs -= [ "//build/config/clang:find_bad_constructs" ]
348 }
349}
Peter Boström62e9bda2015-11-23 15:12:06 +0100350
tereliusd5c1a0b2016-05-13 00:42:59 -0700351if (rtc_enable_protobuf) {
352 source_set("rtc_event_log_parser") {
353 sources = [
354 "call/rtc_event_log_parser.cc",
355 "call/rtc_event_log_parser.h",
356 ]
357
358 configs += [ ":common_config" ]
359 public_configs = [ ":common_inherited_config" ]
360
361 deps = [
362 ":rtc_event_log_proto",
363 ":webrtc_common",
364 ]
365
366 if (is_clang && !is_nacl) {
367 # Suppress warnings from Chrome's Clang plugins.
368 # See http://code.google.com/p/webrtc/issues/detail?id=163 for details.
369 configs -= [ "//build/config/clang:find_bad_constructs" ]
370 }
371 }
372}
373
pbos3514cbe2015-12-16 18:36:14 -0800374if (use_libfuzzer || use_drfuzz) {
Peter Boström1e0cfd92015-12-17 14:28:16 +0100375 # This target is only here for gn to discover fuzzer build targets under
376 # webrtc/test/fuzzers/.
377 group("webrtc_fuzzers_dummy") {
Peter Boström62e9bda2015-11-23 15:12:06 +0100378 testonly = true
379 deps = [
Peter Boström1e0cfd92015-12-17 14:28:16 +0100380 "test/fuzzers:webrtc_fuzzer_main",
Peter Boström62e9bda2015-11-23 15:12:06 +0100381 ]
382 }
383}
kjellander@webrtc.org3ee56142016-06-03 15:57:02 +0200384
kjellander@webrtc.orgaff499c2016-06-06 23:04:31 +0200385if (rtc_include_tests) {
kjellander@webrtc.org3ee56142016-06-03 15:57:02 +0200386 config("rtc_unittests_config") {
387 # GN orders flags on a target before flags from configs. The default config
388 # adds -Wall, and this flag have to be after -Wall -- so they need to
389 # come from a config and can"t be on the target directly.
390 if (is_clang) {
391 cflags = [
392 "-Wno-missing-braces",
393 "-Wno-sign-compare",
394 "-Wno-unused-const-variable",
395 ]
396 }
397 }
398
399 test("rtc_unittests") {
400 testonly = true
401 sources = [
402 "base/array_view_unittest.cc",
403 "base/atomicops_unittest.cc",
404 "base/autodetectproxy_unittest.cc",
405 "base/bandwidthsmoother_unittest.cc",
406 "base/base64_unittest.cc",
407 "base/basictypes_unittest.cc",
408 "base/bind_unittest.cc",
409 "base/bitbuffer_unittest.cc",
410 "base/buffer_unittest.cc",
411 "base/bufferqueue_unittest.cc",
412 "base/bytebuffer_unittest.cc",
413 "base/byteorder_unittest.cc",
414 "base/callback_unittest.cc",
415 "base/copyonwritebuffer_unittest.cc",
416 "base/crc32_unittest.cc",
417 "base/criticalsection_unittest.cc",
418 "base/event_tracer_unittest.cc",
419 "base/event_unittest.cc",
420 "base/exp_filter_unittest.cc",
kjellander@webrtc.org3ee56142016-06-03 15:57:02 +0200421 "base/filerotatingstream_unittest.cc",
422 "base/fileutils_unittest.cc",
423 "base/helpers_unittest.cc",
424 "base/httpbase_unittest.cc",
425 "base/httpcommon_unittest.cc",
426 "base/httpserver_unittest.cc",
427 "base/ipaddress_unittest.cc",
428 "base/logging_unittest.cc",
429 "base/md5digest_unittest.cc",
430 "base/messagedigest_unittest.cc",
431 "base/messagequeue_unittest.cc",
432 "base/mod_ops_unittest.cc",
433 "base/multipart_unittest.cc",
434 "base/nat_unittest.cc",
435 "base/network_unittest.cc",
436 "base/onetimeevent_unittest.cc",
437 "base/optional_unittest.cc",
438 "base/optionsfile_unittest.cc",
439 "base/pathutils_unittest.cc",
440 "base/platform_thread_unittest.cc",
441 "base/profiler_unittest.cc",
442 "base/proxy_unittest.cc",
443 "base/proxydetect_unittest.cc",
444 "base/random_unittest.cc",
445 "base/rate_statistics_unittest.cc",
446 "base/ratelimiter_unittest.cc",
447 "base/ratetracker_unittest.cc",
448 "base/referencecountedsingletonfactory_unittest.cc",
449 "base/rollingaccumulator_unittest.cc",
450 "base/rtccertificate_unittest.cc",
451 "base/rtccertificategenerator_unittest.cc",
452 "base/scopedptrcollection_unittest.cc",
453 "base/sha1digest_unittest.cc",
454 "base/sharedexclusivelock_unittest.cc",
455 "base/signalthread_unittest.cc",
456 "base/sigslot_unittest.cc",
457 "base/sigslottester.h",
458 "base/sigslottester.h.pump",
459 "base/stream_unittest.cc",
460 "base/stringencode_unittest.cc",
461 "base/stringutils_unittest.cc",
462 "base/swap_queue_unittest.cc",
463
464 # TODO(ronghuawu): Reenable this test.
465 # "systeminfo_unittest.cc",
466 "base/task_queue_unittest.cc",
467 "base/task_unittest.cc",
468 "base/testclient_unittest.cc",
469 "base/thread_checker_unittest.cc",
470 "base/thread_unittest.cc",
nisse191b3592016-06-22 08:36:53 -0700471 "base/timestampaligner_unittest.cc",
kjellander@webrtc.org3ee56142016-06-03 15:57:02 +0200472 "base/timeutils_unittest.cc",
473 "base/urlencode_unittest.cc",
474 "base/versionparsing_unittest.cc",
475
476 # TODO(ronghuawu): Reenable this test.
477 # "windowpicker_unittest.cc",
478 "p2p/base/dtlstransportchannel_unittest.cc",
479 "p2p/base/fakeportallocator.h",
480 "p2p/base/faketransportcontroller.h",
481 "p2p/base/p2ptransportchannel_unittest.cc",
482 "p2p/base/port_unittest.cc",
483 "p2p/base/portallocator_unittest.cc",
484 "p2p/base/pseudotcp_unittest.cc",
485 "p2p/base/relayport_unittest.cc",
486 "p2p/base/relayserver_unittest.cc",
487 "p2p/base/stun_unittest.cc",
488 "p2p/base/stunport_unittest.cc",
489 "p2p/base/stunrequest_unittest.cc",
490 "p2p/base/stunserver_unittest.cc",
491 "p2p/base/tcpport_unittest.cc",
492 "p2p/base/testrelayserver.h",
493 "p2p/base/teststunserver.h",
494 "p2p/base/testturnserver.h",
495 "p2p/base/transport_unittest.cc",
496 "p2p/base/transportcontroller_unittest.cc",
497 "p2p/base/transportdescriptionfactory_unittest.cc",
498 "p2p/base/turnport_unittest.cc",
499 "p2p/client/basicportallocator_unittest.cc",
500 "p2p/stunprober/stunprober_unittest.cc",
501 ]
502
503 if (is_linux) {
504 sources += [
505 "base/latebindingsymboltable_unittest.cc",
506
507 # TODO(ronghuawu): Reenable this test.
508 # "linux_unittest.cc",
509 "base/linuxfdwalk_unittest.cc",
510 ]
511 }
512
513 if (is_win) {
514 sources += [
515 "base/win32_unittest.cc",
516 "base/win32regkey_unittest.cc",
517 "base/win32window_unittest.cc",
518 "base/win32windowpicker_unittest.cc",
519 "base/winfirewall_unittest.cc",
520 ]
521 }
522
523 if (is_mac) {
524 sources += [ "base/macutils_unittest.cc" ]
525 }
526
527 if (is_posix) {
528 sources += [
529 "base/ssladapter_unittest.cc",
530 "base/sslidentity_unittest.cc",
531 "base/sslstreamadapter_unittest.cc",
532 ]
533 }
534 if (is_ios || (is_mac && target_cpu != "x86")) {
535 defines = [ "CARBON_DEPRECATED=YES" ]
536 }
537
538 if (rtc_use_quic) {
539 sources += [
540 "p2p/quic/quicconnectionhelper_unittest.cc",
541 "p2p/quic/quicsession_unittest.cc",
542 "p2p/quic/quictransport_unittest.cc",
543 "p2p/quic/quictransportchannel_unittest.cc",
544 "p2p/quic/reliablequicstream_unittest.cc",
545 ]
546 }
547
548 configs += [
549 ":common_config",
550 ":rtc_unittests_config",
551 ]
552 public_configs = [ ":common_inherited_config" ]
553
554 if (is_clang) {
555 # Suppress warnings from the Chromium Clang plugin.
556 # See http://code.google.com/p/webrtc/issues/detail?id=163 for details.
557 configs -= [ "//build/config/clang:find_bad_constructs" ]
558 }
559
560 deps = [
561 "base:rtc_base",
kjellander82a94492016-06-12 22:12:01 -0700562 "base:rtc_base_tests_utils",
kjellander@webrtc.org3ee56142016-06-03 15:57:02 +0200563 "base:rtc_task_queue",
564 "p2p:libstunprober",
565 "p2p:rtc_p2p",
566 "//testing/gmock",
567 "//testing/gtest",
568 ]
569
570 if (is_android) {
571 deps += [ "//testing/android/native_test:native_test_support" ]
572 }
kjellander3bcedd32016-06-08 01:14:15 -0700573
574 if (is_ios || (is_mac && mac_deployment_target == "10.7")) {
575 deps += [
576 "sdk:rtc_sdk_peerconnection_objc",
577 "system_wrappers:system_wrappers_default",
578 ]
579 sources += [
580 "sdk/objc/Framework/UnitTests/RTCConfigurationTest.mm",
581 "sdk/objc/Framework/UnitTests/RTCDataChannelConfigurationTest.mm",
582 "sdk/objc/Framework/UnitTests/RTCIceCandidateTest.mm",
583 "sdk/objc/Framework/UnitTests/RTCIceServerTest.mm",
584 "sdk/objc/Framework/UnitTests/RTCMediaConstraintsTest.mm",
585 "sdk/objc/Framework/UnitTests/RTCSessionDescriptionTest.mm",
586 ]
587
588 # TODO(tkchin): Cleanup this warning.
589 cflags = [ "-Wno-objc-property-no-attribute" ]
590
591 # |-ObjC| flag needed to make sure category method implementations
592 # are included:
593 # https://developer.apple.com/library/mac/qa/qa1490/_index.html
594 ldflags = [ "-ObjC" ]
595 }
kjellander@webrtc.org3ee56142016-06-03 15:57:02 +0200596 }
Peter Boström02083222016-06-14 12:52:54 +0200597
598 # TODO(pbos): Rename test suite, this is no longer "just" for video targets.
599 test("video_engine_tests") {
600 testonly = true
601 deps = [
602 "audio:audio_tests",
603 "call:call_tests",
604 "modules/video_capture",
605 "test:test_common",
606 "test:test_main",
607 "video:video_tests",
608 ]
609 if (is_clang) {
610 # Suppress warnings from the Chromium Clang plugin.
611 # See http://code.google.com/p/webrtc/issues/detail?id=163 for details.
612 configs -= [ "//build/config/clang:find_bad_constructs" ]
613 }
614 }
kjellander@webrtc.org3ee56142016-06-03 15:57:02 +0200615}