blob: 20cf3fa2b6d4915bc9ca1f12c3b2271b345ffcc1 [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 = [
23 "call/audio_receive_stream.h",
solenberg940b6d62016-10-25 11:19:07 -070024 "call/audio_send_stream.cc",
kjellandera69d9732016-08-31 07:33:05 -070025 "call/audio_send_stream.h",
26 "call/audio_sink.h",
27 "call/audio_state.h",
brandtr76648da2016-10-20 04:54:48 -070028 "call/flexfec_receive_stream.h",
kjellandera69d9732016-08-31 07:33:05 -070029 ]
30
kjellandera69d9732016-08-31 07:33:05 -070031 deps = [
32 # TODO(kjellander): Add remaining dependencies when webrtc:4243 is done.
aleloi81da4882016-11-08 04:26:30 -080033 ":audio_mixer_api",
aleloia8eb7562016-11-28 07:02:13 -080034 ":transport_api",
kjellandera69d9732016-08-31 07:33:05 -070035 "..:webrtc_common",
36 "../base:rtc_base_approved",
37 "../modules/audio_coding:audio_encoder_interface",
38 ]
39}
40
kjellanderc76dc952016-06-03 03:09:32 -070041config("libjingle_peerconnection_warnings_config") {
42 # GN orders flags on a target before flags from configs. The default config
43 # adds these flags so to cancel them out they need to come from a config and
44 # cannot be on the target directly.
kjellander3e33bfe2016-06-20 07:04:09 -070045 if (!is_win && !is_clang) {
46 cflags = [ "-Wno-maybe-uninitialized" ] # Only exists for GCC.
kjellanderc76dc952016-06-03 03:09:32 -070047 }
48}
49
kjellanderb62dbbe2016-09-23 00:38:52 -070050rtc_static_library("libjingle_peerconnection") {
kjellanderc76dc952016-06-03 03:09:32 -070051 cflags = []
52 sources = [
53 "audiotrack.cc",
54 "audiotrack.h",
55 "datachannel.cc",
56 "datachannel.h",
57 "datachannelinterface.h",
kjellanderc76dc952016-06-03 03:09:32 -070058 "dtmfsender.cc",
59 "dtmfsender.h",
60 "dtmfsenderinterface.h",
61 "jsep.h",
62 "jsepicecandidate.cc",
63 "jsepicecandidate.h",
64 "jsepsessiondescription.cc",
65 "jsepsessiondescription.h",
66 "localaudiosource.cc",
67 "localaudiosource.h",
68 "mediaconstraintsinterface.cc",
69 "mediaconstraintsinterface.h",
70 "mediacontroller.cc",
71 "mediacontroller.h",
72 "mediastream.cc",
73 "mediastream.h",
74 "mediastreaminterface.h",
75 "mediastreamobserver.cc",
76 "mediastreamobserver.h",
kjellanderc76dc952016-06-03 03:09:32 -070077 "mediastreamproxy.h",
78 "mediastreamtrack.h",
79 "mediastreamtrackproxy.h",
80 "notifier.h",
81 "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",
107 "videocapturertracksource.cc",
108 "videocapturertracksource.h",
109 "videosourceproxy.h",
110 "videotrack.cc",
111 "videotrack.h",
112 "videotracksource.cc",
113 "videotracksource.h",
114 "webrtcsdp.cc",
115 "webrtcsdp.h",
116 "webrtcsession.cc",
117 "webrtcsession.h",
118 "webrtcsessiondescriptionfactory.cc",
119 "webrtcsessiondescriptionfactory.h",
120 ]
121
ehmaldonado7a2ce0b2016-09-05 01:35:44 -0700122 configs += [ ":libjingle_peerconnection_warnings_config" ]
kjellanderc76dc952016-06-03 03:09:32 -0700123
kjellandere40a7ee2016-10-16 23:56:12 -0700124 if (!build_with_chromium && is_clang) {
kjellanderfd5b4e92016-06-13 12:08:33 -0700125 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
ehmaldonado38a21322016-09-02 04:10:34 -0700126 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
kjellanderc76dc952016-06-03 03:09:32 -0700127 }
128
kjellanderc76dc952016-06-03 03:09:32 -0700129 deps = [
kjellandera69d9732016-08-31 07:33:05 -0700130 ":call_api",
hbos74e1a4f2016-09-15 23:33:01 -0700131 ":rtc_stats_api",
katrielc14897d02016-06-03 13:14:28 -0700132 "../call",
kjellanderc76dc952016-06-03 03:09:32 -0700133 "../media",
134 "../pc",
hbos74e1a4f2016-09-15 23:33:01 -0700135 "../stats",
kjellanderc76dc952016-06-03 03:09:32 -0700136 ]
137
138 if (rtc_use_quic) {
139 sources += [
140 "quicdatachannel.cc",
141 "quicdatachannel.h",
142 "quicdatatransport.cc",
143 "quicdatatransport.h",
144 ]
145 deps += [ "//third_party/libquic" ]
146 public_deps = [
147 "//third_party/libquic",
148 ]
149 }
150}
kjellanderfd5b4e92016-06-13 12:08:33 -0700151
hbos74e1a4f2016-09-15 23:33:01 -0700152rtc_source_set("rtc_stats_api") {
153 cflags = []
154 sources = [
155 "stats/rtcstats.h",
156 "stats/rtcstats_objects.h",
157 "stats/rtcstatsreport.h",
158 ]
159
160 deps = [
161 "../base:rtc_base_approved",
162 ]
163}
164
aleloi201dfe92016-10-20 05:06:39 -0700165rtc_source_set("audio_mixer_api") {
166 sources = [
167 "audio/audio_mixer.h",
168 ]
169
170 deps = [
171 "../base:rtc_base_approved",
172 ]
173}
174
aleloia8eb7562016-11-28 07:02:13 -0800175rtc_source_set("transport_api") {
176 sources = [
177 "call/transport.h",
178 ]
179}
nisseb2250e52016-12-02 04:01:14 -0800180
181rtc_source_set("video_frame_api") {
182 sources = [
183 "video/video_rotation.h",
184 ]
185
186 deps = [
187 "../base:rtc_base_approved",
188 ]
189
190 # TODO(nisse): This logic is duplicated in multiple places.
191 # Define in a single place.
192 if (rtc_build_libyuv) {
193 deps += [ "$rtc_libyuv_dir" ]
194 public_deps = [
195 "$rtc_libyuv_dir",
196 ]
197 } else {
198 # Need to add a directory normally exported by libyuv.
199 include_dirs = [ "$rtc_libyuv_dir/include" ]
200 }
201}
202
kjellanderfd5b4e92016-06-13 12:08:33 -0700203if (rtc_include_tests) {
204 config("peerconnection_unittests_config") {
205 # The warnings below are enabled by default. Since GN orders compiler flags
206 # for a target before flags from configs, the only way to disable such
207 # warnings is by having them in a separate config, loaded from the target.
208 # TODO(kjellander): Make the code compile without disabling these flags.
209 # See https://bugs.webrtc.org/3307.
210 if (is_clang && is_win) {
ehmaldonadod02fe4b2016-08-26 13:31:24 -0700211 cflags = [
212 # See https://bugs.chromium.org/p/webrtc/issues/detail?id=6267
213 # for -Wno-sign-compare
214 "-Wno-sign-compare",
215 "-Wno-unused-function",
216 ]
kjellanderfd5b4e92016-06-13 12:08:33 -0700217 }
218
219 if (!is_win) {
220 cflags = [ "-Wno-sign-compare" ]
kjellanderfd5b4e92016-06-13 12:08:33 -0700221 }
222 }
223
ehmaldonado38a21322016-09-02 04:10:34 -0700224 rtc_test("peerconnection_unittests") {
kjellanderfd5b4e92016-06-13 12:08:33 -0700225 testonly = true
226 sources = [
227 "datachannel_unittest.cc",
228 "dtmfsender_unittest.cc",
229 "fakemetricsobserver.cc",
230 "fakemetricsobserver.h",
231 "jsepsessiondescription_unittest.cc",
232 "localaudiosource_unittest.cc",
233 "mediaconstraintsinterface_unittest.cc",
234 "mediastream_unittest.cc",
235 "peerconnection_unittest.cc",
236 "peerconnectionendtoend_unittest.cc",
237 "peerconnectionfactory_unittest.cc",
238 "peerconnectioninterface_unittest.cc",
239 "proxy_unittest.cc",
hbosdb346a72016-11-29 01:57:01 -0800240 "rtcstats_integrationtest.cc",
hbos74e1a4f2016-09-15 23:33:01 -0700241 "rtcstatscollector_unittest.cc",
kjellanderfd5b4e92016-06-13 12:08:33 -0700242 "rtpsenderreceiver_unittest.cc",
ossud4d2f602016-11-08 02:05:32 -0800243 "sctputils_unittest.cc",
kjellanderfd5b4e92016-06-13 12:08:33 -0700244 "statscollector_unittest.cc",
245 "test/fakeaudiocapturemodule.cc",
246 "test/fakeaudiocapturemodule.h",
247 "test/fakeaudiocapturemodule_unittest.cc",
248 "test/fakeconstraints.h",
249 "test/fakedatachannelprovider.h",
250 "test/fakeperiodicvideocapturer.h",
251 "test/fakertccertificategenerator.h",
252 "test/fakevideotrackrenderer.h",
hbosd565b732016-08-30 14:04:35 -0700253 "test/mock_datachannel.h",
hbosb24b1ce2016-08-16 01:19:43 -0700254 "test/mock_peerconnection.h",
255 "test/mock_webrtcsession.h",
kjellanderfd5b4e92016-06-13 12:08:33 -0700256 "test/mockpeerconnectionobservers.h",
257 "test/peerconnectiontestwrapper.cc",
258 "test/peerconnectiontestwrapper.h",
hbosdb346a72016-11-29 01:57:01 -0800259 "test/rtcstatsobtainer.h",
kjellanderfd5b4e92016-06-13 12:08:33 -0700260 "test/testsdpstrings.h",
261 "videocapturertracksource_unittest.cc",
262 "videotrack_unittest.cc",
263 "webrtcsdp_unittest.cc",
264 "webrtcsession_unittest.cc",
265 ]
266
267 defines = [ "HAVE_SCTP" ]
268
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",
338 ]
339 }
kjellanderfd5b4e92016-06-13 12:08:33 -0700340}