blob: 45fcd915081a8c61c67e0bf35d52c6b4eeb33704 [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 = [
180 "video/video_rotation.h",
181 ]
182
183 deps = [
184 "../base:rtc_base_approved",
185 ]
186
187 # TODO(nisse): This logic is duplicated in multiple places.
188 # Define in a single place.
189 if (rtc_build_libyuv) {
190 deps += [ "$rtc_libyuv_dir" ]
191 public_deps = [
192 "$rtc_libyuv_dir",
193 ]
194 } else {
195 # Need to add a directory normally exported by libyuv.
196 include_dirs = [ "$rtc_libyuv_dir/include" ]
197 }
198}
199
kjellanderfd5b4e92016-06-13 12:08:33 -0700200if (rtc_include_tests) {
201 config("peerconnection_unittests_config") {
202 # The warnings below are enabled by default. Since GN orders compiler flags
203 # for a target before flags from configs, the only way to disable such
204 # warnings is by having them in a separate config, loaded from the target.
205 # TODO(kjellander): Make the code compile without disabling these flags.
206 # See https://bugs.webrtc.org/3307.
207 if (is_clang && is_win) {
ehmaldonadod02fe4b2016-08-26 13:31:24 -0700208 cflags = [
209 # See https://bugs.chromium.org/p/webrtc/issues/detail?id=6267
210 # for -Wno-sign-compare
211 "-Wno-sign-compare",
212 "-Wno-unused-function",
213 ]
kjellanderfd5b4e92016-06-13 12:08:33 -0700214 }
215
216 if (!is_win) {
217 cflags = [ "-Wno-sign-compare" ]
kjellanderfd5b4e92016-06-13 12:08:33 -0700218 }
219 }
220
ehmaldonado38a21322016-09-02 04:10:34 -0700221 rtc_test("peerconnection_unittests") {
kjellander676e08f2016-12-07 08:23:27 -0800222 check_includes = false # TODO(kjellander): Remove (bugs.webrtc.org/6828)
kjellanderfd5b4e92016-06-13 12:08:33 -0700223 testonly = true
224 sources = [
225 "datachannel_unittest.cc",
226 "dtmfsender_unittest.cc",
227 "fakemetricsobserver.cc",
228 "fakemetricsobserver.h",
229 "jsepsessiondescription_unittest.cc",
230 "localaudiosource_unittest.cc",
231 "mediaconstraintsinterface_unittest.cc",
232 "mediastream_unittest.cc",
233 "peerconnection_unittest.cc",
234 "peerconnectionendtoend_unittest.cc",
235 "peerconnectionfactory_unittest.cc",
236 "peerconnectioninterface_unittest.cc",
237 "proxy_unittest.cc",
hbosdb346a72016-11-29 01:57:01 -0800238 "rtcstats_integrationtest.cc",
hbos74e1a4f2016-09-15 23:33:01 -0700239 "rtcstatscollector_unittest.cc",
kjellanderfd5b4e92016-06-13 12:08:33 -0700240 "rtpsenderreceiver_unittest.cc",
ossud4d2f602016-11-08 02:05:32 -0800241 "sctputils_unittest.cc",
kjellanderfd5b4e92016-06-13 12:08:33 -0700242 "statscollector_unittest.cc",
243 "test/fakeaudiocapturemodule.cc",
244 "test/fakeaudiocapturemodule.h",
245 "test/fakeaudiocapturemodule_unittest.cc",
246 "test/fakeconstraints.h",
247 "test/fakedatachannelprovider.h",
248 "test/fakeperiodicvideocapturer.h",
249 "test/fakertccertificategenerator.h",
250 "test/fakevideotrackrenderer.h",
hbosd565b732016-08-30 14:04:35 -0700251 "test/mock_datachannel.h",
hbosb24b1ce2016-08-16 01:19:43 -0700252 "test/mock_peerconnection.h",
253 "test/mock_webrtcsession.h",
kjellanderfd5b4e92016-06-13 12:08:33 -0700254 "test/mockpeerconnectionobservers.h",
255 "test/peerconnectiontestwrapper.cc",
256 "test/peerconnectiontestwrapper.h",
hbosdb346a72016-11-29 01:57:01 -0800257 "test/rtcstatsobtainer.h",
kjellanderfd5b4e92016-06-13 12:08:33 -0700258 "test/testsdpstrings.h",
259 "videocapturertracksource_unittest.cc",
260 "videotrack_unittest.cc",
261 "webrtcsdp_unittest.cc",
262 "webrtcsession_unittest.cc",
263 ]
264
deadbeef40610e22016-12-22 10:53:38 -0800265 if (rtc_enable_sctp) {
266 defines = [ "HAVE_SCTP" ]
267 }
kjellanderfd5b4e92016-06-13 12:08:33 -0700268
ehmaldonado7a2ce0b2016-09-05 01:35:44 -0700269 configs += [ ":peerconnection_unittests_config" ]
kjellanderfd5b4e92016-06-13 12:08:33 -0700270
kjellandere40a7ee2016-10-16 23:56:12 -0700271 if (!build_with_chromium && is_clang) {
kjellanderfd5b4e92016-06-13 12:08:33 -0700272 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
ehmaldonado38a21322016-09-02 04:10:34 -0700273 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
kjellanderfd5b4e92016-06-13 12:08:33 -0700274 }
275
276 # TODO(jschuh): Bug 1348: fix this warning.
277 configs += [ "//build/config/compiler:no_size_t_to_int_warning" ]
278
279 if (is_win) {
280 cflags = [
281 "/wd4245", # conversion from int to size_t, signed/unsigned mismatch.
282 "/wd4389", # signed/unsigned mismatch.
283 ]
284 }
285
286 if (rtc_use_quic) {
287 public_deps = [
288 "//third_party/libquic",
289 ]
290 sources += [
291 "quicdatachannel_unittest.cc",
292 "quicdatatransport_unittest.cc",
293 ]
294 }
295
296 deps = []
297 if (is_android) {
298 sources += [
299 "test/androidtestinitializer.cc",
300 "test/androidtestinitializer.h",
301 ]
302 deps += [
kjellanderfd5b4e92016-06-13 12:08:33 -0700303 "//testing/android/native_test:native_test_support",
magjed768c6482016-12-06 04:29:37 -0800304 "//webrtc/sdk/android:libjingle_peerconnection_java",
305 "//webrtc/sdk/android:libjingle_peerconnection_jni",
kjellanderfd5b4e92016-06-13 12:08:33 -0700306 ]
307 }
308
309 deps += [
310 ":libjingle_peerconnection",
311 "..:webrtc_common",
312 "../base:rtc_base_tests_utils",
313 "../media:rtc_unittest_main",
314 "../pc:rtc_pc",
315 "../system_wrappers:metrics_default",
316 "//testing/gmock",
317 ]
318
319 if (is_android) {
320 deps += [ "//testing/android/native_test:native_test_support" ]
sakal714dd4e2016-08-15 02:29:11 -0700321
322 shard_timeout = 900
kjellanderfd5b4e92016-06-13 12:08:33 -0700323 }
324 }
ehmaldonado3651d8f2016-08-10 03:10:48 -0700325
aleloi17338d42016-11-22 06:02:06 -0800326 rtc_source_set("mock_audio_mixer") {
327 testonly = true
328 sources = [
329 "test/mock_audio_mixer.h",
330 ]
331
332 public_deps = [
333 ":audio_mixer_api",
334 ]
335
336 deps = [
337 "//testing/gmock",
kjellander676e08f2016-12-07 08:23:27 -0800338 "//webrtc/test:test_support",
aleloi17338d42016-11-22 06:02:06 -0800339 ]
340 }
kjellanderfd5b4e92016-06-13 12:08:33 -0700341}