blob: a0f94af104ea8cdfdcd056b89751efc290edb30c [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") {
kjellanderc76dc952016-06-03 03:09:32 -070029 defines = []
30 sources = [
31 "audiomonitor.cc",
32 "audiomonitor.h",
33 "bundlefilter.cc",
34 "bundlefilter.h",
35 "channel.cc",
36 "channel.h",
37 "channelmanager.cc",
38 "channelmanager.h",
39 "currentspeakermonitor.cc",
40 "currentspeakermonitor.h",
Zhi Huangf2d7beb2017-11-20 14:35:11 -080041 "dtlssrtptransport.cc",
42 "dtlssrtptransport.h",
jbauchdfcab722017-03-06 00:14:10 -080043 "externalhmac.cc",
44 "externalhmac.h",
Taylor Brandstetter6e2e7ce2017-12-19 10:26:23 -080045 "jseptransport.cc",
46 "jseptransport.h",
kjellanderc76dc952016-06-03 03:09:32 -070047 "mediamonitor.cc",
48 "mediamonitor.h",
49 "mediasession.cc",
50 "mediasession.h",
kjellanderc76dc952016-06-03 03:09:32 -070051 "rtcpmuxfilter.cc",
52 "rtcpmuxfilter.h",
Steve Anton1d03a752017-11-27 14:30:09 -080053 "rtpmediautils.cc",
54 "rtpmediautils.h",
zsteind48dbda2017-04-04 19:45:57 -070055 "rtptransport.cc",
56 "rtptransport.h",
zstein398c3fd2017-07-19 13:38:02 -070057 "rtptransportinternal.h",
Zhi Huangf2d7beb2017-11-20 14:35:11 -080058 "rtptransportinternaladapter.h",
Steve Anton4ab68ee2017-12-19 14:26:11 -080059 "sessiondescription.cc",
60 "sessiondescription.h",
kjellanderc76dc952016-06-03 03:09:32 -070061 "srtpfilter.cc",
62 "srtpfilter.h",
zstein4dde3df2017-07-07 14:26:25 -070063 "srtpsession.cc",
64 "srtpsession.h",
zstein398c3fd2017-07-19 13:38:02 -070065 "srtptransport.cc",
66 "srtptransport.h",
Zhi Huangb5261582017-09-29 10:51:43 -070067 "transportcontroller.cc",
68 "transportcontroller.h",
kjellanderc76dc952016-06-03 03:09:32 -070069 "voicechannel.h",
70 ]
71
72 deps = [
mbonadei7d9a55b2017-06-01 13:01:48 -070073 "..:webrtc_common",
kjellandera69d9732016-08-31 07:33:05 -070074 "../api:call_api",
mbonadei7d9a55b2017-06-01 13:01:48 -070075 "../api:libjingle_peerconnection_api",
kwiberg84f6a3f2017-09-05 08:43:13 -070076 "../api:optional",
mbonadei7d9a55b2017-06-01 13:01:48 -070077 "../api:ortc_api",
zhihuang38ede132017-06-15 12:52:32 -070078 "../media:rtc_data",
zhihuang130ca7e2017-06-21 01:02:59 -070079 "../media:rtc_h264_profile_id",
zhihuang38ede132017-06-15 12:52:32 -070080 "../media:rtc_media_base",
mbonadei7d9a55b2017-06-01 13:01:48 -070081 "../p2p:rtc_p2p",
Patrik Höglunda8005cf2017-12-13 16:05:42 +010082 "../rtc_base:checks",
ehmaldonadof6a861a2017-07-19 10:40:47 -070083 "../rtc_base:rtc_base",
84 "../rtc_base:rtc_task_queue",
Patrik Höglund3e113432017-12-15 14:40:10 +010085 "../rtc_base:stringutils",
kjellanderc76dc952016-06-03 03:09:32 -070086 ]
87
kjellanderc76dc952016-06-03 03:09:32 -070088 if (rtc_build_libsrtp) {
89 deps += [ "//third_party/libsrtp" ]
90 }
91
ehmaldonadoe9cc6862016-09-05 06:10:18 -070092 public_configs = [ ":rtc_pc_config" ]
kjellanderc76dc952016-06-03 03:09:32 -070093
kjellandere40a7ee2016-10-16 23:56:12 -070094 if (!build_with_chromium && is_clang) {
kjellander142f8c52016-06-13 00:08:24 -070095 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
ehmaldonado38a21322016-09-02 04:10:34 -070096 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
kjellanderc76dc952016-06-03 03:09:32 -070097 }
98}
kjellander142f8c52016-06-13 00:08:24 -070099
zhihuang38ede132017-06-15 12:52:32 -0700100rtc_source_set("rtc_pc") {
zhihuang38ede132017-06-15 12:52:32 -0700101 deps = [
Mirko Bonadeie51f7852017-12-06 11:23:19 +0100102 ":rtc_pc_base",
zhihuang38ede132017-06-15 12:52:32 -0700103 "../media:rtc_audio_video",
104 ]
105}
106
ossu7bb87ee2017-01-23 04:56:25 -0800107config("libjingle_peerconnection_warnings_config") {
108 # GN orders flags on a target before flags from configs. The default config
109 # adds these flags so to cancel them out they need to come from a config and
110 # cannot be on the target directly.
111 if (!is_win && !is_clang) {
112 cflags = [ "-Wno-maybe-uninitialized" ] # Only exists for GCC.
113 }
114}
115
zhihuang38ede132017-06-15 12:52:32 -0700116rtc_static_library("peerconnection") {
ossu7bb87ee2017-01-23 04:56:25 -0800117 cflags = []
118 sources = [
119 "audiotrack.cc",
120 "audiotrack.h",
121 "datachannel.cc",
122 "datachannel.h",
123 "dtmfsender.cc",
124 "dtmfsender.h",
deadbeef1dcb1642017-03-29 21:08:16 -0700125 "iceserverparsing.cc",
126 "iceserverparsing.h",
ossu7bb87ee2017-01-23 04:56:25 -0800127 "jsepicecandidate.cc",
128 "jsepsessiondescription.cc",
129 "localaudiosource.cc",
130 "localaudiosource.h",
ossu7bb87ee2017-01-23 04:56:25 -0800131 "mediastream.cc",
132 "mediastream.h",
133 "mediastreamobserver.cc",
134 "mediastreamobserver.h",
135 "mediastreamtrack.h",
ossu7bb87ee2017-01-23 04:56:25 -0800136 "peerconnection.cc",
137 "peerconnection.h",
138 "peerconnectionfactory.cc",
139 "peerconnectionfactory.h",
140 "remoteaudiosource.cc",
141 "remoteaudiosource.h",
142 "rtcstatscollector.cc",
143 "rtcstatscollector.h",
144 "rtpreceiver.cc",
145 "rtpreceiver.h",
146 "rtpsender.cc",
147 "rtpsender.h",
Steve Anton6e634bf2017-11-13 10:44:53 -0800148 "rtptransceiver.cc",
149 "rtptransceiver.h",
ossu7bb87ee2017-01-23 04:56:25 -0800150 "sctputils.cc",
151 "sctputils.h",
Steve Anton97a9f762017-10-06 10:14:03 -0700152 "sdputils.cc",
153 "sdputils.h",
ossu7bb87ee2017-01-23 04:56:25 -0800154 "statscollector.cc",
155 "statscollector.h",
156 "streamcollection.h",
deadbeef804c1af2017-02-11 19:07:31 -0800157 "trackmediainfomap.cc",
158 "trackmediainfomap.h",
ossu7bb87ee2017-01-23 04:56:25 -0800159 "videocapturertracksource.cc",
160 "videocapturertracksource.h",
161 "videotrack.cc",
162 "videotrack.h",
163 "videotracksource.cc",
164 "videotracksource.h",
165 "webrtcsdp.cc",
166 "webrtcsdp.h",
ossu7bb87ee2017-01-23 04:56:25 -0800167 "webrtcsessiondescriptionfactory.cc",
168 "webrtcsessiondescriptionfactory.h",
169 ]
170
171 configs += [ ":libjingle_peerconnection_warnings_config" ]
172
173 if (!build_with_chromium && is_clang) {
174 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
175 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
176 }
177
178 deps = [
zhihuang38ede132017-06-15 12:52:32 -0700179 ":rtc_pc_base",
mbonadei7d9a55b2017-06-01 13:01:48 -0700180 "..:webrtc_common",
ossu7bb87ee2017-01-23 04:56:25 -0800181 "../api:call_api",
Mirko Bonadeie51f7852017-12-06 11:23:19 +0100182 "../api:libjingle_peerconnection_api",
kwiberg84f6a3f2017-09-05 08:43:13 -0700183 "../api:optional",
ossu7bb87ee2017-01-23 04:56:25 -0800184 "../api:rtc_stats_api",
ilnikd60d06a2017-04-05 03:02:20 -0700185 "../api/video_codecs:video_codecs_api",
zhihuang38ede132017-06-15 12:52:32 -0700186 "../call:call_interfaces",
mbonadei7d9a55b2017-06-01 13:01:48 -0700187 "../logging:rtc_event_log_api",
zhihuang38ede132017-06-15 12:52:32 -0700188 "../media:rtc_data",
189 "../media:rtc_media_base",
mbonadei7d9a55b2017-06-01 13:01:48 -0700190 "../p2p:rtc_p2p",
Patrik Höglunda8005cf2017-12-13 16:05:42 +0100191 "../rtc_base:checks",
ehmaldonadof6a861a2017-07-19 10:40:47 -0700192 "../rtc_base:rtc_base",
193 "../rtc_base:rtc_base_approved",
Patrik Höglund3e113432017-12-15 14:40:10 +0100194 "../rtc_base:stringutils",
ossu7bb87ee2017-01-23 04:56:25 -0800195 "../stats",
Mirko Bonadeia498ae82017-12-06 09:17:14 +0100196 "../system_wrappers",
197 "../system_wrappers:field_trial_api",
ossu7bb87ee2017-01-23 04:56:25 -0800198 ]
zhihuang38ede132017-06-15 12:52:32 -0700199}
200
201# This target implements CreatePeerConnectionFactory methods that will create a
202# PeerConnection will full functionality (audio, video and data). Applications
203# that wish to reduce their binary size by ommitting functionality they don't
204# need should use CreateModularCreatePeerConnectionFactory instead, using the
205# "peerconnection" build target and other targets specific to their
206# requrements. See comment in peerconnectionfactoryinterface.h.
zhihuangab97e182017-06-22 01:28:59 -0700207rtc_static_library("create_pc_factory") {
zhihuang38ede132017-06-15 12:52:32 -0700208 sources = [
209 "createpeerconnectionfactory.cc",
210 ]
211
212 deps = [
213 "../api:audio_mixer_api",
214 "../api:libjingle_peerconnection_api",
Edward Lemur872cf382017-11-20 18:41:50 +0100215 "../api:peerconnection_and_implicit_call_api",
zhihuang38ede132017-06-15 12:52:32 -0700216 "../api/audio_codecs:audio_codecs_api",
Magnus Jedvert58b03162017-09-15 19:02:47 +0200217 "../api/video_codecs:video_codecs_api",
zhihuang38ede132017-06-15 12:52:32 -0700218 "../call",
219 "../call:call_interfaces",
220 "../logging:rtc_event_log_api",
221 "../media:rtc_audio_video",
Edward Lemur872cf382017-11-20 18:41:50 +0100222 "../media:rtc_media_base",
zhihuang38ede132017-06-15 12:52:32 -0700223 "../modules/audio_device:audio_device",
peaha9cc40b2017-06-29 08:32:09 -0700224 "../modules/audio_processing:audio_processing",
ehmaldonadof6a861a2017-07-19 10:40:47 -0700225 "../rtc_base:rtc_base",
226 "../rtc_base:rtc_base_approved",
zhihuang38ede132017-06-15 12:52:32 -0700227 ]
228
229 configs += [ ":libjingle_peerconnection_warnings_config" ]
230
231 if (!build_with_chromium && is_clang) {
232 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
233 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
234 }
235}
236
237rtc_source_set("libjingle_peerconnection") {
Mirko Bonadeie51f7852017-12-06 11:23:19 +0100238 deps = [
zhihuang38ede132017-06-15 12:52:32 -0700239 ":create_pc_factory",
240 ":peerconnection",
241 "../api:libjingle_peerconnection_api",
242 ]
ossu7bb87ee2017-01-23 04:56:25 -0800243}
244
kjellander142f8c52016-06-13 00:08:24 -0700245if (rtc_include_tests) {
246 config("rtc_pc_unittests_config") {
247 # GN orders flags on a target before flags from configs. The default config
248 # adds -Wall, and this flag have to be after -Wall -- so they need to
249 # come from a config and can't be on the target directly.
250 if (!is_win && !is_clang) {
251 cflags = [ "-Wno-maybe-uninitialized" ] # Only exists for GCC.
252 }
253 }
254
ehmaldonado38a21322016-09-02 04:10:34 -0700255 rtc_test("rtc_pc_unittests") {
kjellander142f8c52016-06-13 00:08:24 -0700256 testonly = true
257
258 sources = [
259 "bundlefilter_unittest.cc",
260 "channel_unittest.cc",
261 "channelmanager_unittest.cc",
262 "currentspeakermonitor_unittest.cc",
Zhi Huangf2d7beb2017-11-20 14:35:11 -0800263 "dtlssrtptransport_unittest.cc",
Taylor Brandstetter6e2e7ce2017-12-19 10:26:23 -0800264 "jseptransport_unittest.cc",
kjellander142f8c52016-06-13 00:08:24 -0700265 "mediasession_unittest.cc",
266 "rtcpmuxfilter_unittest.cc",
zstein56162b92017-04-24 16:54:35 -0700267 "rtptransport_unittest.cc",
zstein398c3fd2017-07-19 13:38:02 -0700268 "rtptransporttestutil.h",
kjellander142f8c52016-06-13 00:08:24 -0700269 "srtpfilter_unittest.cc",
zstein4dde3df2017-07-07 14:26:25 -0700270 "srtpsession_unittest.cc",
271 "srtptestutil.h",
zstein398c3fd2017-07-19 13:38:02 -0700272 "srtptransport_unittest.cc",
Zhi Huangb5261582017-09-29 10:51:43 -0700273 "transportcontroller_unittest.cc",
kjellander142f8c52016-06-13 00:08:24 -0700274 ]
275
276 include_dirs = [ "//third_party/libsrtp/srtp" ]
277
ehmaldonado7a2ce0b2016-09-05 01:35:44 -0700278 configs += [ ":rtc_pc_unittests_config" ]
kjellander142f8c52016-06-13 00:08:24 -0700279
kjellandere40a7ee2016-10-16 23:56:12 -0700280 if (!build_with_chromium && is_clang) {
kjellander142f8c52016-06-13 00:08:24 -0700281 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
ehmaldonado38a21322016-09-02 04:10:34 -0700282 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
kjellander142f8c52016-06-13 00:08:24 -0700283 }
284
285 if (is_win) {
286 libs = [ "strmiids.lib" ]
287 }
288
289 deps = [
ossu7bb87ee2017-01-23 04:56:25 -0800290 ":libjingle_peerconnection",
Zhi Huangb5261582017-09-29 10:51:43 -0700291 ":pc_test_utils",
kjellander142f8c52016-06-13 00:08:24 -0700292 ":rtc_pc",
Mirko Bonadeie51f7852017-12-06 11:23:19 +0100293 ":rtc_pc_base",
kwiberg529662a2017-09-04 05:43:17 -0700294 "../api:array_view",
Mirko Bonadeie51f7852017-12-06 11:23:19 +0100295 "../api:libjingle_peerconnection_api",
mbonadei7d9a55b2017-06-01 13:01:48 -0700296 "../logging:rtc_event_log_api",
297 "../media:rtc_media_base",
mbonadei9087d492017-04-25 00:35:35 -0700298 "../media:rtc_media_tests_utils",
mbonadei7d9a55b2017-06-01 13:01:48 -0700299 "../p2p:p2p_test_utils",
300 "../p2p:rtc_p2p",
Patrik Höglunda8005cf2017-12-13 16:05:42 +0100301 "../rtc_base:checks",
ehmaldonadof6a861a2017-07-19 10:40:47 -0700302 "../rtc_base:rtc_base",
303 "../rtc_base:rtc_base_approved",
304 "../rtc_base:rtc_base_tests_main",
305 "../rtc_base:rtc_base_tests_utils",
kjellander142f8c52016-06-13 00:08:24 -0700306 "../system_wrappers:metrics_default",
zstein398c3fd2017-07-19 13:38:02 -0700307 "../test:test_support",
kjellander142f8c52016-06-13 00:08:24 -0700308 ]
309
310 if (rtc_build_libsrtp) {
311 deps += [ "//third_party/libsrtp" ]
312 }
313
314 if (is_android) {
315 deps += [ "//testing/android/native_test:native_test_support" ]
316 }
317 }
ossu7bb87ee2017-01-23 04:56:25 -0800318
deadbeefe814a0d2017-02-25 18:15:09 -0800319 rtc_source_set("pc_test_utils") {
320 testonly = true
321 sources = [
322 "test/fakeaudiocapturemodule.cc",
323 "test/fakeaudiocapturemodule.h",
324 "test/fakedatachannelprovider.h",
325 "test/fakeperiodicvideocapturer.h",
326 "test/fakertccertificategenerator.h",
Steve Antonda6c0952017-10-23 11:41:54 -0700327 "test/fakesctptransport.h",
Zhi Huangb5261582017-09-29 10:51:43 -0700328 "test/faketransportcontroller.h",
deadbeefe814a0d2017-02-25 18:15:09 -0800329 "test/fakevideotrackrenderer.h",
330 "test/fakevideotracksource.h",
331 "test/mock_datachannel.h",
332 "test/mock_peerconnection.h",
deadbeefe814a0d2017-02-25 18:15:09 -0800333 "test/mockpeerconnectionobservers.h",
334 "test/peerconnectiontestwrapper.cc",
335 "test/peerconnectiontestwrapper.h",
336 "test/rtcstatsobtainer.h",
337 "test/testsdpstrings.h",
338 ]
339
340 deps = [
341 ":libjingle_peerconnection",
Mirko Bonadeie51f7852017-12-06 11:23:19 +0100342 ":peerconnection",
Zhi Huangb5261582017-09-29 10:51:43 -0700343 ":rtc_pc_base",
mbonadei7d9a55b2017-06-01 13:01:48 -0700344 "..:webrtc_common",
345 "../api:libjingle_peerconnection_test_api",
Edward Lemur872cf382017-11-20 18:41:50 +0100346 "../api:peerconnection_and_implicit_call_api",
mbonadei7d9a55b2017-06-01 13:01:48 -0700347 "../api:rtc_stats_api",
zhihuang38ede132017-06-15 12:52:32 -0700348 "../call:call_interfaces",
349 "../logging:rtc_event_log_api",
mbonadei7d9a55b2017-06-01 13:01:48 -0700350 "../media:rtc_media",
Edward Lemur872cf382017-11-20 18:41:50 +0100351 "../media:rtc_media_base",
mbonadei7d9a55b2017-06-01 13:01:48 -0700352 "../media:rtc_media_tests_utils",
353 "../modules/audio_device:audio_device",
354 "../p2p:p2p_test_utils",
Patrik Höglunda8005cf2017-12-13 16:05:42 +0100355 "../rtc_base:checks",
ehmaldonadof6a861a2017-07-19 10:40:47 -0700356 "../rtc_base:rtc_base",
357 "../rtc_base:rtc_base_approved",
358 "../rtc_base:rtc_base_tests_utils",
mbonadei7d9a55b2017-06-01 13:01:48 -0700359 "../test:test_support",
deadbeefe814a0d2017-02-25 18:15:09 -0800360 "//testing/gmock",
361 ]
362
363 if (!build_with_chromium && is_clang) {
364 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
365 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
366 }
367 }
368
ossu7bb87ee2017-01-23 04:56:25 -0800369 config("peerconnection_unittests_config") {
370 # The warnings below are enabled by default. Since GN orders compiler flags
371 # for a target before flags from configs, the only way to disable such
372 # warnings is by having them in a separate config, loaded from the target.
373 # TODO(kjellander): Make the code compile without disabling these flags.
374 # See https://bugs.webrtc.org/3307.
375 if (is_clang && is_win) {
376 cflags = [
377 # See https://bugs.chromium.org/p/webrtc/issues/detail?id=6267
378 # for -Wno-sign-compare
379 "-Wno-sign-compare",
ossu7bb87ee2017-01-23 04:56:25 -0800380 ]
381 }
382
383 if (!is_win) {
384 cflags = [ "-Wno-sign-compare" ]
385 }
386 }
387
388 rtc_test("peerconnection_unittests") {
ossu7bb87ee2017-01-23 04:56:25 -0800389 testonly = true
390 sources = [
391 "datachannel_unittest.cc",
392 "dtmfsender_unittest.cc",
deadbeef1dcb1642017-03-29 21:08:16 -0700393 "iceserverparsing_unittest.cc",
ossu7bb87ee2017-01-23 04:56:25 -0800394 "jsepsessiondescription_unittest.cc",
395 "localaudiosource_unittest.cc",
396 "mediaconstraintsinterface_unittest.cc",
397 "mediastream_unittest.cc",
Steve Anton6f25b092017-10-23 09:39:20 -0700398 "peerconnection_bundle_unittest.cc",
Steve Anton6b63cd52017-10-06 11:20:31 -0700399 "peerconnection_crypto_unittest.cc",
Steve Antonda6c0952017-10-23 11:41:54 -0700400 "peerconnection_datachannel_unittest.cc",
Steve Antonf1c6db12017-10-13 11:13:35 -0700401 "peerconnection_ice_unittest.cc",
deadbeef1dcb1642017-03-29 21:08:16 -0700402 "peerconnection_integrationtest.cc",
Steve Antondcc3c022017-12-22 16:02:54 -0800403 "peerconnection_jsep_unittest.cc",
Steve Anton8d3444d2017-10-20 15:30:51 -0700404 "peerconnection_media_unittest.cc",
Henrik Boström933d8b02017-10-10 10:05:16 -0700405 "peerconnection_rtp_unittest.cc",
Steve Anton8d3444d2017-10-20 15:30:51 -0700406 "peerconnection_signaling_unittest.cc",
ossu7bb87ee2017-01-23 04:56:25 -0800407 "peerconnectionendtoend_unittest.cc",
408 "peerconnectionfactory_unittest.cc",
409 "peerconnectioninterface_unittest.cc",
Steve Anton94286cb2017-09-26 16:20:19 -0700410 "peerconnectionwrapper.cc",
411 "peerconnectionwrapper.h",
ossu7bb87ee2017-01-23 04:56:25 -0800412 "proxy_unittest.cc",
413 "rtcstats_integrationtest.cc",
414 "rtcstatscollector_unittest.cc",
Steve Anton1d03a752017-11-27 14:30:09 -0800415 "rtpmediautils_unittest.cc",
ossu7bb87ee2017-01-23 04:56:25 -0800416 "rtpsenderreceiver_unittest.cc",
417 "sctputils_unittest.cc",
418 "statscollector_unittest.cc",
ossu7bb87ee2017-01-23 04:56:25 -0800419 "test/fakeaudiocapturemodule_unittest.cc",
ossu7bb87ee2017-01-23 04:56:25 -0800420 "test/testsdpstrings.h",
deadbeef804c1af2017-02-11 19:07:31 -0800421 "trackmediainfomap_unittest.cc",
ossu7bb87ee2017-01-23 04:56:25 -0800422 "videocapturertracksource_unittest.cc",
423 "videotrack_unittest.cc",
424 "webrtcsdp_unittest.cc",
ossu7bb87ee2017-01-23 04:56:25 -0800425 ]
426
427 if (rtc_enable_sctp) {
428 defines = [ "HAVE_SCTP" ]
429 }
430
431 configs += [ ":peerconnection_unittests_config" ]
432
433 if (!build_with_chromium && is_clang) {
434 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
435 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
436 }
437
438 # TODO(jschuh): Bug 1348: fix this warning.
439 configs += [ "//build/config/compiler:no_size_t_to_int_warning" ]
440
441 if (is_win) {
442 cflags = [
443 "/wd4245", # conversion from int to size_t, signed/unsigned mismatch.
444 "/wd4389", # signed/unsigned mismatch.
445 ]
446 }
447
Mirko Bonadeie51f7852017-12-06 11:23:19 +0100448 deps = [
449 ":peerconnection",
450 ":rtc_pc_base",
Patrik Höglund4b9e6ba2017-12-19 10:32:11 +0100451 "../api:mock_rtp",
Patrik Höglunda8005cf2017-12-13 16:05:42 +0100452 "../rtc_base:checks",
Patrik Höglund3e113432017-12-15 14:40:10 +0100453 "../rtc_base:stringutils",
Mirko Bonadeie51f7852017-12-06 11:23:19 +0100454 ]
ossu7bb87ee2017-01-23 04:56:25 -0800455 if (is_android) {
Patrik Höglund563934e2017-09-15 09:04:28 +0200456 deps += [ ":android_black_magic" ]
ossu7bb87ee2017-01-23 04:56:25 -0800457 }
458
459 deps += [
460 ":libjingle_peerconnection",
deadbeefe814a0d2017-02-25 18:15:09 -0800461 ":pc_test_utils",
ossu7bb87ee2017-01-23 04:56:25 -0800462 "..:webrtc_common",
463 "../api:fakemetricsobserver",
Patrik Höglund563934e2017-09-15 09:04:28 +0200464 "../api:libjingle_peerconnection_test_api",
Henrik Boström31638672017-11-23 17:48:32 +0100465 "../api:optional",
Patrik Höglund563934e2017-09-15 09:04:28 +0200466 "../api:rtc_stats_api",
Karl Wibergc5bb00b2017-10-10 23:17:17 +0200467 "../api/audio_codecs:audio_codecs_api",
Patrik Höglund563934e2017-09-15 09:04:28 +0200468 "../api/audio_codecs:builtin_audio_decoder_factory",
469 "../api/audio_codecs:builtin_audio_encoder_factory",
Karl Wibergc5bb00b2017-10-10 23:17:17 +0200470 "../api/audio_codecs/L16:audio_decoder_L16",
471 "../api/audio_codecs/L16:audio_encoder_L16",
Steve Anton8d3444d2017-10-20 15:30:51 -0700472 "../call:call_interfaces",
Elad Alon99c3fe52017-10-13 16:29:40 +0200473 "../logging:rtc_event_log_api",
Steve Anton8d3444d2017-10-20 15:30:51 -0700474 "../logging:rtc_event_log_impl",
Patrik Höglund563934e2017-09-15 09:04:28 +0200475 "../media:rtc_audio_video",
476 "../media:rtc_data", # TODO(phoglund): AFAIK only used for one sctp constant.
477 "../media:rtc_media_base",
mbonadei9087d492017-04-25 00:35:35 -0700478 "../media:rtc_media_tests_utils",
Patrik Höglund563934e2017-09-15 09:04:28 +0200479 "../modules/audio_processing:audio_processing",
480 "../modules/utility:utility",
481 "../p2p:p2p_test_utils",
482 "../p2p:rtc_p2p",
ossu7bb87ee2017-01-23 04:56:25 -0800483 "../pc:rtc_pc",
Henrik Boström933d8b02017-10-10 10:05:16 -0700484 "../rtc_base:rtc_base",
Patrik Höglund563934e2017-09-15 09:04:28 +0200485 "../rtc_base:rtc_base_approved",
ehmaldonadof6a861a2017-07-19 10:40:47 -0700486 "../rtc_base:rtc_base_tests_main",
487 "../rtc_base:rtc_base_tests_utils",
ossu7bb87ee2017-01-23 04:56:25 -0800488 "../system_wrappers:metrics_default",
kwiberg2b3aa142017-06-14 03:31:17 -0700489 "../test:audio_codec_mocks",
Patrik Höglund563934e2017-09-15 09:04:28 +0200490 "../test:test_support",
ossu7bb87ee2017-01-23 04:56:25 -0800491 ]
492
493 if (is_android) {
Patrik Höglund563934e2017-09-15 09:04:28 +0200494 deps += [
495 "//testing/android/native_test:native_test_support",
496
497 # We need to depend on this one directly, or classloads will fail for
498 # the voice engine BuildInfo, for instance.
499 "../sdk/android:libjingle_peerconnection_java",
500 ]
ossu7bb87ee2017-01-23 04:56:25 -0800501
502 shard_timeout = 900
503 }
504 }
Patrik Höglund563934e2017-09-15 09:04:28 +0200505
506 if (is_android) {
507 rtc_source_set("android_black_magic") {
508 # The android code uses hacky includes to chromium-base and the ssl code;
509 # having this in a separate target enables us to keep the peerconnection
510 # unit tests clean.
511 check_includes = false
512 testonly = true
513 sources = [
514 "test/androidtestinitializer.cc",
515 "test/androidtestinitializer.h",
516 ]
517 deps = [
518 "../sdk/android:libjingle_peerconnection_jni",
519 "//testing/android/native_test:native_test_support",
520 ]
521 }
522 }
kjellander142f8c52016-06-13 00:08:24 -0700523}