blob: 9f655a7ddb0a9b12b0bc116b61fadf400c53c1c9 [file] [log] [blame]
kjellanderc76dc952016-06-03 03:09:32 -07001# Copyright (c) 2016 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
mbonadei9aa3f0a2017-01-24 06:58:22 -08009import("../webrtc.gni")
kjellanderc76dc952016-06-03 03:09:32 -070010
11group("p2p") {
kjellander705ecc52016-09-15 00:53:26 -070012 public_deps = [
kjellander6ceab082016-10-28 05:44:03 -070013 ":libstunprober",
kjellanderc76dc952016-06-03 03:09:32 -070014 ":rtc_p2p",
15 ]
16}
17
18config("rtc_p2p_inherited_config") {
19 defines = [ "FEATURE_ENABLE_VOICEMAIL" ]
20}
21
kjellanderb62dbbe2016-09-23 00:38:52 -070022rtc_static_library("rtc_p2p") {
kjellanderc76dc952016-06-03 03:09:32 -070023 sources = [
24 "base/asyncstuntcpsocket.cc",
25 "base/asyncstuntcpsocket.h",
26 "base/basicpacketsocketfactory.cc",
27 "base/basicpacketsocketfactory.h",
Patrik Höglund7bcfc3b2017-09-29 11:11:10 +000028 "base/candidate.h",
kjellanderc76dc952016-06-03 03:09:32 -070029 "base/common.h",
zhihuangca6d3b62017-08-23 18:05:50 -070030 "base/dtlstransport.cc",
31 "base/dtlstransport.h",
zhihuange50658d2017-01-03 11:34:12 -080032 "base/dtlstransportinternal.h",
zhihuang86abd6f2016-12-19 11:54:05 -080033 "base/icetransportinternal.h",
deadbeef49f34fd2016-12-06 16:22:06 -080034 "base/jseptransport.cc",
35 "base/jseptransport.h",
kjellanderc76dc952016-06-03 03:09:32 -070036 "base/p2pconstants.cc",
37 "base/p2pconstants.h",
kjellanderc76dc952016-06-03 03:09:32 -070038 "base/p2ptransportchannel.cc",
39 "base/p2ptransportchannel.h",
zsteinabbacbf2017-03-20 10:53:12 -070040 "base/packetlossestimator.cc",
41 "base/packetlossestimator.h",
kjellanderc76dc952016-06-03 03:09:32 -070042 "base/packetsocketfactory.h",
johana9c7cfa2016-10-18 15:38:38 -070043 "base/packettransportinterface.h",
deadbeef5bd5ca32017-02-10 11:31:50 -080044 "base/packettransportinternal.h",
kjellanderc76dc952016-06-03 03:09:32 -070045 "base/port.cc",
46 "base/port.h",
47 "base/portallocator.cc",
48 "base/portallocator.h",
49 "base/portinterface.h",
50 "base/pseudotcp.cc",
51 "base/pseudotcp.h",
52 "base/relayport.cc",
53 "base/relayport.h",
kjellander5023d412016-06-18 04:23:01 -070054 "base/session.cc",
55 "base/session.h",
kjellanderc76dc952016-06-03 03:09:32 -070056 "base/sessiondescription.cc",
57 "base/sessiondescription.h",
kjellanderc76dc952016-06-03 03:09:32 -070058 "base/stun.cc",
59 "base/stun.h",
60 "base/stunport.cc",
61 "base/stunport.h",
62 "base/stunrequest.cc",
63 "base/stunrequest.h",
kjellanderc76dc952016-06-03 03:09:32 -070064 "base/tcpport.cc",
65 "base/tcpport.h",
deadbeef57fd7262016-12-06 15:28:55 -080066 "base/transport.h",
kjellanderc76dc952016-06-03 03:09:32 -070067 "base/transportdescription.cc",
68 "base/transportdescription.h",
69 "base/transportdescriptionfactory.cc",
70 "base/transportdescriptionfactory.h",
71 "base/transportinfo.h",
72 "base/turnport.cc",
73 "base/turnport.h",
kjellanderc76dc952016-06-03 03:09:32 -070074 "base/udpport.h",
deadbeefd1c09982017-01-18 15:16:37 -080075 "base/udptransport.cc",
76 "base/udptransport.h",
kjellanderc76dc952016-06-03 03:09:32 -070077 "client/basicportallocator.cc",
78 "client/basicportallocator.h",
kjellanderc76dc952016-06-03 03:09:32 -070079 "client/socketmonitor.cc",
80 "client/socketmonitor.h",
81 ]
82
deadbeef1b54a5f2017-01-23 19:39:57 -080083 defines = []
kjellanderc76dc952016-06-03 03:09:32 -070084
85 deps = [
kjellander8a116632017-04-21 05:17:08 -070086 "../api:libjingle_peerconnection_api",
kwiberg84f6a3f2017-09-05 08:43:13 -070087 "../api:optional",
kjellander8a116632017-04-21 05:17:08 -070088 "../api:ortc_api",
ehmaldonadof6a861a2017-07-19 10:40:47 -070089 "../rtc_base:rtc_base",
kjellander8a116632017-04-21 05:17:08 -070090 "../system_wrappers:field_trial_api",
kjellanderc76dc952016-06-03 03:09:32 -070091 ]
92
ehmaldonadoe9cc6862016-09-05 06:10:18 -070093 public_configs = [ ":rtc_p2p_inherited_config" ]
kjellanderc76dc952016-06-03 03:09:32 -070094
kjellander5023d412016-06-18 04:23:01 -070095 if (build_with_chromium) {
96 if (is_nacl) {
97 deps += [ "//native_client_sdk/src/libraries/nacl_io" ]
98 }
99 } else {
100 sources += [
101 "base/relayserver.cc",
102 "base/relayserver.h",
103 "base/stunserver.cc",
104 "base/stunserver.h",
105 "base/turnserver.cc",
106 "base/turnserver.h",
107 ]
kjellanderc76dc952016-06-03 03:09:32 -0700108 defines += [
109 "FEATURE_ENABLE_VOICEMAIL",
110 "FEATURE_ENABLE_PSTN",
111 ]
112
kjellandere40a7ee2016-10-16 23:56:12 -0700113 if (!build_with_chromium && is_clang) {
114 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
ehmaldonado38a21322016-09-02 04:10:34 -0700115 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
kjellanderc76dc952016-06-03 03:09:32 -0700116 }
117 }
118
119 if (rtc_use_quic) {
120 deps = [
121 "//third_party/libquic",
122 ]
123 sources += [
124 "quic/quicconnectionhelper.cc",
125 "quic/quicconnectionhelper.h",
126 "quic/quicsession.cc",
127 "quic/quicsession.h",
128 "quic/quictransport.cc",
129 "quic/quictransport.h",
130 "quic/quictransportchannel.cc",
131 "quic/quictransportchannel.h",
132 "quic/reliablequicstream.cc",
133 "quic/reliablequicstream.h",
134 ]
135 public_deps += [ "//third_party/libquic" ]
136 }
137}
138
ehmaldonadoda8dcfb2017-01-04 07:11:23 -0800139if (rtc_include_tests) {
deadbeef59edb922017-04-18 15:49:09 -0700140 rtc_source_set("p2p_test_utils") {
ehmaldonadoda8dcfb2017-01-04 07:11:23 -0800141 testonly = true
142 sources = [
kjellander8a116632017-04-21 05:17:08 -0700143 "base/fakecandidatepair.h",
kjellander98e15312017-03-04 15:08:44 -0800144 "base/fakedtlstransport.h",
145 "base/fakeicetransport.h",
146 "base/fakepackettransport.h",
147 "base/fakeportallocator.h",
kjellander98e15312017-03-04 15:08:44 -0800148 "base/mockicetransport.h",
deadbeef59edb922017-04-18 15:49:09 -0700149 "base/testrelayserver.h",
150 "base/teststunserver.h",
Jonas Orelandbdcee282017-10-10 14:01:40 +0200151 "base/testturncustomizer.h",
deadbeef59edb922017-04-18 15:49:09 -0700152 "base/testturnserver.h",
153 ]
deadbeef59edb922017-04-18 15:49:09 -0700154 deps = [
155 ":rtc_p2p",
kjellander8a116632017-04-21 05:17:08 -0700156 "../api:ortc_api",
ehmaldonadof6a861a2017-07-19 10:40:47 -0700157 "../rtc_base:rtc_base",
158 "../rtc_base:rtc_base_approved",
159 "../rtc_base:rtc_base_tests_utils",
kjellander8a116632017-04-21 05:17:08 -0700160 "../test:test_support",
deadbeef59edb922017-04-18 15:49:09 -0700161 "//testing/gmock",
162 ]
deadbeef59edb922017-04-18 15:49:09 -0700163 }
164
165 rtc_source_set("rtc_p2p_unittests") {
166 testonly = true
kjellandere0629c02017-04-25 04:04:50 -0700167
168 # Skip restricting visibility on mobile platforms since the tests on those
169 # gets additional generated targets which would require many lines here to
170 # cover (which would be confusing to read and hard to maintain).
171 if (!is_android && !is_ios) {
jianjun.zhuc0247402017-07-11 06:20:45 -0700172 visibility = [ "..:rtc_unittests" ]
kjellandere0629c02017-04-25 04:04:50 -0700173 }
deadbeef59edb922017-04-18 15:49:09 -0700174 sources = [
175 "base/asyncstuntcpsocket_unittest.cc",
zhihuangca6d3b62017-08-23 18:05:50 -0700176 "base/dtlstransport_unittest.cc",
deadbeef59edb922017-04-18 15:49:09 -0700177 "base/jseptransport_unittest.cc",
ehmaldonadoda8dcfb2017-01-04 07:11:23 -0800178 "base/p2ptransportchannel_unittest.cc",
zsteinabbacbf2017-03-20 10:53:12 -0700179 "base/packetlossestimator_unittest.cc",
ehmaldonadoda8dcfb2017-01-04 07:11:23 -0800180 "base/port_unittest.cc",
181 "base/portallocator_unittest.cc",
182 "base/pseudotcp_unittest.cc",
183 "base/relayport_unittest.cc",
184 "base/relayserver_unittest.cc",
185 "base/stun_unittest.cc",
186 "base/stunport_unittest.cc",
187 "base/stunrequest_unittest.cc",
188 "base/stunserver_unittest.cc",
189 "base/tcpport_unittest.cc",
ehmaldonadoda8dcfb2017-01-04 07:11:23 -0800190 "base/transportdescriptionfactory_unittest.cc",
191 "base/turnport_unittest.cc",
192 "base/turnserver_unittest.cc",
deadbeefd1c09982017-01-18 15:16:37 -0800193 "base/udptransport_unittest.cc",
ehmaldonadoda8dcfb2017-01-04 07:11:23 -0800194 "client/basicportallocator_unittest.cc",
195 ]
196 if (rtc_use_quic) {
197 sources += [
198 "quic/quicconnectionhelper_unittest.cc",
199 "quic/quicsession_unittest.cc",
200 "quic/quictransport_unittest.cc",
201 "quic/quictransportchannel_unittest.cc",
202 "quic/reliablequicstream_unittest.cc",
203 ]
204 }
205 deps = [
deadbeef59edb922017-04-18 15:49:09 -0700206 ":p2p_test_utils",
ehmaldonadoda8dcfb2017-01-04 07:11:23 -0800207 ":rtc_p2p",
208 "../api:fakemetricsobserver",
kjellander8a116632017-04-21 05:17:08 -0700209 "../api:ortc_api",
ehmaldonadof6a861a2017-07-19 10:40:47 -0700210 "../rtc_base:rtc_base",
211 "../rtc_base:rtc_base_approved",
212 "../rtc_base:rtc_base_tests_utils",
kjellander8a116632017-04-21 05:17:08 -0700213 "../test:test_support",
ehmaldonadoda8dcfb2017-01-04 07:11:23 -0800214 "//testing/gmock",
215 "//testing/gtest",
216 ]
217 if (!build_with_chromium && is_clang) {
218 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
219 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
220 }
221 defines = [ "GTEST_RELATIVE_PATH" ]
222 }
223}
224
kjellanderb62dbbe2016-09-23 00:38:52 -0700225rtc_static_library("libstunprober") {
kjellanderc76dc952016-06-03 03:09:32 -0700226 sources = [
227 "stunprober/stunprober.cc",
228 ]
229
230 if (!build_with_chromium && is_clang) {
231 # Suppress warnings from Chrome's Clang plugins.
232 # See http://code.google.com/p/webrtc/issues/detail?id=163 for details.
ehmaldonado38a21322016-09-02 04:10:34 -0700233 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
kjellanderc76dc952016-06-03 03:09:32 -0700234 }
235
236 deps = [
kjellander8a116632017-04-21 05:17:08 -0700237 ":rtc_p2p",
kjellanderc76dc952016-06-03 03:09:32 -0700238 "..:webrtc_common",
ehmaldonadof6a861a2017-07-19 10:40:47 -0700239 "../rtc_base:rtc_base",
kjellanderc76dc952016-06-03 03:09:32 -0700240 ]
241}
ehmaldonadoda8dcfb2017-01-04 07:11:23 -0800242
243if (rtc_include_tests) {
244 rtc_source_set("libstunprober_unittests") {
245 testonly = true
kjellandere0629c02017-04-25 04:04:50 -0700246
247 # Skip restricting visibility on mobile platforms since the tests on those
248 # gets additional generated targets which would require many lines here to
249 # cover (which would be confusing to read and hard to maintain).
250 if (!is_android && !is_ios) {
jianjun.zhuc0247402017-07-11 06:20:45 -0700251 visibility = [ "..:rtc_unittests" ]
kjellandere0629c02017-04-25 04:04:50 -0700252 }
ehmaldonadoda8dcfb2017-01-04 07:11:23 -0800253 sources = [
254 "stunprober/stunprober_unittest.cc",
255 ]
256 deps = [
257 ":libstunprober",
kjellander8a116632017-04-21 05:17:08 -0700258 ":p2p_test_utils",
259 ":rtc_p2p",
ehmaldonadof6a861a2017-07-19 10:40:47 -0700260 "../rtc_base:rtc_base",
261 "../rtc_base:rtc_base_tests_utils",
ehmaldonadoda8dcfb2017-01-04 07:11:23 -0800262 "//testing/gmock",
263 "//testing/gtest",
264 ]
265 if (!build_with_chromium && is_clang) {
266 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
267 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
268 }
269 defines = [ "GTEST_RELATIVE_PATH" ]
270 }
271}