blob: e4770cc46267b7702a2dfce8482b87bf2ecd2536 [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",
28 "base/candidate.h",
29 "base/common.h",
30 "base/dtlstransportchannel.cc",
31 "base/dtlstransportchannel.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/transportcontroller.cc",
68 "base/transportcontroller.h",
69 "base/transportdescription.cc",
70 "base/transportdescription.h",
71 "base/transportdescriptionfactory.cc",
72 "base/transportdescriptionfactory.h",
73 "base/transportinfo.h",
74 "base/turnport.cc",
75 "base/turnport.h",
kjellanderc76dc952016-06-03 03:09:32 -070076 "base/udpport.h",
deadbeefd1c09982017-01-18 15:16:37 -080077 "base/udptransport.cc",
78 "base/udptransport.h",
kjellanderc76dc952016-06-03 03:09:32 -070079 "client/basicportallocator.cc",
80 "client/basicportallocator.h",
kjellanderc76dc952016-06-03 03:09:32 -070081 "client/socketmonitor.cc",
82 "client/socketmonitor.h",
83 ]
84
deadbeef1b54a5f2017-01-23 19:39:57 -080085 defines = []
kjellanderc76dc952016-06-03 03:09:32 -070086
87 deps = [
kjellander8a116632017-04-21 05:17:08 -070088 "../api:libjingle_peerconnection_api",
89 "../api:ortc_api",
kjellanderc76dc952016-06-03 03:09:32 -070090 "../base:rtc_base",
kjellander8a116632017-04-21 05:17:08 -070091 "../system_wrappers:field_trial_api",
kjellanderc76dc952016-06-03 03:09:32 -070092 ]
93
ehmaldonadoe9cc6862016-09-05 06:10:18 -070094 public_configs = [ ":rtc_p2p_inherited_config" ]
kjellanderc76dc952016-06-03 03:09:32 -070095
kjellander5023d412016-06-18 04:23:01 -070096 if (build_with_chromium) {
97 if (is_nacl) {
98 deps += [ "//native_client_sdk/src/libraries/nacl_io" ]
99 }
100 } else {
101 sources += [
102 "base/relayserver.cc",
103 "base/relayserver.h",
104 "base/stunserver.cc",
105 "base/stunserver.h",
106 "base/turnserver.cc",
107 "base/turnserver.h",
108 ]
kjellanderc76dc952016-06-03 03:09:32 -0700109 defines += [
110 "FEATURE_ENABLE_VOICEMAIL",
111 "FEATURE_ENABLE_PSTN",
112 ]
113
kjellandere40a7ee2016-10-16 23:56:12 -0700114 if (!build_with_chromium && is_clang) {
115 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
ehmaldonado38a21322016-09-02 04:10:34 -0700116 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
kjellanderc76dc952016-06-03 03:09:32 -0700117 }
118 }
119
120 if (rtc_use_quic) {
121 deps = [
122 "//third_party/libquic",
123 ]
124 sources += [
125 "quic/quicconnectionhelper.cc",
126 "quic/quicconnectionhelper.h",
127 "quic/quicsession.cc",
128 "quic/quicsession.h",
129 "quic/quictransport.cc",
130 "quic/quictransport.h",
131 "quic/quictransportchannel.cc",
132 "quic/quictransportchannel.h",
133 "quic/reliablequicstream.cc",
134 "quic/reliablequicstream.h",
135 ]
136 public_deps += [ "//third_party/libquic" ]
137 }
138}
139
ehmaldonadoda8dcfb2017-01-04 07:11:23 -0800140if (rtc_include_tests) {
deadbeef59edb922017-04-18 15:49:09 -0700141 rtc_source_set("p2p_test_utils") {
ehmaldonadoda8dcfb2017-01-04 07:11:23 -0800142 testonly = true
143 sources = [
kjellander8a116632017-04-21 05:17:08 -0700144 "base/fakecandidatepair.h",
kjellander98e15312017-03-04 15:08:44 -0800145 "base/fakedtlstransport.h",
146 "base/fakeicetransport.h",
147 "base/fakepackettransport.h",
148 "base/fakeportallocator.h",
149 "base/faketransportcontroller.h",
kjellander98e15312017-03-04 15:08:44 -0800150 "base/mockicetransport.h",
deadbeef59edb922017-04-18 15:49:09 -0700151 "base/testrelayserver.h",
152 "base/teststunserver.h",
153 "base/testturnserver.h",
154 ]
deadbeef59edb922017-04-18 15:49:09 -0700155 deps = [
156 ":rtc_p2p",
kjellander8a116632017-04-21 05:17:08 -0700157 "../api:ortc_api",
158 "../base:rtc_base",
159 "../base:rtc_base_approved",
160 "../base:rtc_base_tests_utils",
161 "../test:test_support",
deadbeef59edb922017-04-18 15:49:09 -0700162 "//testing/gmock",
163 ]
deadbeef59edb922017-04-18 15:49:09 -0700164 }
165
166 rtc_source_set("rtc_p2p_unittests") {
167 testonly = true
168 sources = [
169 "base/asyncstuntcpsocket_unittest.cc",
170 "base/dtlstransportchannel_unittest.cc",
171 "base/jseptransport_unittest.cc",
ehmaldonadoda8dcfb2017-01-04 07:11:23 -0800172 "base/p2ptransportchannel_unittest.cc",
zsteinabbacbf2017-03-20 10:53:12 -0700173 "base/packetlossestimator_unittest.cc",
ehmaldonadoda8dcfb2017-01-04 07:11:23 -0800174 "base/port_unittest.cc",
175 "base/portallocator_unittest.cc",
176 "base/pseudotcp_unittest.cc",
177 "base/relayport_unittest.cc",
178 "base/relayserver_unittest.cc",
179 "base/stun_unittest.cc",
180 "base/stunport_unittest.cc",
181 "base/stunrequest_unittest.cc",
182 "base/stunserver_unittest.cc",
183 "base/tcpport_unittest.cc",
ehmaldonadoda8dcfb2017-01-04 07:11:23 -0800184 "base/transportcontroller_unittest.cc",
185 "base/transportdescriptionfactory_unittest.cc",
186 "base/turnport_unittest.cc",
187 "base/turnserver_unittest.cc",
deadbeefd1c09982017-01-18 15:16:37 -0800188 "base/udptransport_unittest.cc",
ehmaldonadoda8dcfb2017-01-04 07:11:23 -0800189 "client/basicportallocator_unittest.cc",
190 ]
191 if (rtc_use_quic) {
192 sources += [
193 "quic/quicconnectionhelper_unittest.cc",
194 "quic/quicsession_unittest.cc",
195 "quic/quictransport_unittest.cc",
196 "quic/quictransportchannel_unittest.cc",
197 "quic/reliablequicstream_unittest.cc",
198 ]
199 }
200 deps = [
deadbeef59edb922017-04-18 15:49:09 -0700201 ":p2p_test_utils",
ehmaldonadoda8dcfb2017-01-04 07:11:23 -0800202 ":rtc_p2p",
203 "../api:fakemetricsobserver",
kjellander8a116632017-04-21 05:17:08 -0700204 "../api:ortc_api",
205 "../base:rtc_base",
206 "../base:rtc_base_approved",
207 "../base:rtc_base_tests_utils",
208 "../test:test_support",
ehmaldonadoda8dcfb2017-01-04 07:11:23 -0800209 "//testing/gmock",
210 "//testing/gtest",
211 ]
212 if (!build_with_chromium && is_clang) {
213 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
214 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
215 }
216 defines = [ "GTEST_RELATIVE_PATH" ]
217 }
218}
219
kjellanderb62dbbe2016-09-23 00:38:52 -0700220rtc_static_library("libstunprober") {
kjellanderc76dc952016-06-03 03:09:32 -0700221 sources = [
222 "stunprober/stunprober.cc",
223 ]
224
225 if (!build_with_chromium && is_clang) {
226 # Suppress warnings from Chrome's Clang plugins.
227 # See http://code.google.com/p/webrtc/issues/detail?id=163 for details.
ehmaldonado38a21322016-09-02 04:10:34 -0700228 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
kjellanderc76dc952016-06-03 03:09:32 -0700229 }
230
231 deps = [
kjellander8a116632017-04-21 05:17:08 -0700232 ":rtc_p2p",
kjellanderc76dc952016-06-03 03:09:32 -0700233 "..:webrtc_common",
234 "../base:rtc_base",
235 ]
236}
ehmaldonadoda8dcfb2017-01-04 07:11:23 -0800237
238if (rtc_include_tests) {
239 rtc_source_set("libstunprober_unittests") {
240 testonly = true
241 sources = [
242 "stunprober/stunprober_unittest.cc",
243 ]
244 deps = [
245 ":libstunprober",
kjellander8a116632017-04-21 05:17:08 -0700246 ":p2p_test_utils",
247 ":rtc_p2p",
248 "../base:rtc_base",
249 "../base:rtc_base_tests_utils",
ehmaldonadoda8dcfb2017-01-04 07:11:23 -0800250 "//testing/gmock",
251 "//testing/gtest",
252 ]
253 if (!build_with_chromium && is_clang) {
254 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
255 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
256 }
257 defines = [ "GTEST_RELATIVE_PATH" ]
258 }
259}