blob: 149fd51e0b4b7c400e497c09f7a9a009ff9e3aa1 [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",
78 "peerconnection.cc",
79 "peerconnection.h",
80 "peerconnectionfactory.cc",
81 "peerconnectionfactory.h",
82 "peerconnectionfactoryproxy.h",
83 "peerconnectioninterface.h",
84 "peerconnectionproxy.h",
85 "proxy.h",
86 "remoteaudiosource.cc",
87 "remoteaudiosource.h",
hbos74e1a4f2016-09-15 23:33:01 -070088 "rtcstatscollector.cc",
89 "rtcstatscollector.h",
kjellanderc76dc952016-06-03 03:09:32 -070090 "rtpparameters.h",
91 "rtpreceiver.cc",
92 "rtpreceiver.h",
93 "rtpreceiverinterface.h",
94 "rtpsender.cc",
95 "rtpsender.h",
96 "rtpsenderinterface.h",
97 "sctputils.cc",
98 "sctputils.h",
99 "statscollector.cc",
100 "statscollector.h",
101 "statstypes.cc",
102 "statstypes.h",
103 "streamcollection.h",
hbos1f8239c2017-01-16 04:24:10 -0800104 "trackmediainfomap.cc",
105 "trackmediainfomap.h",
kjellanderc76dc952016-06-03 03:09:32 -0700106 "videocapturertracksource.cc",
107 "videocapturertracksource.h",
108 "videosourceproxy.h",
109 "videotrack.cc",
110 "videotrack.h",
111 "videotracksource.cc",
112 "videotracksource.h",
113 "webrtcsdp.cc",
114 "webrtcsdp.h",
115 "webrtcsession.cc",
116 "webrtcsession.h",
117 "webrtcsessiondescriptionfactory.cc",
118 "webrtcsessiondescriptionfactory.h",
119 ]
120
ehmaldonado7a2ce0b2016-09-05 01:35:44 -0700121 configs += [ ":libjingle_peerconnection_warnings_config" ]
kjellanderc76dc952016-06-03 03:09:32 -0700122
kjellandere40a7ee2016-10-16 23:56:12 -0700123 if (!build_with_chromium && is_clang) {
kjellanderfd5b4e92016-06-13 12:08:33 -0700124 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
ehmaldonado38a21322016-09-02 04:10:34 -0700125 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
kjellanderc76dc952016-06-03 03:09:32 -0700126 }
127
kjellanderc76dc952016-06-03 03:09:32 -0700128 deps = [
kjellandera69d9732016-08-31 07:33:05 -0700129 ":call_api",
hbos74e1a4f2016-09-15 23:33:01 -0700130 ":rtc_stats_api",
katrielc14897d02016-06-03 13:14:28 -0700131 "../call",
kjellanderc76dc952016-06-03 03:09:32 -0700132 "../media",
133 "../pc",
hbos74e1a4f2016-09-15 23:33:01 -0700134 "../stats",
kjellanderc76dc952016-06-03 03:09:32 -0700135 ]
136
137 if (rtc_use_quic) {
138 sources += [
139 "quicdatachannel.cc",
140 "quicdatachannel.h",
141 "quicdatatransport.cc",
142 "quicdatatransport.h",
143 ]
144 deps += [ "//third_party/libquic" ]
145 public_deps = [
146 "//third_party/libquic",
147 ]
148 }
149}
kjellanderfd5b4e92016-06-13 12:08:33 -0700150
hbos74e1a4f2016-09-15 23:33:01 -0700151rtc_source_set("rtc_stats_api") {
152 cflags = []
153 sources = [
154 "stats/rtcstats.h",
155 "stats/rtcstats_objects.h",
156 "stats/rtcstatsreport.h",
157 ]
158
159 deps = [
160 "../base:rtc_base_approved",
161 ]
162}
163
aleloi201dfe92016-10-20 05:06:39 -0700164rtc_source_set("audio_mixer_api") {
165 sources = [
166 "audio/audio_mixer.h",
167 ]
168
169 deps = [
170 "../base:rtc_base_approved",
171 ]
172}
173
aleloia8eb7562016-11-28 07:02:13 -0800174rtc_source_set("transport_api") {
175 sources = [
176 "call/transport.h",
177 ]
178}
nisseb2250e52016-12-02 04:01:14 -0800179
180rtc_source_set("video_frame_api") {
181 sources = [
nisseaf916892017-01-10 07:44:26 -0800182 "video/i420_buffer.cc",
183 "video/i420_buffer.h",
184 "video/video_frame.cc",
185 "video/video_frame.h",
186 "video/video_frame_buffer.h",
nisseb2250e52016-12-02 04:01:14 -0800187 "video/video_rotation.h",
188 ]
189
190 deps = [
191 "../base:rtc_base_approved",
nisseaf916892017-01-10 07:44:26 -0800192 "../system_wrappers",
nisseb2250e52016-12-02 04:01:14 -0800193 ]
194
195 # TODO(nisse): This logic is duplicated in multiple places.
196 # Define in a single place.
197 if (rtc_build_libyuv) {
198 deps += [ "$rtc_libyuv_dir" ]
199 public_deps = [
200 "$rtc_libyuv_dir",
201 ]
202 } else {
203 # Need to add a directory normally exported by libyuv.
204 include_dirs = [ "$rtc_libyuv_dir/include" ]
205 }
206}
207
kjellanderfd5b4e92016-06-13 12:08:33 -0700208if (rtc_include_tests) {
209 config("peerconnection_unittests_config") {
210 # The warnings below are enabled by default. Since GN orders compiler flags
211 # for a target before flags from configs, the only way to disable such
212 # warnings is by having them in a separate config, loaded from the target.
213 # TODO(kjellander): Make the code compile without disabling these flags.
214 # See https://bugs.webrtc.org/3307.
215 if (is_clang && is_win) {
ehmaldonadod02fe4b2016-08-26 13:31:24 -0700216 cflags = [
217 # See https://bugs.chromium.org/p/webrtc/issues/detail?id=6267
218 # for -Wno-sign-compare
219 "-Wno-sign-compare",
220 "-Wno-unused-function",
221 ]
kjellanderfd5b4e92016-06-13 12:08:33 -0700222 }
223
224 if (!is_win) {
225 cflags = [ "-Wno-sign-compare" ]
kjellanderfd5b4e92016-06-13 12:08:33 -0700226 }
227 }
228
ehmaldonado38a21322016-09-02 04:10:34 -0700229 rtc_test("peerconnection_unittests") {
kjellander676e08f2016-12-07 08:23:27 -0800230 check_includes = false # TODO(kjellander): Remove (bugs.webrtc.org/6828)
kjellanderfd5b4e92016-06-13 12:08:33 -0700231 testonly = true
232 sources = [
233 "datachannel_unittest.cc",
234 "dtmfsender_unittest.cc",
kjellanderfd5b4e92016-06-13 12:08:33 -0700235 "jsepsessiondescription_unittest.cc",
236 "localaudiosource_unittest.cc",
237 "mediaconstraintsinterface_unittest.cc",
238 "mediastream_unittest.cc",
239 "peerconnection_unittest.cc",
240 "peerconnectionendtoend_unittest.cc",
241 "peerconnectionfactory_unittest.cc",
242 "peerconnectioninterface_unittest.cc",
243 "proxy_unittest.cc",
hbosdb346a72016-11-29 01:57:01 -0800244 "rtcstats_integrationtest.cc",
hbos74e1a4f2016-09-15 23:33:01 -0700245 "rtcstatscollector_unittest.cc",
kjellanderfd5b4e92016-06-13 12:08:33 -0700246 "rtpsenderreceiver_unittest.cc",
ossud4d2f602016-11-08 02:05:32 -0800247 "sctputils_unittest.cc",
kjellanderfd5b4e92016-06-13 12:08:33 -0700248 "statscollector_unittest.cc",
249 "test/fakeaudiocapturemodule.cc",
250 "test/fakeaudiocapturemodule.h",
251 "test/fakeaudiocapturemodule_unittest.cc",
252 "test/fakeconstraints.h",
253 "test/fakedatachannelprovider.h",
254 "test/fakeperiodicvideocapturer.h",
255 "test/fakertccertificategenerator.h",
256 "test/fakevideotrackrenderer.h",
hbosd565b732016-08-30 14:04:35 -0700257 "test/mock_datachannel.h",
hbosb24b1ce2016-08-16 01:19:43 -0700258 "test/mock_peerconnection.h",
hbos1f8239c2017-01-16 04:24:10 -0800259 "test/mock_rtpreceiver.h",
260 "test/mock_rtpsender.h",
hbosb24b1ce2016-08-16 01:19:43 -0700261 "test/mock_webrtcsession.h",
kjellanderfd5b4e92016-06-13 12:08:33 -0700262 "test/mockpeerconnectionobservers.h",
263 "test/peerconnectiontestwrapper.cc",
264 "test/peerconnectiontestwrapper.h",
hbosdb346a72016-11-29 01:57:01 -0800265 "test/rtcstatsobtainer.h",
kjellanderfd5b4e92016-06-13 12:08:33 -0700266 "test/testsdpstrings.h",
hbos1f8239c2017-01-16 04:24:10 -0800267 "trackmediainfomap_unittest.cc",
kjellanderfd5b4e92016-06-13 12:08:33 -0700268 "videocapturertracksource_unittest.cc",
269 "videotrack_unittest.cc",
270 "webrtcsdp_unittest.cc",
271 "webrtcsession_unittest.cc",
272 ]
273
deadbeef40610e22016-12-22 10:53:38 -0800274 if (rtc_enable_sctp) {
275 defines = [ "HAVE_SCTP" ]
276 }
kjellanderfd5b4e92016-06-13 12:08:33 -0700277
ehmaldonado7a2ce0b2016-09-05 01:35:44 -0700278 configs += [ ":peerconnection_unittests_config" ]
kjellanderfd5b4e92016-06-13 12:08:33 -0700279
kjellandere40a7ee2016-10-16 23:56:12 -0700280 if (!build_with_chromium && is_clang) {
kjellanderfd5b4e92016-06-13 12:08:33 -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" ]
kjellanderfd5b4e92016-06-13 12:08:33 -0700283 }
284
285 # TODO(jschuh): Bug 1348: fix this warning.
286 configs += [ "//build/config/compiler:no_size_t_to_int_warning" ]
287
288 if (is_win) {
289 cflags = [
290 "/wd4245", # conversion from int to size_t, signed/unsigned mismatch.
291 "/wd4389", # signed/unsigned mismatch.
292 ]
293 }
294
295 if (rtc_use_quic) {
296 public_deps = [
297 "//third_party/libquic",
298 ]
299 sources += [
300 "quicdatachannel_unittest.cc",
301 "quicdatatransport_unittest.cc",
302 ]
303 }
304
305 deps = []
306 if (is_android) {
307 sources += [
308 "test/androidtestinitializer.cc",
309 "test/androidtestinitializer.h",
310 ]
311 deps += [
kjellanderfd5b4e92016-06-13 12:08:33 -0700312 "//testing/android/native_test:native_test_support",
magjed768c6482016-12-06 04:29:37 -0800313 "//webrtc/sdk/android:libjingle_peerconnection_java",
314 "//webrtc/sdk/android:libjingle_peerconnection_jni",
kjellanderfd5b4e92016-06-13 12:08:33 -0700315 ]
316 }
317
318 deps += [
ehmaldonadoda8dcfb2017-01-04 07:11:23 -0800319 ":fakemetricsobserver",
kjellanderfd5b4e92016-06-13 12:08:33 -0700320 ":libjingle_peerconnection",
321 "..:webrtc_common",
322 "../base:rtc_base_tests_utils",
323 "../media:rtc_unittest_main",
324 "../pc:rtc_pc",
325 "../system_wrappers:metrics_default",
326 "//testing/gmock",
327 ]
328
329 if (is_android) {
330 deps += [ "//testing/android/native_test:native_test_support" ]
sakal714dd4e2016-08-15 02:29:11 -0700331
332 shard_timeout = 900
kjellanderfd5b4e92016-06-13 12:08:33 -0700333 }
334 }
ehmaldonado3651d8f2016-08-10 03:10:48 -0700335
aleloi17338d42016-11-22 06:02:06 -0800336 rtc_source_set("mock_audio_mixer") {
337 testonly = true
338 sources = [
339 "test/mock_audio_mixer.h",
340 ]
341
342 public_deps = [
343 ":audio_mixer_api",
344 ]
345
346 deps = [
347 "//testing/gmock",
kjellander676e08f2016-12-07 08:23:27 -0800348 "//webrtc/test:test_support",
aleloi17338d42016-11-22 06:02:06 -0800349 ]
350 }
ehmaldonadoda8dcfb2017-01-04 07:11:23 -0800351
352 rtc_source_set("fakemetricsobserver") {
353 testonly = true
354 sources = [
355 "fakemetricsobserver.cc",
356 "fakemetricsobserver.h",
357 ]
358 deps = [
359 ":libjingle_peerconnection",
360 "../base:rtc_base_approved",
361 ]
362 if (!build_with_chromium && is_clang) {
363 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
364 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
365 }
366 }
kjellanderfd5b4e92016-06-13 12:08:33 -0700367}