blob: 6f65bba6eafe1cad7f1e2d9e33d4197d0e0bd072 [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",
40 "base/packetsocketfactory.h",
johana9c7cfa2016-10-18 15:38:38 -070041 "base/packettransportinterface.h",
deadbeef5bd5ca32017-02-10 11:31:50 -080042 "base/packettransportinternal.h",
kjellanderc76dc952016-06-03 03:09:32 -070043 "base/port.cc",
44 "base/port.h",
45 "base/portallocator.cc",
46 "base/portallocator.h",
47 "base/portinterface.h",
48 "base/pseudotcp.cc",
49 "base/pseudotcp.h",
50 "base/relayport.cc",
51 "base/relayport.h",
kjellander5023d412016-06-18 04:23:01 -070052 "base/session.cc",
53 "base/session.h",
kjellanderc76dc952016-06-03 03:09:32 -070054 "base/sessiondescription.cc",
55 "base/sessiondescription.h",
kjellanderc76dc952016-06-03 03:09:32 -070056 "base/stun.cc",
57 "base/stun.h",
58 "base/stunport.cc",
59 "base/stunport.h",
60 "base/stunrequest.cc",
61 "base/stunrequest.h",
kjellanderc76dc952016-06-03 03:09:32 -070062 "base/tcpport.cc",
63 "base/tcpport.h",
deadbeef57fd7262016-12-06 15:28:55 -080064 "base/transport.h",
kjellanderc76dc952016-06-03 03:09:32 -070065 "base/transportcontroller.cc",
66 "base/transportcontroller.h",
67 "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 = [
kjellanderc9515b62017-03-04 13:47:44 -080086 "../api:libjingle_peerconnection_api",
87 "../api:ortc_api",
kjellanderc76dc952016-06-03 03:09:32 -070088 "../base:rtc_base",
kjellanderc9515b62017-03-04 13:47:44 -080089 "../system_wrappers",
kjellanderc76dc952016-06-03 03:09:32 -070090 ]
91
92 if (rtc_build_expat) {
93 deps += [ "//third_party/expat" ]
94 public_deps = [
95 "//third_party/expat",
96 ]
97 }
98
ehmaldonadoe9cc6862016-09-05 06:10:18 -070099 public_configs = [ ":rtc_p2p_inherited_config" ]
kjellanderc76dc952016-06-03 03:09:32 -0700100
kjellander5023d412016-06-18 04:23:01 -0700101 if (build_with_chromium) {
102 if (is_nacl) {
103 deps += [ "//native_client_sdk/src/libraries/nacl_io" ]
104 }
105 } else {
106 sources += [
107 "base/relayserver.cc",
108 "base/relayserver.h",
109 "base/stunserver.cc",
110 "base/stunserver.h",
111 "base/turnserver.cc",
112 "base/turnserver.h",
113 ]
kjellanderc76dc952016-06-03 03:09:32 -0700114 defines += [
115 "FEATURE_ENABLE_VOICEMAIL",
116 "FEATURE_ENABLE_PSTN",
117 ]
118
kjellandere40a7ee2016-10-16 23:56:12 -0700119 if (!build_with_chromium && is_clang) {
120 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
ehmaldonado38a21322016-09-02 04:10:34 -0700121 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
kjellanderc76dc952016-06-03 03:09:32 -0700122 }
123 }
124
125 if (rtc_use_quic) {
126 deps = [
127 "//third_party/libquic",
128 ]
129 sources += [
130 "quic/quicconnectionhelper.cc",
131 "quic/quicconnectionhelper.h",
132 "quic/quicsession.cc",
133 "quic/quicsession.h",
134 "quic/quictransport.cc",
135 "quic/quictransport.h",
136 "quic/quictransportchannel.cc",
137 "quic/quictransportchannel.h",
138 "quic/reliablequicstream.cc",
139 "quic/reliablequicstream.h",
140 ]
141 public_deps += [ "//third_party/libquic" ]
142 }
143}
144
ehmaldonadoda8dcfb2017-01-04 07:11:23 -0800145if (rtc_include_tests) {
146 rtc_source_set("rtc_p2p_unittests") {
147 testonly = true
148 sources = [
149 "base/asyncstuntcpsocket_unittest.cc",
150 "base/dtlstransportchannel_unittest.cc",
ehmaldonadoda8dcfb2017-01-04 07:11:23 -0800151 "base/jseptransport_unittest.cc",
152 "base/p2ptransportchannel_unittest.cc",
153 "base/port_unittest.cc",
154 "base/portallocator_unittest.cc",
155 "base/pseudotcp_unittest.cc",
156 "base/relayport_unittest.cc",
157 "base/relayserver_unittest.cc",
158 "base/stun_unittest.cc",
159 "base/stunport_unittest.cc",
160 "base/stunrequest_unittest.cc",
161 "base/stunserver_unittest.cc",
162 "base/tcpport_unittest.cc",
ehmaldonadoda8dcfb2017-01-04 07:11:23 -0800163 "base/transportcontroller_unittest.cc",
164 "base/transportdescriptionfactory_unittest.cc",
165 "base/turnport_unittest.cc",
166 "base/turnserver_unittest.cc",
deadbeefd1c09982017-01-18 15:16:37 -0800167 "base/udptransport_unittest.cc",
ehmaldonadoda8dcfb2017-01-04 07:11:23 -0800168 "client/basicportallocator_unittest.cc",
169 ]
170 if (rtc_use_quic) {
171 sources += [
172 "quic/quicconnectionhelper_unittest.cc",
173 "quic/quicsession_unittest.cc",
174 "quic/quictransport_unittest.cc",
175 "quic/quictransportchannel_unittest.cc",
176 "quic/reliablequicstream_unittest.cc",
177 ]
178 }
179 deps = [
180 ":rtc_p2p",
kjellanderc9515b62017-03-04 13:47:44 -0800181 ":rtc_p2p_test_utils",
ehmaldonadoda8dcfb2017-01-04 07:11:23 -0800182 "../api:fakemetricsobserver",
kjellanderc9515b62017-03-04 13:47:44 -0800183 "../api:ortc_api",
184 "../base:rtc_base",
185 "../base:rtc_base_approved",
186 "../base:rtc_base_tests_utils",
187 "../test:test_support",
ehmaldonadoda8dcfb2017-01-04 07:11:23 -0800188 "//testing/gmock",
189 "//testing/gtest",
190 ]
191 if (!build_with_chromium && is_clang) {
192 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
193 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
194 }
195 defines = [ "GTEST_RELATIVE_PATH" ]
196 }
kjellanderc9515b62017-03-04 13:47:44 -0800197
198 rtc_source_set("rtc_p2p_test_utils") {
199 testonly = true
200 sources = [
201 "base/fakecandidatepair.h",
202 "base/fakedtlstransport.h",
203 "base/fakeicetransport.h",
204 "base/fakepackettransport.h",
205 "base/fakeportallocator.h",
206 "base/faketransportcontroller.h",
207 "base/mockicetransport.h",
208 "base/testrelayserver.h",
209 "base/teststunserver.h",
210 "base/testturnserver.h",
211 ]
212 deps = [
213 ":rtc_p2p",
214 "../api:ortc_api",
215 "../base:rtc_base",
216 "../base:rtc_base_approved",
217 "../base:rtc_base_tests_utils",
218 "../test:test_support",
219 ]
220 }
ehmaldonadoda8dcfb2017-01-04 07:11:23 -0800221}
222
kjellanderb62dbbe2016-09-23 00:38:52 -0700223rtc_static_library("libstunprober") {
kjellanderc76dc952016-06-03 03:09:32 -0700224 sources = [
225 "stunprober/stunprober.cc",
226 ]
227
228 if (!build_with_chromium && is_clang) {
229 # Suppress warnings from Chrome's Clang plugins.
230 # See http://code.google.com/p/webrtc/issues/detail?id=163 for details.
ehmaldonado38a21322016-09-02 04:10:34 -0700231 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
kjellanderc76dc952016-06-03 03:09:32 -0700232 }
233
234 deps = [
kjellanderc9515b62017-03-04 13:47:44 -0800235 ":rtc_p2p",
kjellanderc76dc952016-06-03 03:09:32 -0700236 "..:webrtc_common",
237 "../base:rtc_base",
238 ]
239}
ehmaldonadoda8dcfb2017-01-04 07:11:23 -0800240
241if (rtc_include_tests) {
242 rtc_source_set("libstunprober_unittests") {
243 testonly = true
244 sources = [
245 "stunprober/stunprober_unittest.cc",
246 ]
247 deps = [
248 ":libstunprober",
kjellanderc9515b62017-03-04 13:47:44 -0800249 ":rtc_p2p",
250 ":rtc_p2p_test_utils",
251 "../base:rtc_base",
252 "../base:rtc_base_tests_utils",
ehmaldonadoda8dcfb2017-01-04 07:11:23 -0800253 "//testing/gmock",
254 "//testing/gtest",
255 ]
256 if (!build_with_chromium && is_clang) {
257 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
258 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
259 }
260 defines = [ "GTEST_RELATIVE_PATH" ]
261 }
262}