blob: 07fcdf44f83f0a4d317e4bd2c5b838a60adc36bd [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 = [
86 "../base:rtc_base",
kjellanderc76dc952016-06-03 03:09:32 -070087 ]
88
89 if (rtc_build_expat) {
90 deps += [ "//third_party/expat" ]
91 public_deps = [
92 "//third_party/expat",
93 ]
94 }
95
ehmaldonadoe9cc6862016-09-05 06:10:18 -070096 public_configs = [ ":rtc_p2p_inherited_config" ]
kjellanderc76dc952016-06-03 03:09:32 -070097
kjellander5023d412016-06-18 04:23:01 -070098 if (build_with_chromium) {
99 if (is_nacl) {
100 deps += [ "//native_client_sdk/src/libraries/nacl_io" ]
101 }
102 } else {
103 sources += [
104 "base/relayserver.cc",
105 "base/relayserver.h",
106 "base/stunserver.cc",
107 "base/stunserver.h",
108 "base/turnserver.cc",
109 "base/turnserver.h",
110 ]
kjellanderc76dc952016-06-03 03:09:32 -0700111 defines += [
112 "FEATURE_ENABLE_VOICEMAIL",
113 "FEATURE_ENABLE_PSTN",
114 ]
115
kjellandere40a7ee2016-10-16 23:56:12 -0700116 if (!build_with_chromium && is_clang) {
117 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
ehmaldonado38a21322016-09-02 04:10:34 -0700118 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
kjellanderc76dc952016-06-03 03:09:32 -0700119 }
120 }
121
122 if (rtc_use_quic) {
123 deps = [
124 "//third_party/libquic",
125 ]
126 sources += [
127 "quic/quicconnectionhelper.cc",
128 "quic/quicconnectionhelper.h",
129 "quic/quicsession.cc",
130 "quic/quicsession.h",
131 "quic/quictransport.cc",
132 "quic/quictransport.h",
133 "quic/quictransportchannel.cc",
134 "quic/quictransportchannel.h",
135 "quic/reliablequicstream.cc",
136 "quic/reliablequicstream.h",
137 ]
138 public_deps += [ "//third_party/libquic" ]
139 }
140}
141
ehmaldonadoda8dcfb2017-01-04 07:11:23 -0800142if (rtc_include_tests) {
143 rtc_source_set("rtc_p2p_unittests") {
144 testonly = true
145 sources = [
146 "base/asyncstuntcpsocket_unittest.cc",
147 "base/dtlstransportchannel_unittest.cc",
kjellander98e15312017-03-04 15:08:44 -0800148 "base/fakedtlstransport.h",
149 "base/fakeicetransport.h",
150 "base/fakepackettransport.h",
151 "base/fakeportallocator.h",
152 "base/faketransportcontroller.h",
ehmaldonadoda8dcfb2017-01-04 07:11:23 -0800153 "base/jseptransport_unittest.cc",
kjellander98e15312017-03-04 15:08:44 -0800154 "base/mockicetransport.h",
ehmaldonadoda8dcfb2017-01-04 07:11:23 -0800155 "base/p2ptransportchannel_unittest.cc",
156 "base/port_unittest.cc",
157 "base/portallocator_unittest.cc",
158 "base/pseudotcp_unittest.cc",
159 "base/relayport_unittest.cc",
160 "base/relayserver_unittest.cc",
161 "base/stun_unittest.cc",
162 "base/stunport_unittest.cc",
163 "base/stunrequest_unittest.cc",
164 "base/stunserver_unittest.cc",
165 "base/tcpport_unittest.cc",
kjellander98e15312017-03-04 15:08:44 -0800166 "base/testrelayserver.h",
167 "base/teststunserver.h",
168 "base/testturnserver.h",
ehmaldonadoda8dcfb2017-01-04 07:11:23 -0800169 "base/transportcontroller_unittest.cc",
170 "base/transportdescriptionfactory_unittest.cc",
171 "base/turnport_unittest.cc",
172 "base/turnserver_unittest.cc",
deadbeefd1c09982017-01-18 15:16:37 -0800173 "base/udptransport_unittest.cc",
ehmaldonadoda8dcfb2017-01-04 07:11:23 -0800174 "client/basicportallocator_unittest.cc",
175 ]
176 if (rtc_use_quic) {
177 sources += [
178 "quic/quicconnectionhelper_unittest.cc",
179 "quic/quicsession_unittest.cc",
180 "quic/quictransport_unittest.cc",
181 "quic/quictransportchannel_unittest.cc",
182 "quic/reliablequicstream_unittest.cc",
183 ]
184 }
185 deps = [
186 ":rtc_p2p",
187 "../api:fakemetricsobserver",
188 "//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 }
197}
198
kjellanderb62dbbe2016-09-23 00:38:52 -0700199rtc_static_library("libstunprober") {
kjellanderc76dc952016-06-03 03:09:32 -0700200 sources = [
201 "stunprober/stunprober.cc",
202 ]
203
204 if (!build_with_chromium && is_clang) {
205 # Suppress warnings from Chrome's Clang plugins.
206 # See http://code.google.com/p/webrtc/issues/detail?id=163 for details.
ehmaldonado38a21322016-09-02 04:10:34 -0700207 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
kjellanderc76dc952016-06-03 03:09:32 -0700208 }
209
210 deps = [
211 "..:webrtc_common",
212 "../base:rtc_base",
213 ]
214}
ehmaldonadoda8dcfb2017-01-04 07:11:23 -0800215
216if (rtc_include_tests) {
217 rtc_source_set("libstunprober_unittests") {
218 testonly = true
219 sources = [
220 "stunprober/stunprober_unittest.cc",
221 ]
222 deps = [
223 ":libstunprober",
224 "//testing/gmock",
225 "//testing/gtest",
226 ]
227 if (!build_with_chromium && is_clang) {
228 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
229 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
230 }
231 defines = [ "GTEST_RELATIVE_PATH" ]
232 }
233}