blob: fa3c62952464d4cd815b29a7bcdd1d85ac1bf410 [file] [log] [blame]
hjonaa32c3e2015-12-13 19:58:11 -08001# Copyright (c) 2015 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
9import("../build/webrtc.gni")
Sami Kalliomaki9c0c75b2016-06-29 14:55:00 +020010if (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("api") {
kjellander705ecc52016-09-15 00:53:26 -070016 public_deps = [
kjellanderc76dc952016-06-03 03:09:32 -070017 ":libjingle_peerconnection",
18 ]
19}
20
ehmaldonado38a21322016-09-02 04:10:34 -070021rtc_source_set("call_api") {
kjellandera69d9732016-08-31 07:33:05 -070022 sources = [
kjellandera69d9732016-08-31 07:33:05 -070023 "call/audio_sink.h",
kjellandera69d9732016-08-31 07:33:05 -070024 ]
25
kjellandera69d9732016-08-31 07:33:05 -070026 deps = [
27 # TODO(kjellander): Add remaining dependencies when webrtc:4243 is done.
aleloi81da4882016-11-08 04:26:30 -080028 ":audio_mixer_api",
aleloia8eb7562016-11-28 07:02:13 -080029 ":transport_api",
kjellandera69d9732016-08-31 07:33:05 -070030 "..:webrtc_common",
31 "../base:rtc_base_approved",
kjellander676e08f2016-12-07 08:23:27 -080032 "../modules/audio_coding:audio_decoder_factory_interface",
kjellandera69d9732016-08-31 07:33:05 -070033 "../modules/audio_coding:audio_encoder_interface",
34 ]
35}
36
kjellanderc76dc952016-06-03 03:09:32 -070037config("libjingle_peerconnection_warnings_config") {
38 # GN orders flags on a target before flags from configs. The default config
39 # adds these flags so to cancel them out they need to come from a config and
40 # cannot be on the target directly.
kjellander3e33bfe2016-06-20 07:04:09 -070041 if (!is_win && !is_clang) {
42 cflags = [ "-Wno-maybe-uninitialized" ] # Only exists for GCC.
kjellanderc76dc952016-06-03 03:09:32 -070043 }
44}
45
kjellanderb62dbbe2016-09-23 00:38:52 -070046rtc_static_library("libjingle_peerconnection") {
kjellander676e08f2016-12-07 08:23:27 -080047 check_includes = false # TODO(kjellander): Remove (bugs.webrtc.org/6828)
kjellanderc76dc952016-06-03 03:09:32 -070048 cflags = []
49 sources = [
50 "audiotrack.cc",
51 "audiotrack.h",
52 "datachannel.cc",
53 "datachannel.h",
54 "datachannelinterface.h",
kjellanderc76dc952016-06-03 03:09:32 -070055 "dtmfsender.cc",
56 "dtmfsender.h",
57 "dtmfsenderinterface.h",
58 "jsep.h",
59 "jsepicecandidate.cc",
60 "jsepicecandidate.h",
61 "jsepsessiondescription.cc",
62 "jsepsessiondescription.h",
63 "localaudiosource.cc",
64 "localaudiosource.h",
65 "mediaconstraintsinterface.cc",
66 "mediaconstraintsinterface.h",
67 "mediacontroller.cc",
68 "mediacontroller.h",
69 "mediastream.cc",
70 "mediastream.h",
71 "mediastreaminterface.h",
72 "mediastreamobserver.cc",
73 "mediastreamobserver.h",
kjellanderc76dc952016-06-03 03:09:32 -070074 "mediastreamproxy.h",
75 "mediastreamtrack.h",
76 "mediastreamtrackproxy.h",
77 "notifier.h",
deadbeefd1c09982017-01-18 15:16:37 -080078 "ortcfactory.cc",
79 "ortcfactory.h",
80 "ortcfactoryinterface.h",
kjellanderc76dc952016-06-03 03:09:32 -070081 "peerconnection.cc",
82 "peerconnection.h",
83 "peerconnectionfactory.cc",
84 "peerconnectionfactory.h",
85 "peerconnectionfactoryproxy.h",
86 "peerconnectioninterface.h",
87 "peerconnectionproxy.h",
88 "proxy.h",
89 "remoteaudiosource.cc",
90 "remoteaudiosource.h",
hbos74e1a4f2016-09-15 23:33:01 -070091 "rtcstatscollector.cc",
92 "rtcstatscollector.h",
kjellanderc76dc952016-06-03 03:09:32 -070093 "rtpparameters.h",
94 "rtpreceiver.cc",
95 "rtpreceiver.h",
96 "rtpreceiverinterface.h",
97 "rtpsender.cc",
98 "rtpsender.h",
99 "rtpsenderinterface.h",
100 "sctputils.cc",
101 "sctputils.h",
102 "statscollector.cc",
103 "statscollector.h",
104 "statstypes.cc",
105 "statstypes.h",
106 "streamcollection.h",
hbos1f8239c2017-01-16 04:24:10 -0800107 "trackmediainfomap.cc",
108 "trackmediainfomap.h",
deadbeefd1c09982017-01-18 15:16:37 -0800109 "udptransportinterface.h",
kjellanderc76dc952016-06-03 03:09:32 -0700110 "videocapturertracksource.cc",
111 "videocapturertracksource.h",
112 "videosourceproxy.h",
113 "videotrack.cc",
114 "videotrack.h",
115 "videotracksource.cc",
116 "videotracksource.h",
117 "webrtcsdp.cc",
118 "webrtcsdp.h",
119 "webrtcsession.cc",
120 "webrtcsession.h",
121 "webrtcsessiondescriptionfactory.cc",
122 "webrtcsessiondescriptionfactory.h",
123 ]
124
ehmaldonado7a2ce0b2016-09-05 01:35:44 -0700125 configs += [ ":libjingle_peerconnection_warnings_config" ]
kjellanderc76dc952016-06-03 03:09:32 -0700126
kjellandere40a7ee2016-10-16 23:56:12 -0700127 if (!build_with_chromium && is_clang) {
kjellanderfd5b4e92016-06-13 12:08:33 -0700128 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
ehmaldonado38a21322016-09-02 04:10:34 -0700129 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
kjellanderc76dc952016-06-03 03:09:32 -0700130 }
131
kjellanderc76dc952016-06-03 03:09:32 -0700132 deps = [
kjellandera69d9732016-08-31 07:33:05 -0700133 ":call_api",
hbos74e1a4f2016-09-15 23:33:01 -0700134 ":rtc_stats_api",
katrielc14897d02016-06-03 13:14:28 -0700135 "../call",
kjellanderc76dc952016-06-03 03:09:32 -0700136 "../media",
137 "../pc",
hbos74e1a4f2016-09-15 23:33:01 -0700138 "../stats",
kjellanderc76dc952016-06-03 03:09:32 -0700139 ]
140
141 if (rtc_use_quic) {
142 sources += [
143 "quicdatachannel.cc",
144 "quicdatachannel.h",
145 "quicdatatransport.cc",
146 "quicdatatransport.h",
147 ]
148 deps += [ "//third_party/libquic" ]
149 public_deps = [
150 "//third_party/libquic",
151 ]
152 }
153}
kjellanderfd5b4e92016-06-13 12:08:33 -0700154
hbos74e1a4f2016-09-15 23:33:01 -0700155rtc_source_set("rtc_stats_api") {
156 cflags = []
157 sources = [
158 "stats/rtcstats.h",
159 "stats/rtcstats_objects.h",
160 "stats/rtcstatsreport.h",
161 ]
162
163 deps = [
164 "../base:rtc_base_approved",
165 ]
166}
167
aleloi201dfe92016-10-20 05:06:39 -0700168rtc_source_set("audio_mixer_api") {
169 sources = [
170 "audio/audio_mixer.h",
171 ]
172
173 deps = [
174 "../base:rtc_base_approved",
175 ]
176}
177
aleloia8eb7562016-11-28 07:02:13 -0800178rtc_source_set("transport_api") {
179 sources = [
180 "call/transport.h",
181 ]
182}
nisseb2250e52016-12-02 04:01:14 -0800183
184rtc_source_set("video_frame_api") {
185 sources = [
nisseaf916892017-01-10 07:44:26 -0800186 "video/i420_buffer.cc",
187 "video/i420_buffer.h",
188 "video/video_frame.cc",
189 "video/video_frame.h",
190 "video/video_frame_buffer.h",
nisseb2250e52016-12-02 04:01:14 -0800191 "video/video_rotation.h",
192 ]
193
194 deps = [
195 "../base:rtc_base_approved",
nisseaf916892017-01-10 07:44:26 -0800196 "../system_wrappers",
nisseb2250e52016-12-02 04:01:14 -0800197 ]
198
199 # TODO(nisse): This logic is duplicated in multiple places.
200 # Define in a single place.
201 if (rtc_build_libyuv) {
202 deps += [ "$rtc_libyuv_dir" ]
203 public_deps = [
204 "$rtc_libyuv_dir",
205 ]
206 } else {
207 # Need to add a directory normally exported by libyuv.
208 include_dirs = [ "$rtc_libyuv_dir/include" ]
209 }
210}
211
kjellanderfd5b4e92016-06-13 12:08:33 -0700212if (rtc_include_tests) {
213 config("peerconnection_unittests_config") {
214 # The warnings below are enabled by default. Since GN orders compiler flags
215 # for a target before flags from configs, the only way to disable such
216 # warnings is by having them in a separate config, loaded from the target.
217 # TODO(kjellander): Make the code compile without disabling these flags.
218 # See https://bugs.webrtc.org/3307.
219 if (is_clang && is_win) {
ehmaldonadod02fe4b2016-08-26 13:31:24 -0700220 cflags = [
221 # See https://bugs.chromium.org/p/webrtc/issues/detail?id=6267
222 # for -Wno-sign-compare
223 "-Wno-sign-compare",
224 "-Wno-unused-function",
225 ]
kjellanderfd5b4e92016-06-13 12:08:33 -0700226 }
227
228 if (!is_win) {
229 cflags = [ "-Wno-sign-compare" ]
kjellanderfd5b4e92016-06-13 12:08:33 -0700230 }
231 }
232
ehmaldonado38a21322016-09-02 04:10:34 -0700233 rtc_test("peerconnection_unittests") {
kjellander676e08f2016-12-07 08:23:27 -0800234 check_includes = false # TODO(kjellander): Remove (bugs.webrtc.org/6828)
kjellanderfd5b4e92016-06-13 12:08:33 -0700235 testonly = true
236 sources = [
237 "datachannel_unittest.cc",
238 "dtmfsender_unittest.cc",
kjellanderfd5b4e92016-06-13 12:08:33 -0700239 "jsepsessiondescription_unittest.cc",
240 "localaudiosource_unittest.cc",
241 "mediaconstraintsinterface_unittest.cc",
242 "mediastream_unittest.cc",
deadbeefd1c09982017-01-18 15:16:37 -0800243 "ortcfactory_unittest.cc",
kjellanderfd5b4e92016-06-13 12:08:33 -0700244 "peerconnection_unittest.cc",
245 "peerconnectionendtoend_unittest.cc",
246 "peerconnectionfactory_unittest.cc",
247 "peerconnectioninterface_unittest.cc",
248 "proxy_unittest.cc",
hbosdb346a72016-11-29 01:57:01 -0800249 "rtcstats_integrationtest.cc",
hbos74e1a4f2016-09-15 23:33:01 -0700250 "rtcstatscollector_unittest.cc",
kjellanderfd5b4e92016-06-13 12:08:33 -0700251 "rtpsenderreceiver_unittest.cc",
ossud4d2f602016-11-08 02:05:32 -0800252 "sctputils_unittest.cc",
kjellanderfd5b4e92016-06-13 12:08:33 -0700253 "statscollector_unittest.cc",
254 "test/fakeaudiocapturemodule.cc",
255 "test/fakeaudiocapturemodule.h",
256 "test/fakeaudiocapturemodule_unittest.cc",
257 "test/fakeconstraints.h",
258 "test/fakedatachannelprovider.h",
259 "test/fakeperiodicvideocapturer.h",
260 "test/fakertccertificategenerator.h",
261 "test/fakevideotrackrenderer.h",
hbosd565b732016-08-30 14:04:35 -0700262 "test/mock_datachannel.h",
hbosb24b1ce2016-08-16 01:19:43 -0700263 "test/mock_peerconnection.h",
hbos1f8239c2017-01-16 04:24:10 -0800264 "test/mock_rtpreceiver.h",
265 "test/mock_rtpsender.h",
hbosb24b1ce2016-08-16 01:19:43 -0700266 "test/mock_webrtcsession.h",
kjellanderfd5b4e92016-06-13 12:08:33 -0700267 "test/mockpeerconnectionobservers.h",
268 "test/peerconnectiontestwrapper.cc",
269 "test/peerconnectiontestwrapper.h",
hbosdb346a72016-11-29 01:57:01 -0800270 "test/rtcstatsobtainer.h",
kjellanderfd5b4e92016-06-13 12:08:33 -0700271 "test/testsdpstrings.h",
hbos1f8239c2017-01-16 04:24:10 -0800272 "trackmediainfomap_unittest.cc",
kjellanderfd5b4e92016-06-13 12:08:33 -0700273 "videocapturertracksource_unittest.cc",
274 "videotrack_unittest.cc",
275 "webrtcsdp_unittest.cc",
276 "webrtcsession_unittest.cc",
277 ]
278
deadbeef40610e22016-12-22 10:53:38 -0800279 if (rtc_enable_sctp) {
280 defines = [ "HAVE_SCTP" ]
281 }
kjellanderfd5b4e92016-06-13 12:08:33 -0700282
ehmaldonado7a2ce0b2016-09-05 01:35:44 -0700283 configs += [ ":peerconnection_unittests_config" ]
kjellanderfd5b4e92016-06-13 12:08:33 -0700284
kjellandere40a7ee2016-10-16 23:56:12 -0700285 if (!build_with_chromium && is_clang) {
kjellanderfd5b4e92016-06-13 12:08:33 -0700286 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
ehmaldonado38a21322016-09-02 04:10:34 -0700287 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
kjellanderfd5b4e92016-06-13 12:08:33 -0700288 }
289
290 # TODO(jschuh): Bug 1348: fix this warning.
291 configs += [ "//build/config/compiler:no_size_t_to_int_warning" ]
292
293 if (is_win) {
294 cflags = [
295 "/wd4245", # conversion from int to size_t, signed/unsigned mismatch.
296 "/wd4389", # signed/unsigned mismatch.
297 ]
298 }
299
300 if (rtc_use_quic) {
301 public_deps = [
302 "//third_party/libquic",
303 ]
304 sources += [
305 "quicdatachannel_unittest.cc",
306 "quicdatatransport_unittest.cc",
307 ]
308 }
309
310 deps = []
311 if (is_android) {
312 sources += [
313 "test/androidtestinitializer.cc",
314 "test/androidtestinitializer.h",
315 ]
316 deps += [
kjellanderfd5b4e92016-06-13 12:08:33 -0700317 "//testing/android/native_test:native_test_support",
magjed768c6482016-12-06 04:29:37 -0800318 "//webrtc/sdk/android:libjingle_peerconnection_java",
319 "//webrtc/sdk/android:libjingle_peerconnection_jni",
kjellanderfd5b4e92016-06-13 12:08:33 -0700320 ]
321 }
322
323 deps += [
ehmaldonadoda8dcfb2017-01-04 07:11:23 -0800324 ":fakemetricsobserver",
kjellanderfd5b4e92016-06-13 12:08:33 -0700325 ":libjingle_peerconnection",
326 "..:webrtc_common",
327 "../base:rtc_base_tests_utils",
328 "../media:rtc_unittest_main",
329 "../pc:rtc_pc",
330 "../system_wrappers:metrics_default",
331 "//testing/gmock",
332 ]
333
334 if (is_android) {
335 deps += [ "//testing/android/native_test:native_test_support" ]
sakal714dd4e2016-08-15 02:29:11 -0700336
337 shard_timeout = 900
kjellanderfd5b4e92016-06-13 12:08:33 -0700338 }
339 }
ehmaldonado3651d8f2016-08-10 03:10:48 -0700340
aleloi17338d42016-11-22 06:02:06 -0800341 rtc_source_set("mock_audio_mixer") {
342 testonly = true
343 sources = [
344 "test/mock_audio_mixer.h",
345 ]
346
347 public_deps = [
348 ":audio_mixer_api",
349 ]
350
351 deps = [
352 "//testing/gmock",
kjellander676e08f2016-12-07 08:23:27 -0800353 "//webrtc/test:test_support",
aleloi17338d42016-11-22 06:02:06 -0800354 ]
355 }
ehmaldonadoda8dcfb2017-01-04 07:11:23 -0800356
357 rtc_source_set("fakemetricsobserver") {
358 testonly = true
359 sources = [
360 "fakemetricsobserver.cc",
361 "fakemetricsobserver.h",
362 ]
363 deps = [
364 ":libjingle_peerconnection",
365 "../base:rtc_base_approved",
366 ]
367 if (!build_with_chromium && is_clang) {
368 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
369 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
370 }
371 }
kjellanderfd5b4e92016-06-13 12:08:33 -0700372}