blob: 7fbcb5dab2a5a2b411d717118a20d2c1293352a6 [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",
kjellanderfd5b4e92016-06-13 12:08:33 -0700227 "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
deadbeef40610e22016-12-22 10:53:38 -0800263 if (rtc_enable_sctp) {
264 defines = [ "HAVE_SCTP" ]
265 }
kjellanderfd5b4e92016-06-13 12:08:33 -0700266
ehmaldonado7a2ce0b2016-09-05 01:35:44 -0700267 configs += [ ":peerconnection_unittests_config" ]
kjellanderfd5b4e92016-06-13 12:08:33 -0700268
kjellandere40a7ee2016-10-16 23:56:12 -0700269 if (!build_with_chromium && is_clang) {
kjellanderfd5b4e92016-06-13 12:08:33 -0700270 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
ehmaldonado38a21322016-09-02 04:10:34 -0700271 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
kjellanderfd5b4e92016-06-13 12:08:33 -0700272 }
273
274 # TODO(jschuh): Bug 1348: fix this warning.
275 configs += [ "//build/config/compiler:no_size_t_to_int_warning" ]
276
277 if (is_win) {
278 cflags = [
279 "/wd4245", # conversion from int to size_t, signed/unsigned mismatch.
280 "/wd4389", # signed/unsigned mismatch.
281 ]
282 }
283
284 if (rtc_use_quic) {
285 public_deps = [
286 "//third_party/libquic",
287 ]
288 sources += [
289 "quicdatachannel_unittest.cc",
290 "quicdatatransport_unittest.cc",
291 ]
292 }
293
294 deps = []
295 if (is_android) {
296 sources += [
297 "test/androidtestinitializer.cc",
298 "test/androidtestinitializer.h",
299 ]
300 deps += [
kjellanderfd5b4e92016-06-13 12:08:33 -0700301 "//testing/android/native_test:native_test_support",
magjed768c6482016-12-06 04:29:37 -0800302 "//webrtc/sdk/android:libjingle_peerconnection_java",
303 "//webrtc/sdk/android:libjingle_peerconnection_jni",
kjellanderfd5b4e92016-06-13 12:08:33 -0700304 ]
305 }
306
307 deps += [
ehmaldonadoda8dcfb2017-01-04 07:11:23 -0800308 ":fakemetricsobserver",
kjellanderfd5b4e92016-06-13 12:08:33 -0700309 ":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 }
ehmaldonadoda8dcfb2017-01-04 07:11:23 -0800340
341 rtc_source_set("fakemetricsobserver") {
342 testonly = true
343 sources = [
344 "fakemetricsobserver.cc",
345 "fakemetricsobserver.h",
346 ]
347 deps = [
348 ":libjingle_peerconnection",
349 "../base:rtc_base_approved",
350 ]
351 if (!build_with_chromium && is_clang) {
352 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
353 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
354 }
355 }
kjellanderfd5b4e92016-06-13 12:08:33 -0700356}