blob: e838e7ed544e9fa8f64357ec8baed28a3c839244 [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",
brandtr76648da2016-10-20 04:54:48 -070024 "call/flexfec_receive_stream.h",
kjellandera69d9732016-08-31 07:33:05 -070025 ]
26
kjellandera69d9732016-08-31 07:33:05 -070027 deps = [
28 # TODO(kjellander): Add remaining dependencies when webrtc:4243 is done.
aleloi81da4882016-11-08 04:26:30 -080029 ":audio_mixer_api",
aleloia8eb7562016-11-28 07:02:13 -080030 ":transport_api",
kjellandera69d9732016-08-31 07:33:05 -070031 "..:webrtc_common",
32 "../base:rtc_base_approved",
33 "../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") {
kjellanderc76dc952016-06-03 03:09:32 -070047 cflags = []
48 sources = [
49 "audiotrack.cc",
50 "audiotrack.h",
51 "datachannel.cc",
52 "datachannel.h",
53 "datachannelinterface.h",
kjellanderc76dc952016-06-03 03:09:32 -070054 "dtmfsender.cc",
55 "dtmfsender.h",
56 "dtmfsenderinterface.h",
57 "jsep.h",
58 "jsepicecandidate.cc",
59 "jsepicecandidate.h",
60 "jsepsessiondescription.cc",
61 "jsepsessiondescription.h",
62 "localaudiosource.cc",
63 "localaudiosource.h",
64 "mediaconstraintsinterface.cc",
65 "mediaconstraintsinterface.h",
66 "mediacontroller.cc",
67 "mediacontroller.h",
68 "mediastream.cc",
69 "mediastream.h",
70 "mediastreaminterface.h",
71 "mediastreamobserver.cc",
72 "mediastreamobserver.h",
kjellanderc76dc952016-06-03 03:09:32 -070073 "mediastreamproxy.h",
74 "mediastreamtrack.h",
75 "mediastreamtrackproxy.h",
76 "notifier.h",
77 "peerconnection.cc",
78 "peerconnection.h",
79 "peerconnectionfactory.cc",
80 "peerconnectionfactory.h",
81 "peerconnectionfactoryproxy.h",
82 "peerconnectioninterface.h",
83 "peerconnectionproxy.h",
84 "proxy.h",
85 "remoteaudiosource.cc",
86 "remoteaudiosource.h",
hbos74e1a4f2016-09-15 23:33:01 -070087 "rtcstatscollector.cc",
88 "rtcstatscollector.h",
kjellanderc76dc952016-06-03 03:09:32 -070089 "rtpparameters.h",
90 "rtpreceiver.cc",
91 "rtpreceiver.h",
92 "rtpreceiverinterface.h",
93 "rtpsender.cc",
94 "rtpsender.h",
95 "rtpsenderinterface.h",
96 "sctputils.cc",
97 "sctputils.h",
98 "statscollector.cc",
99 "statscollector.h",
100 "statstypes.cc",
101 "statstypes.h",
102 "streamcollection.h",
103 "videocapturertracksource.cc",
104 "videocapturertracksource.h",
105 "videosourceproxy.h",
106 "videotrack.cc",
107 "videotrack.h",
108 "videotracksource.cc",
109 "videotracksource.h",
110 "webrtcsdp.cc",
111 "webrtcsdp.h",
112 "webrtcsession.cc",
113 "webrtcsession.h",
114 "webrtcsessiondescriptionfactory.cc",
115 "webrtcsessiondescriptionfactory.h",
116 ]
117
ehmaldonado7a2ce0b2016-09-05 01:35:44 -0700118 configs += [ ":libjingle_peerconnection_warnings_config" ]
kjellanderc76dc952016-06-03 03:09:32 -0700119
kjellandere40a7ee2016-10-16 23:56:12 -0700120 if (!build_with_chromium && is_clang) {
kjellanderfd5b4e92016-06-13 12:08:33 -0700121 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
ehmaldonado38a21322016-09-02 04:10:34 -0700122 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
kjellanderc76dc952016-06-03 03:09:32 -0700123 }
124
kjellanderc76dc952016-06-03 03:09:32 -0700125 deps = [
kjellandera69d9732016-08-31 07:33:05 -0700126 ":call_api",
hbos74e1a4f2016-09-15 23:33:01 -0700127 ":rtc_stats_api",
katrielc14897d02016-06-03 13:14:28 -0700128 "../call",
kjellanderc76dc952016-06-03 03:09:32 -0700129 "../media",
130 "../pc",
hbos74e1a4f2016-09-15 23:33:01 -0700131 "../stats",
kjellanderc76dc952016-06-03 03:09:32 -0700132 ]
133
134 if (rtc_use_quic) {
135 sources += [
136 "quicdatachannel.cc",
137 "quicdatachannel.h",
138 "quicdatatransport.cc",
139 "quicdatatransport.h",
140 ]
141 deps += [ "//third_party/libquic" ]
142 public_deps = [
143 "//third_party/libquic",
144 ]
145 }
146}
kjellanderfd5b4e92016-06-13 12:08:33 -0700147
hbos74e1a4f2016-09-15 23:33:01 -0700148rtc_source_set("rtc_stats_api") {
149 cflags = []
150 sources = [
151 "stats/rtcstats.h",
152 "stats/rtcstats_objects.h",
153 "stats/rtcstatsreport.h",
154 ]
155
156 deps = [
157 "../base:rtc_base_approved",
158 ]
159}
160
aleloi201dfe92016-10-20 05:06:39 -0700161rtc_source_set("audio_mixer_api") {
162 sources = [
163 "audio/audio_mixer.h",
164 ]
165
166 deps = [
167 "../base:rtc_base_approved",
168 ]
169}
170
aleloia8eb7562016-11-28 07:02:13 -0800171rtc_source_set("transport_api") {
172 sources = [
173 "call/transport.h",
174 ]
175}
nisseb2250e52016-12-02 04:01:14 -0800176
177rtc_source_set("video_frame_api") {
178 sources = [
179 "video/video_rotation.h",
180 ]
181
182 deps = [
183 "../base:rtc_base_approved",
184 ]
185
186 # TODO(nisse): This logic is duplicated in multiple places.
187 # Define in a single place.
188 if (rtc_build_libyuv) {
189 deps += [ "$rtc_libyuv_dir" ]
190 public_deps = [
191 "$rtc_libyuv_dir",
192 ]
193 } else {
194 # Need to add a directory normally exported by libyuv.
195 include_dirs = [ "$rtc_libyuv_dir/include" ]
196 }
197}
198
kjellanderfd5b4e92016-06-13 12:08:33 -0700199if (rtc_include_tests) {
200 config("peerconnection_unittests_config") {
201 # The warnings below are enabled by default. Since GN orders compiler flags
202 # for a target before flags from configs, the only way to disable such
203 # warnings is by having them in a separate config, loaded from the target.
204 # TODO(kjellander): Make the code compile without disabling these flags.
205 # See https://bugs.webrtc.org/3307.
206 if (is_clang && is_win) {
ehmaldonadod02fe4b2016-08-26 13:31:24 -0700207 cflags = [
208 # See https://bugs.chromium.org/p/webrtc/issues/detail?id=6267
209 # for -Wno-sign-compare
210 "-Wno-sign-compare",
211 "-Wno-unused-function",
212 ]
kjellanderfd5b4e92016-06-13 12:08:33 -0700213 }
214
215 if (!is_win) {
216 cflags = [ "-Wno-sign-compare" ]
kjellanderfd5b4e92016-06-13 12:08:33 -0700217 }
218 }
219
ehmaldonado38a21322016-09-02 04:10:34 -0700220 rtc_test("peerconnection_unittests") {
kjellanderfd5b4e92016-06-13 12:08:33 -0700221 testonly = true
222 sources = [
223 "datachannel_unittest.cc",
224 "dtmfsender_unittest.cc",
225 "fakemetricsobserver.cc",
226 "fakemetricsobserver.h",
227 "jsepsessiondescription_unittest.cc",
228 "localaudiosource_unittest.cc",
229 "mediaconstraintsinterface_unittest.cc",
230 "mediastream_unittest.cc",
231 "peerconnection_unittest.cc",
232 "peerconnectionendtoend_unittest.cc",
233 "peerconnectionfactory_unittest.cc",
234 "peerconnectioninterface_unittest.cc",
235 "proxy_unittest.cc",
hbosdb346a72016-11-29 01:57:01 -0800236 "rtcstats_integrationtest.cc",
hbos74e1a4f2016-09-15 23:33:01 -0700237 "rtcstatscollector_unittest.cc",
kjellanderfd5b4e92016-06-13 12:08:33 -0700238 "rtpsenderreceiver_unittest.cc",
ossud4d2f602016-11-08 02:05:32 -0800239 "sctputils_unittest.cc",
kjellanderfd5b4e92016-06-13 12:08:33 -0700240 "statscollector_unittest.cc",
241 "test/fakeaudiocapturemodule.cc",
242 "test/fakeaudiocapturemodule.h",
243 "test/fakeaudiocapturemodule_unittest.cc",
244 "test/fakeconstraints.h",
245 "test/fakedatachannelprovider.h",
246 "test/fakeperiodicvideocapturer.h",
247 "test/fakertccertificategenerator.h",
248 "test/fakevideotrackrenderer.h",
hbosd565b732016-08-30 14:04:35 -0700249 "test/mock_datachannel.h",
hbosb24b1ce2016-08-16 01:19:43 -0700250 "test/mock_peerconnection.h",
251 "test/mock_webrtcsession.h",
kjellanderfd5b4e92016-06-13 12:08:33 -0700252 "test/mockpeerconnectionobservers.h",
253 "test/peerconnectiontestwrapper.cc",
254 "test/peerconnectiontestwrapper.h",
hbosdb346a72016-11-29 01:57:01 -0800255 "test/rtcstatsobtainer.h",
kjellanderfd5b4e92016-06-13 12:08:33 -0700256 "test/testsdpstrings.h",
257 "videocapturertracksource_unittest.cc",
258 "videotrack_unittest.cc",
259 "webrtcsdp_unittest.cc",
260 "webrtcsession_unittest.cc",
261 ]
262
263 defines = [ "HAVE_SCTP" ]
264
ehmaldonado7a2ce0b2016-09-05 01:35:44 -0700265 configs += [ ":peerconnection_unittests_config" ]
kjellanderfd5b4e92016-06-13 12:08:33 -0700266
kjellandere40a7ee2016-10-16 23:56:12 -0700267 if (!build_with_chromium && is_clang) {
kjellanderfd5b4e92016-06-13 12:08:33 -0700268 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
ehmaldonado38a21322016-09-02 04:10:34 -0700269 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
kjellanderfd5b4e92016-06-13 12:08:33 -0700270 }
271
272 # TODO(jschuh): Bug 1348: fix this warning.
273 configs += [ "//build/config/compiler:no_size_t_to_int_warning" ]
274
275 if (is_win) {
276 cflags = [
277 "/wd4245", # conversion from int to size_t, signed/unsigned mismatch.
278 "/wd4389", # signed/unsigned mismatch.
279 ]
280 }
281
282 if (rtc_use_quic) {
283 public_deps = [
284 "//third_party/libquic",
285 ]
286 sources += [
287 "quicdatachannel_unittest.cc",
288 "quicdatatransport_unittest.cc",
289 ]
290 }
291
292 deps = []
293 if (is_android) {
294 sources += [
295 "test/androidtestinitializer.cc",
296 "test/androidtestinitializer.h",
297 ]
298 deps += [
kjellanderfd5b4e92016-06-13 12:08:33 -0700299 "//testing/android/native_test:native_test_support",
magjed768c6482016-12-06 04:29:37 -0800300 "//webrtc/sdk/android:libjingle_peerconnection_java",
301 "//webrtc/sdk/android:libjingle_peerconnection_jni",
kjellanderfd5b4e92016-06-13 12:08:33 -0700302 ]
303 }
304
305 deps += [
306 ":libjingle_peerconnection",
307 "..:webrtc_common",
308 "../base:rtc_base_tests_utils",
309 "../media:rtc_unittest_main",
310 "../pc:rtc_pc",
311 "../system_wrappers:metrics_default",
312 "//testing/gmock",
313 ]
314
315 if (is_android) {
316 deps += [ "//testing/android/native_test:native_test_support" ]
sakal714dd4e2016-08-15 02:29:11 -0700317
318 shard_timeout = 900
kjellanderfd5b4e92016-06-13 12:08:33 -0700319 }
320 }
ehmaldonado3651d8f2016-08-10 03:10:48 -0700321
aleloi17338d42016-11-22 06:02:06 -0800322 rtc_source_set("mock_audio_mixer") {
323 testonly = true
324 sources = [
325 "test/mock_audio_mixer.h",
326 ]
327
328 public_deps = [
329 ":audio_mixer_api",
330 ]
331
332 deps = [
333 "//testing/gmock",
334 ]
335 }
kjellanderfd5b4e92016-06-13 12:08:33 -0700336}