blob: 3b93673604e40a2a05ed9e814ef57ddb8d278cd1 [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",
kjellander676e08f2016-12-07 08:23:27 -080033 "../modules/audio_coding:audio_decoder_factory_interface",
kjellandera69d9732016-08-31 07:33:05 -070034 "../modules/audio_coding:audio_encoder_interface",
35 ]
36}
37
kjellanderc76dc952016-06-03 03:09:32 -070038config("libjingle_peerconnection_warnings_config") {
39 # GN orders flags on a target before flags from configs. The default config
40 # adds these flags so to cancel them out they need to come from a config and
41 # cannot be on the target directly.
kjellander3e33bfe2016-06-20 07:04:09 -070042 if (!is_win && !is_clang) {
43 cflags = [ "-Wno-maybe-uninitialized" ] # Only exists for GCC.
kjellanderc76dc952016-06-03 03:09:32 -070044 }
45}
46
kjellanderb62dbbe2016-09-23 00:38:52 -070047rtc_static_library("libjingle_peerconnection") {
kjellander676e08f2016-12-07 08:23:27 -080048 check_includes = false # TODO(kjellander): Remove (bugs.webrtc.org/6828)
kjellanderc76dc952016-06-03 03:09:32 -070049 cflags = []
50 sources = [
51 "audiotrack.cc",
52 "audiotrack.h",
53 "datachannel.cc",
54 "datachannel.h",
55 "datachannelinterface.h",
kjellanderc76dc952016-06-03 03:09:32 -070056 "dtmfsender.cc",
57 "dtmfsender.h",
58 "dtmfsenderinterface.h",
59 "jsep.h",
60 "jsepicecandidate.cc",
61 "jsepicecandidate.h",
62 "jsepsessiondescription.cc",
63 "jsepsessiondescription.h",
64 "localaudiosource.cc",
65 "localaudiosource.h",
66 "mediaconstraintsinterface.cc",
67 "mediaconstraintsinterface.h",
68 "mediacontroller.cc",
69 "mediacontroller.h",
70 "mediastream.cc",
71 "mediastream.h",
72 "mediastreaminterface.h",
73 "mediastreamobserver.cc",
74 "mediastreamobserver.h",
kjellanderc76dc952016-06-03 03:09:32 -070075 "mediastreamproxy.h",
76 "mediastreamtrack.h",
77 "mediastreamtrackproxy.h",
78 "notifier.h",
79 "peerconnection.cc",
80 "peerconnection.h",
81 "peerconnectionfactory.cc",
82 "peerconnectionfactory.h",
83 "peerconnectionfactoryproxy.h",
84 "peerconnectioninterface.h",
85 "peerconnectionproxy.h",
86 "proxy.h",
87 "remoteaudiosource.cc",
88 "remoteaudiosource.h",
hbos74e1a4f2016-09-15 23:33:01 -070089 "rtcstatscollector.cc",
90 "rtcstatscollector.h",
kjellanderc76dc952016-06-03 03:09:32 -070091 "rtpparameters.h",
92 "rtpreceiver.cc",
93 "rtpreceiver.h",
94 "rtpreceiverinterface.h",
95 "rtpsender.cc",
96 "rtpsender.h",
97 "rtpsenderinterface.h",
98 "sctputils.cc",
99 "sctputils.h",
100 "statscollector.cc",
101 "statscollector.h",
102 "statstypes.cc",
103 "statstypes.h",
104 "streamcollection.h",
105 "videocapturertracksource.cc",
106 "videocapturertracksource.h",
107 "videosourceproxy.h",
108 "videotrack.cc",
109 "videotrack.h",
110 "videotracksource.cc",
111 "videotracksource.h",
112 "webrtcsdp.cc",
113 "webrtcsdp.h",
114 "webrtcsession.cc",
115 "webrtcsession.h",
116 "webrtcsessiondescriptionfactory.cc",
117 "webrtcsessiondescriptionfactory.h",
118 ]
119
ehmaldonado7a2ce0b2016-09-05 01:35:44 -0700120 configs += [ ":libjingle_peerconnection_warnings_config" ]
kjellanderc76dc952016-06-03 03:09:32 -0700121
kjellandere40a7ee2016-10-16 23:56:12 -0700122 if (!build_with_chromium && is_clang) {
kjellanderfd5b4e92016-06-13 12:08:33 -0700123 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
ehmaldonado38a21322016-09-02 04:10:34 -0700124 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
kjellanderc76dc952016-06-03 03:09:32 -0700125 }
126
kjellanderc76dc952016-06-03 03:09:32 -0700127 deps = [
kjellandera69d9732016-08-31 07:33:05 -0700128 ":call_api",
hbos74e1a4f2016-09-15 23:33:01 -0700129 ":rtc_stats_api",
katrielc14897d02016-06-03 13:14:28 -0700130 "../call",
kjellanderc76dc952016-06-03 03:09:32 -0700131 "../media",
132 "../pc",
hbos74e1a4f2016-09-15 23:33:01 -0700133 "../stats",
kjellanderc76dc952016-06-03 03:09:32 -0700134 ]
135
136 if (rtc_use_quic) {
137 sources += [
138 "quicdatachannel.cc",
139 "quicdatachannel.h",
140 "quicdatatransport.cc",
141 "quicdatatransport.h",
142 ]
143 deps += [ "//third_party/libquic" ]
144 public_deps = [
145 "//third_party/libquic",
146 ]
147 }
148}
kjellanderfd5b4e92016-06-13 12:08:33 -0700149
hbos74e1a4f2016-09-15 23:33:01 -0700150rtc_source_set("rtc_stats_api") {
151 cflags = []
152 sources = [
153 "stats/rtcstats.h",
154 "stats/rtcstats_objects.h",
155 "stats/rtcstatsreport.h",
156 ]
157
158 deps = [
159 "../base:rtc_base_approved",
160 ]
161}
162
aleloi201dfe92016-10-20 05:06:39 -0700163rtc_source_set("audio_mixer_api") {
164 sources = [
165 "audio/audio_mixer.h",
166 ]
167
168 deps = [
169 "../base:rtc_base_approved",
170 ]
171}
172
aleloia8eb7562016-11-28 07:02:13 -0800173rtc_source_set("transport_api") {
174 sources = [
175 "call/transport.h",
176 ]
177}
nisseb2250e52016-12-02 04:01:14 -0800178
179rtc_source_set("video_frame_api") {
180 sources = [
181 "video/video_rotation.h",
182 ]
183
184 deps = [
185 "../base:rtc_base_approved",
186 ]
187
188 # TODO(nisse): This logic is duplicated in multiple places.
189 # Define in a single place.
190 if (rtc_build_libyuv) {
191 deps += [ "$rtc_libyuv_dir" ]
192 public_deps = [
193 "$rtc_libyuv_dir",
194 ]
195 } else {
196 # Need to add a directory normally exported by libyuv.
197 include_dirs = [ "$rtc_libyuv_dir/include" ]
198 }
199}
200
kjellanderfd5b4e92016-06-13 12:08:33 -0700201if (rtc_include_tests) {
202 config("peerconnection_unittests_config") {
203 # The warnings below are enabled by default. Since GN orders compiler flags
204 # for a target before flags from configs, the only way to disable such
205 # warnings is by having them in a separate config, loaded from the target.
206 # TODO(kjellander): Make the code compile without disabling these flags.
207 # See https://bugs.webrtc.org/3307.
208 if (is_clang && is_win) {
ehmaldonadod02fe4b2016-08-26 13:31:24 -0700209 cflags = [
210 # See https://bugs.chromium.org/p/webrtc/issues/detail?id=6267
211 # for -Wno-sign-compare
212 "-Wno-sign-compare",
213 "-Wno-unused-function",
214 ]
kjellanderfd5b4e92016-06-13 12:08:33 -0700215 }
216
217 if (!is_win) {
218 cflags = [ "-Wno-sign-compare" ]
kjellanderfd5b4e92016-06-13 12:08:33 -0700219 }
220 }
221
ehmaldonado38a21322016-09-02 04:10:34 -0700222 rtc_test("peerconnection_unittests") {
kjellander676e08f2016-12-07 08:23:27 -0800223 check_includes = false # TODO(kjellander): Remove (bugs.webrtc.org/6828)
kjellanderfd5b4e92016-06-13 12:08:33 -0700224 testonly = true
225 sources = [
226 "datachannel_unittest.cc",
227 "dtmfsender_unittest.cc",
228 "fakemetricsobserver.cc",
229 "fakemetricsobserver.h",
230 "jsepsessiondescription_unittest.cc",
231 "localaudiosource_unittest.cc",
232 "mediaconstraintsinterface_unittest.cc",
233 "mediastream_unittest.cc",
234 "peerconnection_unittest.cc",
235 "peerconnectionendtoend_unittest.cc",
236 "peerconnectionfactory_unittest.cc",
237 "peerconnectioninterface_unittest.cc",
238 "proxy_unittest.cc",
hbosdb346a72016-11-29 01:57:01 -0800239 "rtcstats_integrationtest.cc",
hbos74e1a4f2016-09-15 23:33:01 -0700240 "rtcstatscollector_unittest.cc",
kjellanderfd5b4e92016-06-13 12:08:33 -0700241 "rtpsenderreceiver_unittest.cc",
ossud4d2f602016-11-08 02:05:32 -0800242 "sctputils_unittest.cc",
kjellanderfd5b4e92016-06-13 12:08:33 -0700243 "statscollector_unittest.cc",
244 "test/fakeaudiocapturemodule.cc",
245 "test/fakeaudiocapturemodule.h",
246 "test/fakeaudiocapturemodule_unittest.cc",
247 "test/fakeconstraints.h",
248 "test/fakedatachannelprovider.h",
249 "test/fakeperiodicvideocapturer.h",
250 "test/fakertccertificategenerator.h",
251 "test/fakevideotrackrenderer.h",
hbosd565b732016-08-30 14:04:35 -0700252 "test/mock_datachannel.h",
hbosb24b1ce2016-08-16 01:19:43 -0700253 "test/mock_peerconnection.h",
254 "test/mock_webrtcsession.h",
kjellanderfd5b4e92016-06-13 12:08:33 -0700255 "test/mockpeerconnectionobservers.h",
256 "test/peerconnectiontestwrapper.cc",
257 "test/peerconnectiontestwrapper.h",
hbosdb346a72016-11-29 01:57:01 -0800258 "test/rtcstatsobtainer.h",
kjellanderfd5b4e92016-06-13 12:08:33 -0700259 "test/testsdpstrings.h",
260 "videocapturertracksource_unittest.cc",
261 "videotrack_unittest.cc",
262 "webrtcsdp_unittest.cc",
263 "webrtcsession_unittest.cc",
264 ]
265
266 defines = [ "HAVE_SCTP" ]
267
ehmaldonado7a2ce0b2016-09-05 01:35:44 -0700268 configs += [ ":peerconnection_unittests_config" ]
kjellanderfd5b4e92016-06-13 12:08:33 -0700269
kjellandere40a7ee2016-10-16 23:56:12 -0700270 if (!build_with_chromium && is_clang) {
kjellanderfd5b4e92016-06-13 12:08:33 -0700271 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
ehmaldonado38a21322016-09-02 04:10:34 -0700272 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
kjellanderfd5b4e92016-06-13 12:08:33 -0700273 }
274
275 # TODO(jschuh): Bug 1348: fix this warning.
276 configs += [ "//build/config/compiler:no_size_t_to_int_warning" ]
277
278 if (is_win) {
279 cflags = [
280 "/wd4245", # conversion from int to size_t, signed/unsigned mismatch.
281 "/wd4389", # signed/unsigned mismatch.
282 ]
283 }
284
285 if (rtc_use_quic) {
286 public_deps = [
287 "//third_party/libquic",
288 ]
289 sources += [
290 "quicdatachannel_unittest.cc",
291 "quicdatatransport_unittest.cc",
292 ]
293 }
294
295 deps = []
296 if (is_android) {
297 sources += [
298 "test/androidtestinitializer.cc",
299 "test/androidtestinitializer.h",
300 ]
301 deps += [
kjellanderfd5b4e92016-06-13 12:08:33 -0700302 "//testing/android/native_test:native_test_support",
magjed768c6482016-12-06 04:29:37 -0800303 "//webrtc/sdk/android:libjingle_peerconnection_java",
304 "//webrtc/sdk/android:libjingle_peerconnection_jni",
kjellanderfd5b4e92016-06-13 12:08:33 -0700305 ]
306 }
307
308 deps += [
309 ":libjingle_peerconnection",
310 "..:webrtc_common",
311 "../base:rtc_base_tests_utils",
312 "../media:rtc_unittest_main",
313 "../pc:rtc_pc",
314 "../system_wrappers:metrics_default",
315 "//testing/gmock",
316 ]
317
318 if (is_android) {
319 deps += [ "//testing/android/native_test:native_test_support" ]
sakal714dd4e2016-08-15 02:29:11 -0700320
321 shard_timeout = 900
kjellanderfd5b4e92016-06-13 12:08:33 -0700322 }
323 }
ehmaldonado3651d8f2016-08-10 03:10:48 -0700324
aleloi17338d42016-11-22 06:02:06 -0800325 rtc_source_set("mock_audio_mixer") {
326 testonly = true
327 sources = [
328 "test/mock_audio_mixer.h",
329 ]
330
331 public_deps = [
332 ":audio_mixer_api",
333 ]
334
335 deps = [
336 "//testing/gmock",
kjellander676e08f2016-12-07 08:23:27 -0800337 "//webrtc/test:test_support",
aleloi17338d42016-11-22 06:02:06 -0800338 ]
339 }
kjellanderfd5b4e92016-06-13 12:08:33 -0700340}