blob: 09fa2c253398faa26cd8db0263527764fbd5c296 [file] [log] [blame]
kjellanderc76dc952016-06-03 03:09:32 -07001# Copyright (c) 2016 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
mbonadei9aa3f0a2017-01-24 06:58:22 -08009import("../webrtc.gni")
ossu7bb87ee2017-01-23 04:56:25 -080010if (is_android) {
11 import("//build/config/android/config.gni")
12 import("//build/config/android/rules.gni")
13}
kjellanderc76dc952016-06-03 03:09:32 -070014
15group("pc") {
Mirko Bonadeie51f7852017-12-06 11:23:19 +010016 deps = [
kjellanderc76dc952016-06-03 03:09:32 -070017 ":rtc_pc",
18 ]
19}
20
21config("rtc_pc_config") {
jbaucheaa9c1d2017-03-06 11:32:22 -080022 defines = []
deadbeef40610e22016-12-22 10:53:38 -080023 if (rtc_enable_sctp) {
24 defines += [ "HAVE_SCTP" ]
25 }
kjellanderc76dc952016-06-03 03:09:32 -070026}
27
zhihuang38ede132017-06-15 12:52:32 -070028rtc_static_library("rtc_pc_base") {
Per Kjellandera7f2d842018-01-10 15:54:53 +000029 visibility = [ "*" ]
kjellanderc76dc952016-06-03 03:09:32 -070030 defines = []
31 sources = [
32 "audiomonitor.cc",
33 "audiomonitor.h",
34 "bundlefilter.cc",
35 "bundlefilter.h",
36 "channel.cc",
37 "channel.h",
38 "channelmanager.cc",
39 "channelmanager.h",
40 "currentspeakermonitor.cc",
41 "currentspeakermonitor.h",
Zhi Huangf2d7beb2017-11-20 14:35:11 -080042 "dtlssrtptransport.cc",
43 "dtlssrtptransport.h",
jbauchdfcab722017-03-06 00:14:10 -080044 "externalhmac.cc",
45 "externalhmac.h",
Taylor Brandstetter6e2e7ce2017-12-19 10:26:23 -080046 "jseptransport.cc",
47 "jseptransport.h",
kjellanderc76dc952016-06-03 03:09:32 -070048 "mediamonitor.cc",
49 "mediamonitor.h",
50 "mediasession.cc",
51 "mediasession.h",
kjellanderc76dc952016-06-03 03:09:32 -070052 "rtcpmuxfilter.cc",
53 "rtcpmuxfilter.h",
Steve Anton1d03a752017-11-27 14:30:09 -080054 "rtpmediautils.cc",
55 "rtpmediautils.h",
zsteind48dbda2017-04-04 19:45:57 -070056 "rtptransport.cc",
57 "rtptransport.h",
zstein398c3fd2017-07-19 13:38:02 -070058 "rtptransportinternal.h",
Zhi Huangf2d7beb2017-11-20 14:35:11 -080059 "rtptransportinternaladapter.h",
Steve Anton4ab68ee2017-12-19 14:26:11 -080060 "sessiondescription.cc",
61 "sessiondescription.h",
kjellanderc76dc952016-06-03 03:09:32 -070062 "srtpfilter.cc",
63 "srtpfilter.h",
zstein4dde3df2017-07-07 14:26:25 -070064 "srtpsession.cc",
65 "srtpsession.h",
zstein398c3fd2017-07-19 13:38:02 -070066 "srtptransport.cc",
67 "srtptransport.h",
Zhi Huangb5261582017-09-29 10:51:43 -070068 "transportcontroller.cc",
69 "transportcontroller.h",
kjellanderc76dc952016-06-03 03:09:32 -070070 "voicechannel.h",
71 ]
72
73 deps = [
mbonadei7d9a55b2017-06-01 13:01:48 -070074 "..:webrtc_common",
kjellandera69d9732016-08-31 07:33:05 -070075 "../api:call_api",
mbonadei7d9a55b2017-06-01 13:01:48 -070076 "../api:libjingle_peerconnection_api",
kwiberg84f6a3f2017-09-05 08:43:13 -070077 "../api:optional",
mbonadei7d9a55b2017-06-01 13:01:48 -070078 "../api:ortc_api",
Patrik Höglundbe214a22018-01-04 12:14:35 +010079 "../common_video:common_video",
zhihuang38ede132017-06-15 12:52:32 -070080 "../media:rtc_data",
zhihuang130ca7e2017-06-21 01:02:59 -070081 "../media:rtc_h264_profile_id",
zhihuang38ede132017-06-15 12:52:32 -070082 "../media:rtc_media_base",
mbonadei7d9a55b2017-06-01 13:01:48 -070083 "../p2p:rtc_p2p",
Patrik Höglunda8005cf2017-12-13 16:05:42 +010084 "../rtc_base:checks",
ehmaldonadof6a861a2017-07-19 10:40:47 -070085 "../rtc_base:rtc_base",
86 "../rtc_base:rtc_task_queue",
Patrik Höglund3e113432017-12-15 14:40:10 +010087 "../rtc_base:stringutils",
kjellanderc76dc952016-06-03 03:09:32 -070088 ]
89
kjellanderc76dc952016-06-03 03:09:32 -070090 if (rtc_build_libsrtp) {
91 deps += [ "//third_party/libsrtp" ]
92 }
93
ehmaldonadoe9cc6862016-09-05 06:10:18 -070094 public_configs = [ ":rtc_pc_config" ]
kjellanderc76dc952016-06-03 03:09:32 -070095
kjellandere40a7ee2016-10-16 23:56:12 -070096 if (!build_with_chromium && is_clang) {
kjellander142f8c52016-06-13 00:08:24 -070097 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
ehmaldonado38a21322016-09-02 04:10:34 -070098 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
kjellanderc76dc952016-06-03 03:09:32 -070099 }
100}
kjellander142f8c52016-06-13 00:08:24 -0700101
zhihuang38ede132017-06-15 12:52:32 -0700102rtc_source_set("rtc_pc") {
Per Kjellandera7f2d842018-01-10 15:54:53 +0000103 visibility = [ "*" ]
zhihuang38ede132017-06-15 12:52:32 -0700104 deps = [
Mirko Bonadeie51f7852017-12-06 11:23:19 +0100105 ":rtc_pc_base",
zhihuang38ede132017-06-15 12:52:32 -0700106 "../media:rtc_audio_video",
107 ]
108}
109
ossu7bb87ee2017-01-23 04:56:25 -0800110config("libjingle_peerconnection_warnings_config") {
111 # GN orders flags on a target before flags from configs. The default config
112 # adds these flags so to cancel them out they need to come from a config and
113 # cannot be on the target directly.
114 if (!is_win && !is_clang) {
115 cflags = [ "-Wno-maybe-uninitialized" ] # Only exists for GCC.
116 }
117}
118
zhihuang38ede132017-06-15 12:52:32 -0700119rtc_static_library("peerconnection") {
Per Kjellandera7f2d842018-01-10 15:54:53 +0000120 visibility = [ "*" ]
ossu7bb87ee2017-01-23 04:56:25 -0800121 cflags = []
122 sources = [
123 "audiotrack.cc",
124 "audiotrack.h",
125 "datachannel.cc",
126 "datachannel.h",
127 "dtmfsender.cc",
128 "dtmfsender.h",
deadbeef1dcb1642017-03-29 21:08:16 -0700129 "iceserverparsing.cc",
130 "iceserverparsing.h",
ossu7bb87ee2017-01-23 04:56:25 -0800131 "jsepicecandidate.cc",
132 "jsepsessiondescription.cc",
133 "localaudiosource.cc",
134 "localaudiosource.h",
ossu7bb87ee2017-01-23 04:56:25 -0800135 "mediastream.cc",
136 "mediastream.h",
137 "mediastreamobserver.cc",
138 "mediastreamobserver.h",
139 "mediastreamtrack.h",
ossu7bb87ee2017-01-23 04:56:25 -0800140 "peerconnection.cc",
141 "peerconnection.h",
142 "peerconnectionfactory.cc",
143 "peerconnectionfactory.h",
144 "remoteaudiosource.cc",
145 "remoteaudiosource.h",
146 "rtcstatscollector.cc",
147 "rtcstatscollector.h",
148 "rtpreceiver.cc",
149 "rtpreceiver.h",
150 "rtpsender.cc",
151 "rtpsender.h",
Steve Anton6e634bf2017-11-13 10:44:53 -0800152 "rtptransceiver.cc",
153 "rtptransceiver.h",
ossu7bb87ee2017-01-23 04:56:25 -0800154 "sctputils.cc",
155 "sctputils.h",
Steve Anton97a9f762017-10-06 10:14:03 -0700156 "sdputils.cc",
157 "sdputils.h",
ossu7bb87ee2017-01-23 04:56:25 -0800158 "statscollector.cc",
159 "statscollector.h",
160 "streamcollection.h",
deadbeef804c1af2017-02-11 19:07:31 -0800161 "trackmediainfomap.cc",
162 "trackmediainfomap.h",
ossu7bb87ee2017-01-23 04:56:25 -0800163 "videocapturertracksource.cc",
164 "videocapturertracksource.h",
165 "videotrack.cc",
166 "videotrack.h",
167 "videotracksource.cc",
168 "videotracksource.h",
169 "webrtcsdp.cc",
170 "webrtcsdp.h",
ossu7bb87ee2017-01-23 04:56:25 -0800171 "webrtcsessiondescriptionfactory.cc",
172 "webrtcsessiondescriptionfactory.h",
173 ]
174
175 configs += [ ":libjingle_peerconnection_warnings_config" ]
176
177 if (!build_with_chromium && is_clang) {
178 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
179 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
180 }
181
182 deps = [
zhihuang38ede132017-06-15 12:52:32 -0700183 ":rtc_pc_base",
mbonadei7d9a55b2017-06-01 13:01:48 -0700184 "..:webrtc_common",
ossu7bb87ee2017-01-23 04:56:25 -0800185 "../api:call_api",
Mirko Bonadeie51f7852017-12-06 11:23:19 +0100186 "../api:libjingle_peerconnection_api",
kwiberg84f6a3f2017-09-05 08:43:13 -0700187 "../api:optional",
ossu7bb87ee2017-01-23 04:56:25 -0800188 "../api:rtc_stats_api",
ilnikd60d06a2017-04-05 03:02:20 -0700189 "../api/video_codecs:video_codecs_api",
zhihuang38ede132017-06-15 12:52:32 -0700190 "../call:call_interfaces",
Patrik Höglundbe214a22018-01-04 12:14:35 +0100191 "../common_video:common_video",
mbonadei7d9a55b2017-06-01 13:01:48 -0700192 "../logging:rtc_event_log_api",
zhihuang38ede132017-06-15 12:52:32 -0700193 "../media:rtc_data",
194 "../media:rtc_media_base",
mbonadei7d9a55b2017-06-01 13:01:48 -0700195 "../p2p:rtc_p2p",
Patrik Höglunda8005cf2017-12-13 16:05:42 +0100196 "../rtc_base:checks",
ehmaldonadof6a861a2017-07-19 10:40:47 -0700197 "../rtc_base:rtc_base",
198 "../rtc_base:rtc_base_approved",
Patrik Höglund3e113432017-12-15 14:40:10 +0100199 "../rtc_base:stringutils",
ossu7bb87ee2017-01-23 04:56:25 -0800200 "../stats",
Mirko Bonadeia498ae82017-12-06 09:17:14 +0100201 "../system_wrappers",
202 "../system_wrappers:field_trial_api",
ossu7bb87ee2017-01-23 04:56:25 -0800203 ]
zhihuang38ede132017-06-15 12:52:32 -0700204}
205
206# This target implements CreatePeerConnectionFactory methods that will create a
207# PeerConnection will full functionality (audio, video and data). Applications
208# that wish to reduce their binary size by ommitting functionality they don't
209# need should use CreateModularCreatePeerConnectionFactory instead, using the
210# "peerconnection" build target and other targets specific to their
211# requrements. See comment in peerconnectionfactoryinterface.h.
zhihuangab97e182017-06-22 01:28:59 -0700212rtc_static_library("create_pc_factory") {
zhihuang38ede132017-06-15 12:52:32 -0700213 sources = [
214 "createpeerconnectionfactory.cc",
215 ]
216
217 deps = [
218 "../api:audio_mixer_api",
219 "../api:libjingle_peerconnection_api",
Edward Lemur872cf382017-11-20 18:41:50 +0100220 "../api:peerconnection_and_implicit_call_api",
zhihuang38ede132017-06-15 12:52:32 -0700221 "../api/audio_codecs:audio_codecs_api",
Magnus Jedvert58b03162017-09-15 19:02:47 +0200222 "../api/video_codecs:video_codecs_api",
zhihuang38ede132017-06-15 12:52:32 -0700223 "../call",
224 "../call:call_interfaces",
225 "../logging:rtc_event_log_api",
226 "../media:rtc_audio_video",
Edward Lemur872cf382017-11-20 18:41:50 +0100227 "../media:rtc_media_base",
zhihuang38ede132017-06-15 12:52:32 -0700228 "../modules/audio_device:audio_device",
peaha9cc40b2017-06-29 08:32:09 -0700229 "../modules/audio_processing:audio_processing",
ehmaldonadof6a861a2017-07-19 10:40:47 -0700230 "../rtc_base:rtc_base",
231 "../rtc_base:rtc_base_approved",
zhihuang38ede132017-06-15 12:52:32 -0700232 ]
233
234 configs += [ ":libjingle_peerconnection_warnings_config" ]
235
236 if (!build_with_chromium && is_clang) {
237 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
238 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
239 }
240}
241
242rtc_source_set("libjingle_peerconnection") {
Per Kjellandera7f2d842018-01-10 15:54:53 +0000243 visibility = [ "*" ]
Mirko Bonadeie51f7852017-12-06 11:23:19 +0100244 deps = [
zhihuang38ede132017-06-15 12:52:32 -0700245 ":create_pc_factory",
246 ":peerconnection",
247 "../api:libjingle_peerconnection_api",
248 ]
ossu7bb87ee2017-01-23 04:56:25 -0800249}
250
kjellander142f8c52016-06-13 00:08:24 -0700251if (rtc_include_tests) {
252 config("rtc_pc_unittests_config") {
253 # GN orders flags on a target before flags from configs. The default config
254 # adds -Wall, and this flag have to be after -Wall -- so they need to
255 # come from a config and can't be on the target directly.
256 if (!is_win && !is_clang) {
257 cflags = [ "-Wno-maybe-uninitialized" ] # Only exists for GCC.
258 }
259 }
260
ehmaldonado38a21322016-09-02 04:10:34 -0700261 rtc_test("rtc_pc_unittests") {
kjellander142f8c52016-06-13 00:08:24 -0700262 testonly = true
263
264 sources = [
265 "bundlefilter_unittest.cc",
266 "channel_unittest.cc",
267 "channelmanager_unittest.cc",
268 "currentspeakermonitor_unittest.cc",
Zhi Huangf2d7beb2017-11-20 14:35:11 -0800269 "dtlssrtptransport_unittest.cc",
Taylor Brandstetter6e2e7ce2017-12-19 10:26:23 -0800270 "jseptransport_unittest.cc",
kjellander142f8c52016-06-13 00:08:24 -0700271 "mediasession_unittest.cc",
272 "rtcpmuxfilter_unittest.cc",
zstein56162b92017-04-24 16:54:35 -0700273 "rtptransport_unittest.cc",
zstein398c3fd2017-07-19 13:38:02 -0700274 "rtptransporttestutil.h",
kjellander142f8c52016-06-13 00:08:24 -0700275 "srtpfilter_unittest.cc",
zstein4dde3df2017-07-07 14:26:25 -0700276 "srtpsession_unittest.cc",
277 "srtptestutil.h",
zstein398c3fd2017-07-19 13:38:02 -0700278 "srtptransport_unittest.cc",
Zhi Huangb5261582017-09-29 10:51:43 -0700279 "transportcontroller_unittest.cc",
kjellander142f8c52016-06-13 00:08:24 -0700280 ]
281
282 include_dirs = [ "//third_party/libsrtp/srtp" ]
283
ehmaldonado7a2ce0b2016-09-05 01:35:44 -0700284 configs += [ ":rtc_pc_unittests_config" ]
kjellander142f8c52016-06-13 00:08:24 -0700285
kjellandere40a7ee2016-10-16 23:56:12 -0700286 if (!build_with_chromium && is_clang) {
kjellander142f8c52016-06-13 00:08:24 -0700287 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
ehmaldonado38a21322016-09-02 04:10:34 -0700288 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
kjellander142f8c52016-06-13 00:08:24 -0700289 }
290
291 if (is_win) {
292 libs = [ "strmiids.lib" ]
293 }
294
295 deps = [
ossu7bb87ee2017-01-23 04:56:25 -0800296 ":libjingle_peerconnection",
Zhi Huangb5261582017-09-29 10:51:43 -0700297 ":pc_test_utils",
kjellander142f8c52016-06-13 00:08:24 -0700298 ":rtc_pc",
Mirko Bonadeie51f7852017-12-06 11:23:19 +0100299 ":rtc_pc_base",
kwiberg529662a2017-09-04 05:43:17 -0700300 "../api:array_view",
Mirko Bonadeie51f7852017-12-06 11:23:19 +0100301 "../api:libjingle_peerconnection_api",
mbonadei7d9a55b2017-06-01 13:01:48 -0700302 "../logging:rtc_event_log_api",
303 "../media:rtc_media_base",
mbonadei9087d492017-04-25 00:35:35 -0700304 "../media:rtc_media_tests_utils",
mbonadei7d9a55b2017-06-01 13:01:48 -0700305 "../p2p:p2p_test_utils",
306 "../p2p:rtc_p2p",
Patrik Höglunda8005cf2017-12-13 16:05:42 +0100307 "../rtc_base:checks",
ehmaldonadof6a861a2017-07-19 10:40:47 -0700308 "../rtc_base:rtc_base",
309 "../rtc_base:rtc_base_approved",
310 "../rtc_base:rtc_base_tests_main",
311 "../rtc_base:rtc_base_tests_utils",
kjellander142f8c52016-06-13 00:08:24 -0700312 "../system_wrappers:metrics_default",
zstein398c3fd2017-07-19 13:38:02 -0700313 "../test:test_support",
kjellander142f8c52016-06-13 00:08:24 -0700314 ]
315
316 if (rtc_build_libsrtp) {
317 deps += [ "//third_party/libsrtp" ]
318 }
319
320 if (is_android) {
321 deps += [ "//testing/android/native_test:native_test_support" ]
322 }
323 }
ossu7bb87ee2017-01-23 04:56:25 -0800324
deadbeefe814a0d2017-02-25 18:15:09 -0800325 rtc_source_set("pc_test_utils") {
326 testonly = true
327 sources = [
328 "test/fakeaudiocapturemodule.cc",
329 "test/fakeaudiocapturemodule.h",
330 "test/fakedatachannelprovider.h",
331 "test/fakeperiodicvideocapturer.h",
332 "test/fakertccertificategenerator.h",
Steve Antonda6c0952017-10-23 11:41:54 -0700333 "test/fakesctptransport.h",
Zhi Huangb5261582017-09-29 10:51:43 -0700334 "test/faketransportcontroller.h",
deadbeefe814a0d2017-02-25 18:15:09 -0800335 "test/fakevideotrackrenderer.h",
336 "test/fakevideotracksource.h",
337 "test/mock_datachannel.h",
338 "test/mock_peerconnection.h",
deadbeefe814a0d2017-02-25 18:15:09 -0800339 "test/mockpeerconnectionobservers.h",
340 "test/peerconnectiontestwrapper.cc",
341 "test/peerconnectiontestwrapper.h",
342 "test/rtcstatsobtainer.h",
343 "test/testsdpstrings.h",
344 ]
345
346 deps = [
347 ":libjingle_peerconnection",
Mirko Bonadeie51f7852017-12-06 11:23:19 +0100348 ":peerconnection",
Zhi Huangb5261582017-09-29 10:51:43 -0700349 ":rtc_pc_base",
mbonadei7d9a55b2017-06-01 13:01:48 -0700350 "..:webrtc_common",
351 "../api:libjingle_peerconnection_test_api",
Edward Lemur872cf382017-11-20 18:41:50 +0100352 "../api:peerconnection_and_implicit_call_api",
mbonadei7d9a55b2017-06-01 13:01:48 -0700353 "../api:rtc_stats_api",
zhihuang38ede132017-06-15 12:52:32 -0700354 "../call:call_interfaces",
355 "../logging:rtc_event_log_api",
mbonadei7d9a55b2017-06-01 13:01:48 -0700356 "../media:rtc_media",
Edward Lemur872cf382017-11-20 18:41:50 +0100357 "../media:rtc_media_base",
mbonadei7d9a55b2017-06-01 13:01:48 -0700358 "../media:rtc_media_tests_utils",
359 "../modules/audio_device:audio_device",
360 "../p2p:p2p_test_utils",
Patrik Höglunda8005cf2017-12-13 16:05:42 +0100361 "../rtc_base:checks",
ehmaldonadof6a861a2017-07-19 10:40:47 -0700362 "../rtc_base:rtc_base",
363 "../rtc_base:rtc_base_approved",
364 "../rtc_base:rtc_base_tests_utils",
mbonadei7d9a55b2017-06-01 13:01:48 -0700365 "../test:test_support",
deadbeefe814a0d2017-02-25 18:15:09 -0800366 "//testing/gmock",
367 ]
368
369 if (!build_with_chromium && is_clang) {
370 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
371 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
372 }
373 }
374
ossu7bb87ee2017-01-23 04:56:25 -0800375 config("peerconnection_unittests_config") {
376 # The warnings below are enabled by default. Since GN orders compiler flags
377 # for a target before flags from configs, the only way to disable such
378 # warnings is by having them in a separate config, loaded from the target.
379 # TODO(kjellander): Make the code compile without disabling these flags.
380 # See https://bugs.webrtc.org/3307.
381 if (is_clang && is_win) {
382 cflags = [
383 # See https://bugs.chromium.org/p/webrtc/issues/detail?id=6267
384 # for -Wno-sign-compare
385 "-Wno-sign-compare",
ossu7bb87ee2017-01-23 04:56:25 -0800386 ]
387 }
388
389 if (!is_win) {
390 cflags = [ "-Wno-sign-compare" ]
391 }
392 }
393
394 rtc_test("peerconnection_unittests") {
ossu7bb87ee2017-01-23 04:56:25 -0800395 testonly = true
396 sources = [
397 "datachannel_unittest.cc",
398 "dtmfsender_unittest.cc",
deadbeef1dcb1642017-03-29 21:08:16 -0700399 "iceserverparsing_unittest.cc",
ossu7bb87ee2017-01-23 04:56:25 -0800400 "jsepsessiondescription_unittest.cc",
401 "localaudiosource_unittest.cc",
402 "mediaconstraintsinterface_unittest.cc",
403 "mediastream_unittest.cc",
Steve Anton6f25b092017-10-23 09:39:20 -0700404 "peerconnection_bundle_unittest.cc",
Steve Anton6b63cd52017-10-06 11:20:31 -0700405 "peerconnection_crypto_unittest.cc",
Steve Antonda6c0952017-10-23 11:41:54 -0700406 "peerconnection_datachannel_unittest.cc",
Steve Antonf1c6db12017-10-13 11:13:35 -0700407 "peerconnection_ice_unittest.cc",
deadbeef1dcb1642017-03-29 21:08:16 -0700408 "peerconnection_integrationtest.cc",
Steve Antondcc3c022017-12-22 16:02:54 -0800409 "peerconnection_jsep_unittest.cc",
Steve Anton8d3444d2017-10-20 15:30:51 -0700410 "peerconnection_media_unittest.cc",
Henrik Boström933d8b02017-10-10 10:05:16 -0700411 "peerconnection_rtp_unittest.cc",
Steve Anton8d3444d2017-10-20 15:30:51 -0700412 "peerconnection_signaling_unittest.cc",
ossu7bb87ee2017-01-23 04:56:25 -0800413 "peerconnectionendtoend_unittest.cc",
414 "peerconnectionfactory_unittest.cc",
415 "peerconnectioninterface_unittest.cc",
Steve Anton94286cb2017-09-26 16:20:19 -0700416 "peerconnectionwrapper.cc",
417 "peerconnectionwrapper.h",
ossu7bb87ee2017-01-23 04:56:25 -0800418 "proxy_unittest.cc",
419 "rtcstats_integrationtest.cc",
420 "rtcstatscollector_unittest.cc",
Steve Anton1d03a752017-11-27 14:30:09 -0800421 "rtpmediautils_unittest.cc",
ossu7bb87ee2017-01-23 04:56:25 -0800422 "rtpsenderreceiver_unittest.cc",
423 "sctputils_unittest.cc",
424 "statscollector_unittest.cc",
ossu7bb87ee2017-01-23 04:56:25 -0800425 "test/fakeaudiocapturemodule_unittest.cc",
ossu7bb87ee2017-01-23 04:56:25 -0800426 "test/testsdpstrings.h",
deadbeef804c1af2017-02-11 19:07:31 -0800427 "trackmediainfomap_unittest.cc",
ossu7bb87ee2017-01-23 04:56:25 -0800428 "videocapturertracksource_unittest.cc",
429 "videotrack_unittest.cc",
430 "webrtcsdp_unittest.cc",
ossu7bb87ee2017-01-23 04:56:25 -0800431 ]
432
433 if (rtc_enable_sctp) {
434 defines = [ "HAVE_SCTP" ]
435 }
436
437 configs += [ ":peerconnection_unittests_config" ]
438
439 if (!build_with_chromium && is_clang) {
440 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
441 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
442 }
443
444 # TODO(jschuh): Bug 1348: fix this warning.
445 configs += [ "//build/config/compiler:no_size_t_to_int_warning" ]
446
447 if (is_win) {
448 cflags = [
449 "/wd4245", # conversion from int to size_t, signed/unsigned mismatch.
450 "/wd4389", # signed/unsigned mismatch.
451 ]
452 }
453
Mirko Bonadeie51f7852017-12-06 11:23:19 +0100454 deps = [
455 ":peerconnection",
456 ":rtc_pc_base",
Patrik Höglund4b9e6ba2017-12-19 10:32:11 +0100457 "../api:mock_rtp",
Patrik Höglunda8005cf2017-12-13 16:05:42 +0100458 "../rtc_base:checks",
Patrik Höglund3e113432017-12-15 14:40:10 +0100459 "../rtc_base:stringutils",
Mirko Bonadeie51f7852017-12-06 11:23:19 +0100460 ]
ossu7bb87ee2017-01-23 04:56:25 -0800461 if (is_android) {
Patrik Höglund563934e2017-09-15 09:04:28 +0200462 deps += [ ":android_black_magic" ]
ossu7bb87ee2017-01-23 04:56:25 -0800463 }
464
465 deps += [
466 ":libjingle_peerconnection",
deadbeefe814a0d2017-02-25 18:15:09 -0800467 ":pc_test_utils",
ossu7bb87ee2017-01-23 04:56:25 -0800468 "..:webrtc_common",
469 "../api:fakemetricsobserver",
Patrik Höglund563934e2017-09-15 09:04:28 +0200470 "../api:libjingle_peerconnection_test_api",
Henrik Boström31638672017-11-23 17:48:32 +0100471 "../api:optional",
Patrik Höglund563934e2017-09-15 09:04:28 +0200472 "../api:rtc_stats_api",
Karl Wibergc5bb00b2017-10-10 23:17:17 +0200473 "../api/audio_codecs:audio_codecs_api",
Patrik Höglund563934e2017-09-15 09:04:28 +0200474 "../api/audio_codecs:builtin_audio_decoder_factory",
475 "../api/audio_codecs:builtin_audio_encoder_factory",
Karl Wibergc5bb00b2017-10-10 23:17:17 +0200476 "../api/audio_codecs/L16:audio_decoder_L16",
477 "../api/audio_codecs/L16:audio_encoder_L16",
Steve Anton8d3444d2017-10-20 15:30:51 -0700478 "../call:call_interfaces",
Elad Alon99c3fe52017-10-13 16:29:40 +0200479 "../logging:rtc_event_log_api",
Steve Anton8d3444d2017-10-20 15:30:51 -0700480 "../logging:rtc_event_log_impl",
Patrik Höglund563934e2017-09-15 09:04:28 +0200481 "../media:rtc_audio_video",
482 "../media:rtc_data", # TODO(phoglund): AFAIK only used for one sctp constant.
483 "../media:rtc_media_base",
mbonadei9087d492017-04-25 00:35:35 -0700484 "../media:rtc_media_tests_utils",
Patrik Höglund563934e2017-09-15 09:04:28 +0200485 "../modules/audio_processing:audio_processing",
486 "../modules/utility:utility",
487 "../p2p:p2p_test_utils",
488 "../p2p:rtc_p2p",
ossu7bb87ee2017-01-23 04:56:25 -0800489 "../pc:rtc_pc",
Henrik Boström933d8b02017-10-10 10:05:16 -0700490 "../rtc_base:rtc_base",
Patrik Höglund563934e2017-09-15 09:04:28 +0200491 "../rtc_base:rtc_base_approved",
ehmaldonadof6a861a2017-07-19 10:40:47 -0700492 "../rtc_base:rtc_base_tests_main",
493 "../rtc_base:rtc_base_tests_utils",
ossu7bb87ee2017-01-23 04:56:25 -0800494 "../system_wrappers:metrics_default",
kwiberg2b3aa142017-06-14 03:31:17 -0700495 "../test:audio_codec_mocks",
Patrik Höglund563934e2017-09-15 09:04:28 +0200496 "../test:test_support",
ossu7bb87ee2017-01-23 04:56:25 -0800497 ]
498
499 if (is_android) {
Patrik Höglund563934e2017-09-15 09:04:28 +0200500 deps += [
501 "//testing/android/native_test:native_test_support",
502
503 # We need to depend on this one directly, or classloads will fail for
504 # the voice engine BuildInfo, for instance.
505 "../sdk/android:libjingle_peerconnection_java",
506 ]
ossu7bb87ee2017-01-23 04:56:25 -0800507
508 shard_timeout = 900
509 }
510 }
Patrik Höglund563934e2017-09-15 09:04:28 +0200511
512 if (is_android) {
513 rtc_source_set("android_black_magic") {
514 # The android code uses hacky includes to chromium-base and the ssl code;
515 # having this in a separate target enables us to keep the peerconnection
516 # unit tests clean.
517 check_includes = false
518 testonly = true
519 sources = [
520 "test/androidtestinitializer.cc",
521 "test/androidtestinitializer.h",
522 ]
523 deps = [
524 "../sdk/android:libjingle_peerconnection_jni",
525 "//testing/android/native_test:native_test_support",
526 ]
527 }
528 }
kjellander142f8c52016-06-13 00:08:24 -0700529}