blob: 9967b1212ea9c64d67a544df9b58004a133df837 [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",
kjellanderc76dc952016-06-03 03:09:32 -070042 "base/port.cc",
43 "base/port.h",
44 "base/portallocator.cc",
45 "base/portallocator.h",
46 "base/portinterface.h",
47 "base/pseudotcp.cc",
48 "base/pseudotcp.h",
49 "base/relayport.cc",
50 "base/relayport.h",
kjellander5023d412016-06-18 04:23:01 -070051 "base/session.cc",
52 "base/session.h",
kjellanderc76dc952016-06-03 03:09:32 -070053 "base/sessiondescription.cc",
54 "base/sessiondescription.h",
kjellanderc76dc952016-06-03 03:09:32 -070055 "base/stun.cc",
56 "base/stun.h",
57 "base/stunport.cc",
58 "base/stunport.h",
59 "base/stunrequest.cc",
60 "base/stunrequest.h",
kjellanderc76dc952016-06-03 03:09:32 -070061 "base/tcpport.cc",
62 "base/tcpport.h",
deadbeef57fd7262016-12-06 15:28:55 -080063 "base/transport.h",
kjellanderc76dc952016-06-03 03:09:32 -070064 "base/transportcontroller.cc",
65 "base/transportcontroller.h",
66 "base/transportdescription.cc",
67 "base/transportdescription.h",
68 "base/transportdescriptionfactory.cc",
69 "base/transportdescriptionfactory.h",
70 "base/transportinfo.h",
71 "base/turnport.cc",
72 "base/turnport.h",
kjellanderc76dc952016-06-03 03:09:32 -070073 "base/udpport.h",
deadbeefd1c09982017-01-18 15:16:37 -080074 "base/udptransport.cc",
75 "base/udptransport.h",
kjellanderc76dc952016-06-03 03:09:32 -070076 "client/basicportallocator.cc",
77 "client/basicportallocator.h",
kjellanderc76dc952016-06-03 03:09:32 -070078 "client/socketmonitor.cc",
79 "client/socketmonitor.h",
80 ]
81
deadbeef1b54a5f2017-01-23 19:39:57 -080082 defines = []
kjellanderc76dc952016-06-03 03:09:32 -070083
84 deps = [
85 "../base:rtc_base",
kjellanderc76dc952016-06-03 03:09:32 -070086 ]
87
88 if (rtc_build_expat) {
89 deps += [ "//third_party/expat" ]
90 public_deps = [
91 "//third_party/expat",
92 ]
93 }
94
ehmaldonadoe9cc6862016-09-05 06:10:18 -070095 public_configs = [ ":rtc_p2p_inherited_config" ]
kjellanderc76dc952016-06-03 03:09:32 -070096
kjellander5023d412016-06-18 04:23:01 -070097 if (build_with_chromium) {
98 if (is_nacl) {
99 deps += [ "//native_client_sdk/src/libraries/nacl_io" ]
100 }
101 } else {
102 sources += [
103 "base/relayserver.cc",
104 "base/relayserver.h",
105 "base/stunserver.cc",
106 "base/stunserver.h",
107 "base/turnserver.cc",
108 "base/turnserver.h",
109 ]
kjellanderc76dc952016-06-03 03:09:32 -0700110 defines += [
111 "FEATURE_ENABLE_VOICEMAIL",
112 "FEATURE_ENABLE_PSTN",
113 ]
114
kjellandere40a7ee2016-10-16 23:56:12 -0700115 if (!build_with_chromium && is_clang) {
116 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
ehmaldonado38a21322016-09-02 04:10:34 -0700117 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
kjellanderc76dc952016-06-03 03:09:32 -0700118 }
119 }
120
121 if (rtc_use_quic) {
122 deps = [
123 "//third_party/libquic",
124 ]
125 sources += [
126 "quic/quicconnectionhelper.cc",
127 "quic/quicconnectionhelper.h",
128 "quic/quicsession.cc",
129 "quic/quicsession.h",
130 "quic/quictransport.cc",
131 "quic/quictransport.h",
132 "quic/quictransportchannel.cc",
133 "quic/quictransportchannel.h",
134 "quic/reliablequicstream.cc",
135 "quic/reliablequicstream.h",
136 ]
137 public_deps += [ "//third_party/libquic" ]
138 }
139}
140
ehmaldonadoda8dcfb2017-01-04 07:11:23 -0800141if (rtc_include_tests) {
142 rtc_source_set("rtc_p2p_unittests") {
143 testonly = true
144 sources = [
145 "base/asyncstuntcpsocket_unittest.cc",
146 "base/dtlstransportchannel_unittest.cc",
deadbeeff5346592017-01-24 21:51:21 -0800147 "base/fakedtlstransport.h",
148 "base/fakeicetransport.h",
149 "base/fakepackettransport.h",
ehmaldonadoda8dcfb2017-01-04 07:11:23 -0800150 "base/fakeportallocator.h",
151 "base/faketransportcontroller.h",
152 "base/jseptransport_unittest.cc",
zhihuang1a619cd2017-01-05 12:21:52 -0800153 "base/mockicetransport.h",
ehmaldonadoda8dcfb2017-01-04 07:11:23 -0800154 "base/p2ptransportchannel_unittest.cc",
155 "base/port_unittest.cc",
156 "base/portallocator_unittest.cc",
157 "base/pseudotcp_unittest.cc",
158 "base/relayport_unittest.cc",
159 "base/relayserver_unittest.cc",
160 "base/stun_unittest.cc",
161 "base/stunport_unittest.cc",
162 "base/stunrequest_unittest.cc",
163 "base/stunserver_unittest.cc",
164 "base/tcpport_unittest.cc",
165 "base/testrelayserver.h",
166 "base/teststunserver.h",
167 "base/testturnserver.h",
168 "base/transportcontroller_unittest.cc",
169 "base/transportdescriptionfactory_unittest.cc",
170 "base/turnport_unittest.cc",
171 "base/turnserver_unittest.cc",
deadbeefd1c09982017-01-18 15:16:37 -0800172 "base/udptransport_unittest.cc",
ehmaldonadoda8dcfb2017-01-04 07:11:23 -0800173 "client/basicportallocator_unittest.cc",
174 ]
175 if (rtc_use_quic) {
176 sources += [
177 "quic/quicconnectionhelper_unittest.cc",
178 "quic/quicsession_unittest.cc",
179 "quic/quictransport_unittest.cc",
180 "quic/quictransportchannel_unittest.cc",
181 "quic/reliablequicstream_unittest.cc",
182 ]
183 }
184 deps = [
185 ":rtc_p2p",
186 "../api:fakemetricsobserver",
187 "//testing/gmock",
188 "//testing/gtest",
189 ]
190 if (!build_with_chromium && is_clang) {
191 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
192 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
193 }
194 defines = [ "GTEST_RELATIVE_PATH" ]
195 }
196}
197
kjellanderb62dbbe2016-09-23 00:38:52 -0700198rtc_static_library("libstunprober") {
kjellanderc76dc952016-06-03 03:09:32 -0700199 sources = [
200 "stunprober/stunprober.cc",
201 ]
202
203 if (!build_with_chromium && is_clang) {
204 # Suppress warnings from Chrome's Clang plugins.
205 # See http://code.google.com/p/webrtc/issues/detail?id=163 for details.
ehmaldonado38a21322016-09-02 04:10:34 -0700206 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
kjellanderc76dc952016-06-03 03:09:32 -0700207 }
208
209 deps = [
210 "..:webrtc_common",
211 "../base:rtc_base",
212 ]
213}
ehmaldonadoda8dcfb2017-01-04 07:11:23 -0800214
215if (rtc_include_tests) {
216 rtc_source_set("libstunprober_unittests") {
217 testonly = true
218 sources = [
219 "stunprober/stunprober_unittest.cc",
220 ]
221 deps = [
222 ":libstunprober",
223 "//testing/gmock",
224 "//testing/gtest",
225 ]
226 if (!build_with_chromium && is_clang) {
227 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
228 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
229 }
230 defines = [ "GTEST_RELATIVE_PATH" ]
231 }
232}