blob: dba55777e4d3fbb0751b8578af58223b984e7ae2 [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",
Mirko Bonadei66972782017-10-12 09:42:07 +020029 "base/candidatepairinterface.h",
kjellanderc76dc952016-06-03 03:09:32 -070030 "base/common.h",
zhihuangca6d3b62017-08-23 18:05:50 -070031 "base/dtlstransport.cc",
32 "base/dtlstransport.h",
Steve Anton33f69db2017-10-30 10:01:15 -070033 "base/dtlstransportinternal.cc",
zhihuange50658d2017-01-03 11:34:12 -080034 "base/dtlstransportinternal.h",
Steve Anton33f69db2017-10-30 10:01:15 -070035 "base/icetransportinternal.cc",
zhihuang86abd6f2016-12-19 11:54:05 -080036 "base/icetransportinternal.h",
deadbeef49f34fd2016-12-06 16:22:06 -080037 "base/jseptransport.cc",
38 "base/jseptransport.h",
kjellanderc76dc952016-06-03 03:09:32 -070039 "base/p2pconstants.cc",
40 "base/p2pconstants.h",
kjellanderc76dc952016-06-03 03:09:32 -070041 "base/p2ptransportchannel.cc",
42 "base/p2ptransportchannel.h",
zsteinabbacbf2017-03-20 10:53:12 -070043 "base/packetlossestimator.cc",
44 "base/packetlossestimator.h",
Steve Anton9d4a2e62017-10-26 11:23:08 -070045 "base/packetsocketfactory.cc",
kjellanderc76dc952016-06-03 03:09:32 -070046 "base/packetsocketfactory.h",
johana9c7cfa2016-10-18 15:38:38 -070047 "base/packettransportinterface.h",
Steve Anton33f69db2017-10-30 10:01:15 -070048 "base/packettransportinternal.cc",
deadbeef5bd5ca32017-02-10 11:31:50 -080049 "base/packettransportinternal.h",
kjellanderc76dc952016-06-03 03:09:32 -070050 "base/port.cc",
51 "base/port.h",
52 "base/portallocator.cc",
53 "base/portallocator.h",
Steve Anton1cf1b7d2017-10-30 10:00:15 -070054 "base/portinterface.cc",
kjellanderc76dc952016-06-03 03:09:32 -070055 "base/portinterface.h",
56 "base/pseudotcp.cc",
57 "base/pseudotcp.h",
58 "base/relayport.cc",
59 "base/relayport.h",
kjellander5023d412016-06-18 04:23:01 -070060 "base/session.cc",
61 "base/session.h",
kjellanderc76dc952016-06-03 03:09:32 -070062 "base/sessiondescription.cc",
63 "base/sessiondescription.h",
kjellanderc76dc952016-06-03 03:09:32 -070064 "base/stun.cc",
65 "base/stun.h",
66 "base/stunport.cc",
67 "base/stunport.h",
68 "base/stunrequest.cc",
69 "base/stunrequest.h",
kjellanderc76dc952016-06-03 03:09:32 -070070 "base/tcpport.cc",
71 "base/tcpport.h",
deadbeef57fd7262016-12-06 15:28:55 -080072 "base/transport.h",
kjellanderc76dc952016-06-03 03:09:32 -070073 "base/transportdescription.cc",
74 "base/transportdescription.h",
75 "base/transportdescriptionfactory.cc",
76 "base/transportdescriptionfactory.h",
77 "base/transportinfo.h",
78 "base/turnport.cc",
79 "base/turnport.h",
kjellanderc76dc952016-06-03 03:09:32 -070080 "base/udpport.h",
deadbeefd1c09982017-01-18 15:16:37 -080081 "base/udptransport.cc",
82 "base/udptransport.h",
kjellanderc76dc952016-06-03 03:09:32 -070083 "client/basicportallocator.cc",
84 "client/basicportallocator.h",
kjellanderc76dc952016-06-03 03:09:32 -070085 "client/socketmonitor.cc",
86 "client/socketmonitor.h",
87 ]
88
deadbeef1b54a5f2017-01-23 19:39:57 -080089 defines = []
kjellanderc76dc952016-06-03 03:09:32 -070090
91 deps = [
kjellander8a116632017-04-21 05:17:08 -070092 "../api:libjingle_peerconnection_api",
kwiberg84f6a3f2017-09-05 08:43:13 -070093 "../api:optional",
kjellander8a116632017-04-21 05:17:08 -070094 "../api:ortc_api",
ehmaldonadof6a861a2017-07-19 10:40:47 -070095 "../rtc_base:rtc_base",
kjellander8a116632017-04-21 05:17:08 -070096 "../system_wrappers:field_trial_api",
kjellanderc76dc952016-06-03 03:09:32 -070097 ]
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 }
kjellanderc76dc952016-06-03 03:09:32 -0700124}
125
ehmaldonadoda8dcfb2017-01-04 07:11:23 -0800126if (rtc_include_tests) {
deadbeef59edb922017-04-18 15:49:09 -0700127 rtc_source_set("p2p_test_utils") {
ehmaldonadoda8dcfb2017-01-04 07:11:23 -0800128 testonly = true
129 sources = [
kjellander8a116632017-04-21 05:17:08 -0700130 "base/fakecandidatepair.h",
kjellander98e15312017-03-04 15:08:44 -0800131 "base/fakedtlstransport.h",
132 "base/fakeicetransport.h",
133 "base/fakepackettransport.h",
134 "base/fakeportallocator.h",
kjellander98e15312017-03-04 15:08:44 -0800135 "base/mockicetransport.h",
deadbeef59edb922017-04-18 15:49:09 -0700136 "base/testrelayserver.h",
Steve Antoneae3e652017-10-25 14:46:18 -0700137 "base/teststunserver.cc",
deadbeef59edb922017-04-18 15:49:09 -0700138 "base/teststunserver.h",
Jonas Orelandbdcee282017-10-10 14:01:40 +0200139 "base/testturncustomizer.h",
deadbeef59edb922017-04-18 15:49:09 -0700140 "base/testturnserver.h",
141 ]
deadbeef59edb922017-04-18 15:49:09 -0700142 deps = [
143 ":rtc_p2p",
kjellander8a116632017-04-21 05:17:08 -0700144 "../api:ortc_api",
ehmaldonadof6a861a2017-07-19 10:40:47 -0700145 "../rtc_base:rtc_base",
146 "../rtc_base:rtc_base_approved",
147 "../rtc_base:rtc_base_tests_utils",
kjellander8a116632017-04-21 05:17:08 -0700148 "../test:test_support",
deadbeef59edb922017-04-18 15:49:09 -0700149 "//testing/gmock",
150 ]
deadbeef59edb922017-04-18 15:49:09 -0700151 }
152
153 rtc_source_set("rtc_p2p_unittests") {
154 testonly = true
kjellandere0629c02017-04-25 04:04:50 -0700155
156 # Skip restricting visibility on mobile platforms since the tests on those
157 # gets additional generated targets which would require many lines here to
158 # cover (which would be confusing to read and hard to maintain).
159 if (!is_android && !is_ios) {
jianjun.zhuc0247402017-07-11 06:20:45 -0700160 visibility = [ "..:rtc_unittests" ]
kjellandere0629c02017-04-25 04:04:50 -0700161 }
deadbeef59edb922017-04-18 15:49:09 -0700162 sources = [
163 "base/asyncstuntcpsocket_unittest.cc",
zhihuangca6d3b62017-08-23 18:05:50 -0700164 "base/dtlstransport_unittest.cc",
deadbeef59edb922017-04-18 15:49:09 -0700165 "base/jseptransport_unittest.cc",
ehmaldonadoda8dcfb2017-01-04 07:11:23 -0800166 "base/p2ptransportchannel_unittest.cc",
zsteinabbacbf2017-03-20 10:53:12 -0700167 "base/packetlossestimator_unittest.cc",
ehmaldonadoda8dcfb2017-01-04 07:11:23 -0800168 "base/port_unittest.cc",
169 "base/portallocator_unittest.cc",
170 "base/pseudotcp_unittest.cc",
171 "base/relayport_unittest.cc",
172 "base/relayserver_unittest.cc",
173 "base/stun_unittest.cc",
174 "base/stunport_unittest.cc",
175 "base/stunrequest_unittest.cc",
176 "base/stunserver_unittest.cc",
177 "base/tcpport_unittest.cc",
ehmaldonadoda8dcfb2017-01-04 07:11:23 -0800178 "base/transportdescriptionfactory_unittest.cc",
179 "base/turnport_unittest.cc",
180 "base/turnserver_unittest.cc",
deadbeefd1c09982017-01-18 15:16:37 -0800181 "base/udptransport_unittest.cc",
ehmaldonadoda8dcfb2017-01-04 07:11:23 -0800182 "client/basicportallocator_unittest.cc",
183 ]
ehmaldonadoda8dcfb2017-01-04 07:11:23 -0800184 deps = [
deadbeef59edb922017-04-18 15:49:09 -0700185 ":p2p_test_utils",
ehmaldonadoda8dcfb2017-01-04 07:11:23 -0800186 ":rtc_p2p",
187 "../api:fakemetricsobserver",
kjellander8a116632017-04-21 05:17:08 -0700188 "../api:ortc_api",
ehmaldonadof6a861a2017-07-19 10:40:47 -0700189 "../rtc_base:rtc_base",
190 "../rtc_base:rtc_base_approved",
191 "../rtc_base:rtc_base_tests_utils",
kjellander8a116632017-04-21 05:17:08 -0700192 "../test:test_support",
ehmaldonadoda8dcfb2017-01-04 07:11:23 -0800193 "//testing/gmock",
194 "//testing/gtest",
195 ]
196 if (!build_with_chromium && is_clang) {
197 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
198 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
199 }
200 defines = [ "GTEST_RELATIVE_PATH" ]
201 }
202}
203
kjellanderb62dbbe2016-09-23 00:38:52 -0700204rtc_static_library("libstunprober") {
kjellanderc76dc952016-06-03 03:09:32 -0700205 sources = [
206 "stunprober/stunprober.cc",
Mirko Bonadei66972782017-10-12 09:42:07 +0200207 "stunprober/stunprober.h",
kjellanderc76dc952016-06-03 03:09:32 -0700208 ]
209
kjellanderc76dc952016-06-03 03:09:32 -0700210 deps = [
kjellander8a116632017-04-21 05:17:08 -0700211 ":rtc_p2p",
kjellanderc76dc952016-06-03 03:09:32 -0700212 "..:webrtc_common",
ehmaldonadof6a861a2017-07-19 10:40:47 -0700213 "../rtc_base:rtc_base",
kjellanderc76dc952016-06-03 03:09:32 -0700214 ]
215}
ehmaldonadoda8dcfb2017-01-04 07:11:23 -0800216
217if (rtc_include_tests) {
218 rtc_source_set("libstunprober_unittests") {
219 testonly = true
kjellandere0629c02017-04-25 04:04:50 -0700220
221 # Skip restricting visibility on mobile platforms since the tests on those
222 # gets additional generated targets which would require many lines here to
223 # cover (which would be confusing to read and hard to maintain).
224 if (!is_android && !is_ios) {
jianjun.zhuc0247402017-07-11 06:20:45 -0700225 visibility = [ "..:rtc_unittests" ]
kjellandere0629c02017-04-25 04:04:50 -0700226 }
ehmaldonadoda8dcfb2017-01-04 07:11:23 -0800227 sources = [
228 "stunprober/stunprober_unittest.cc",
229 ]
230 deps = [
231 ":libstunprober",
kjellander8a116632017-04-21 05:17:08 -0700232 ":p2p_test_utils",
233 ":rtc_p2p",
ehmaldonadof6a861a2017-07-19 10:40:47 -0700234 "../rtc_base:rtc_base",
235 "../rtc_base:rtc_base_tests_utils",
ehmaldonadoda8dcfb2017-01-04 07:11:23 -0800236 "//testing/gmock",
237 "//testing/gtest",
238 ]
ehmaldonadoda8dcfb2017-01-04 07:11:23 -0800239 defines = [ "GTEST_RELATIVE_PATH" ]
240 }
241}