blob: 7c5e302d65bffbaae88c7f89e9744ccb9eded22a [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",
104 "videocapturertracksource.cc",
105 "videocapturertracksource.h",
106 "videosourceproxy.h",
107 "videotrack.cc",
108 "videotrack.h",
109 "videotracksource.cc",
110 "videotracksource.h",
111 "webrtcsdp.cc",
112 "webrtcsdp.h",
113 "webrtcsession.cc",
114 "webrtcsession.h",
115 "webrtcsessiondescriptionfactory.cc",
116 "webrtcsessiondescriptionfactory.h",
117 ]
118
ehmaldonado7a2ce0b2016-09-05 01:35:44 -0700119 configs += [ ":libjingle_peerconnection_warnings_config" ]
kjellanderc76dc952016-06-03 03:09:32 -0700120
kjellandere40a7ee2016-10-16 23:56:12 -0700121 if (!build_with_chromium && is_clang) {
kjellanderfd5b4e92016-06-13 12:08:33 -0700122 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
ehmaldonado38a21322016-09-02 04:10:34 -0700123 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
kjellanderc76dc952016-06-03 03:09:32 -0700124 }
125
kjellanderc76dc952016-06-03 03:09:32 -0700126 deps = [
kjellandera69d9732016-08-31 07:33:05 -0700127 ":call_api",
hbos74e1a4f2016-09-15 23:33:01 -0700128 ":rtc_stats_api",
katrielc14897d02016-06-03 13:14:28 -0700129 "../call",
kjellanderc76dc952016-06-03 03:09:32 -0700130 "../media",
131 "../pc",
hbos74e1a4f2016-09-15 23:33:01 -0700132 "../stats",
kjellanderc76dc952016-06-03 03:09:32 -0700133 ]
134
135 if (rtc_use_quic) {
136 sources += [
137 "quicdatachannel.cc",
138 "quicdatachannel.h",
139 "quicdatatransport.cc",
140 "quicdatatransport.h",
141 ]
142 deps += [ "//third_party/libquic" ]
143 public_deps = [
144 "//third_party/libquic",
145 ]
146 }
147}
kjellanderfd5b4e92016-06-13 12:08:33 -0700148
hbos74e1a4f2016-09-15 23:33:01 -0700149rtc_source_set("rtc_stats_api") {
150 cflags = []
151 sources = [
152 "stats/rtcstats.h",
153 "stats/rtcstats_objects.h",
154 "stats/rtcstatsreport.h",
155 ]
156
157 deps = [
158 "../base:rtc_base_approved",
159 ]
160}
161
aleloi201dfe92016-10-20 05:06:39 -0700162rtc_source_set("audio_mixer_api") {
163 sources = [
164 "audio/audio_mixer.h",
165 ]
166
167 deps = [
168 "../base:rtc_base_approved",
169 ]
170}
171
aleloia8eb7562016-11-28 07:02:13 -0800172rtc_source_set("transport_api") {
173 sources = [
174 "call/transport.h",
175 ]
176}
nisseb2250e52016-12-02 04:01:14 -0800177
178rtc_source_set("video_frame_api") {
179 sources = [
nisseaf916892017-01-10 07:44:26 -0800180 "video/i420_buffer.cc",
181 "video/i420_buffer.h",
182 "video/video_frame.cc",
183 "video/video_frame.h",
184 "video/video_frame_buffer.h",
nisseb2250e52016-12-02 04:01:14 -0800185 "video/video_rotation.h",
186 ]
187
188 deps = [
189 "../base:rtc_base_approved",
nisseaf916892017-01-10 07:44:26 -0800190 "../system_wrappers",
nisseb2250e52016-12-02 04:01:14 -0800191 ]
192
193 # TODO(nisse): This logic is duplicated in multiple places.
194 # Define in a single place.
195 if (rtc_build_libyuv) {
196 deps += [ "$rtc_libyuv_dir" ]
197 public_deps = [
198 "$rtc_libyuv_dir",
199 ]
200 } else {
201 # Need to add a directory normally exported by libyuv.
202 include_dirs = [ "$rtc_libyuv_dir/include" ]
203 }
204}
205
kjellanderfd5b4e92016-06-13 12:08:33 -0700206if (rtc_include_tests) {
207 config("peerconnection_unittests_config") {
208 # The warnings below are enabled by default. Since GN orders compiler flags
209 # for a target before flags from configs, the only way to disable such
210 # warnings is by having them in a separate config, loaded from the target.
211 # TODO(kjellander): Make the code compile without disabling these flags.
212 # See https://bugs.webrtc.org/3307.
213 if (is_clang && is_win) {
ehmaldonadod02fe4b2016-08-26 13:31:24 -0700214 cflags = [
215 # See https://bugs.chromium.org/p/webrtc/issues/detail?id=6267
216 # for -Wno-sign-compare
217 "-Wno-sign-compare",
218 "-Wno-unused-function",
219 ]
kjellanderfd5b4e92016-06-13 12:08:33 -0700220 }
221
222 if (!is_win) {
223 cflags = [ "-Wno-sign-compare" ]
kjellanderfd5b4e92016-06-13 12:08:33 -0700224 }
225 }
226
ehmaldonado38a21322016-09-02 04:10:34 -0700227 rtc_test("peerconnection_unittests") {
kjellander676e08f2016-12-07 08:23:27 -0800228 check_includes = false # TODO(kjellander): Remove (bugs.webrtc.org/6828)
kjellanderfd5b4e92016-06-13 12:08:33 -0700229 testonly = true
230 sources = [
231 "datachannel_unittest.cc",
232 "dtmfsender_unittest.cc",
kjellanderfd5b4e92016-06-13 12:08:33 -0700233 "jsepsessiondescription_unittest.cc",
234 "localaudiosource_unittest.cc",
235 "mediaconstraintsinterface_unittest.cc",
236 "mediastream_unittest.cc",
237 "peerconnection_unittest.cc",
238 "peerconnectionendtoend_unittest.cc",
239 "peerconnectionfactory_unittest.cc",
240 "peerconnectioninterface_unittest.cc",
241 "proxy_unittest.cc",
hbosdb346a72016-11-29 01:57:01 -0800242 "rtcstats_integrationtest.cc",
hbos74e1a4f2016-09-15 23:33:01 -0700243 "rtcstatscollector_unittest.cc",
kjellanderfd5b4e92016-06-13 12:08:33 -0700244 "rtpsenderreceiver_unittest.cc",
ossud4d2f602016-11-08 02:05:32 -0800245 "sctputils_unittest.cc",
kjellanderfd5b4e92016-06-13 12:08:33 -0700246 "statscollector_unittest.cc",
247 "test/fakeaudiocapturemodule.cc",
248 "test/fakeaudiocapturemodule.h",
249 "test/fakeaudiocapturemodule_unittest.cc",
250 "test/fakeconstraints.h",
251 "test/fakedatachannelprovider.h",
252 "test/fakeperiodicvideocapturer.h",
253 "test/fakertccertificategenerator.h",
254 "test/fakevideotrackrenderer.h",
hbosd565b732016-08-30 14:04:35 -0700255 "test/mock_datachannel.h",
hbosb24b1ce2016-08-16 01:19:43 -0700256 "test/mock_peerconnection.h",
257 "test/mock_webrtcsession.h",
kjellanderfd5b4e92016-06-13 12:08:33 -0700258 "test/mockpeerconnectionobservers.h",
259 "test/peerconnectiontestwrapper.cc",
260 "test/peerconnectiontestwrapper.h",
hbosdb346a72016-11-29 01:57:01 -0800261 "test/rtcstatsobtainer.h",
kjellanderfd5b4e92016-06-13 12:08:33 -0700262 "test/testsdpstrings.h",
263 "videocapturertracksource_unittest.cc",
264 "videotrack_unittest.cc",
265 "webrtcsdp_unittest.cc",
266 "webrtcsession_unittest.cc",
267 ]
268
deadbeef40610e22016-12-22 10:53:38 -0800269 if (rtc_enable_sctp) {
270 defines = [ "HAVE_SCTP" ]
271 }
kjellanderfd5b4e92016-06-13 12:08:33 -0700272
ehmaldonado7a2ce0b2016-09-05 01:35:44 -0700273 configs += [ ":peerconnection_unittests_config" ]
kjellanderfd5b4e92016-06-13 12:08:33 -0700274
kjellandere40a7ee2016-10-16 23:56:12 -0700275 if (!build_with_chromium && is_clang) {
kjellanderfd5b4e92016-06-13 12:08:33 -0700276 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
ehmaldonado38a21322016-09-02 04:10:34 -0700277 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
kjellanderfd5b4e92016-06-13 12:08:33 -0700278 }
279
280 # TODO(jschuh): Bug 1348: fix this warning.
281 configs += [ "//build/config/compiler:no_size_t_to_int_warning" ]
282
283 if (is_win) {
284 cflags = [
285 "/wd4245", # conversion from int to size_t, signed/unsigned mismatch.
286 "/wd4389", # signed/unsigned mismatch.
287 ]
288 }
289
290 if (rtc_use_quic) {
291 public_deps = [
292 "//third_party/libquic",
293 ]
294 sources += [
295 "quicdatachannel_unittest.cc",
296 "quicdatatransport_unittest.cc",
297 ]
298 }
299
300 deps = []
301 if (is_android) {
302 sources += [
303 "test/androidtestinitializer.cc",
304 "test/androidtestinitializer.h",
305 ]
306 deps += [
kjellanderfd5b4e92016-06-13 12:08:33 -0700307 "//testing/android/native_test:native_test_support",
magjed768c6482016-12-06 04:29:37 -0800308 "//webrtc/sdk/android:libjingle_peerconnection_java",
309 "//webrtc/sdk/android:libjingle_peerconnection_jni",
kjellanderfd5b4e92016-06-13 12:08:33 -0700310 ]
311 }
312
313 deps += [
ehmaldonadoda8dcfb2017-01-04 07:11:23 -0800314 ":fakemetricsobserver",
kjellanderfd5b4e92016-06-13 12:08:33 -0700315 ":libjingle_peerconnection",
316 "..:webrtc_common",
317 "../base:rtc_base_tests_utils",
318 "../media:rtc_unittest_main",
319 "../pc:rtc_pc",
320 "../system_wrappers:metrics_default",
321 "//testing/gmock",
322 ]
323
324 if (is_android) {
325 deps += [ "//testing/android/native_test:native_test_support" ]
sakal714dd4e2016-08-15 02:29:11 -0700326
327 shard_timeout = 900
kjellanderfd5b4e92016-06-13 12:08:33 -0700328 }
329 }
ehmaldonado3651d8f2016-08-10 03:10:48 -0700330
aleloi17338d42016-11-22 06:02:06 -0800331 rtc_source_set("mock_audio_mixer") {
332 testonly = true
333 sources = [
334 "test/mock_audio_mixer.h",
335 ]
336
337 public_deps = [
338 ":audio_mixer_api",
339 ]
340
341 deps = [
342 "//testing/gmock",
kjellander676e08f2016-12-07 08:23:27 -0800343 "//webrtc/test:test_support",
aleloi17338d42016-11-22 06:02:06 -0800344 ]
345 }
ehmaldonadoda8dcfb2017-01-04 07:11:23 -0800346
347 rtc_source_set("fakemetricsobserver") {
348 testonly = true
349 sources = [
350 "fakemetricsobserver.cc",
351 "fakemetricsobserver.h",
352 ]
353 deps = [
354 ":libjingle_peerconnection",
355 "../base:rtc_base_approved",
356 ]
357 if (!build_with_chromium && is_clang) {
358 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
359 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
360 }
361 }
kjellanderfd5b4e92016-06-13 12:08:33 -0700362}