blob: dc5e6422ed56009bca4be2f49659a01f093969fe [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",
zhihuange50658d2017-01-03 11:34:12 -080033 "base/dtlstransportinternal.h",
zhihuang86abd6f2016-12-19 11:54:05 -080034 "base/icetransportinternal.h",
deadbeef49f34fd2016-12-06 16:22:06 -080035 "base/jseptransport.cc",
36 "base/jseptransport.h",
kjellanderc76dc952016-06-03 03:09:32 -070037 "base/p2pconstants.cc",
38 "base/p2pconstants.h",
kjellanderc76dc952016-06-03 03:09:32 -070039 "base/p2ptransportchannel.cc",
40 "base/p2ptransportchannel.h",
zsteinabbacbf2017-03-20 10:53:12 -070041 "base/packetlossestimator.cc",
42 "base/packetlossestimator.h",
Steve Anton9d4a2e62017-10-26 11:23:08 -070043 "base/packetsocketfactory.cc",
kjellanderc76dc952016-06-03 03:09:32 -070044 "base/packetsocketfactory.h",
johana9c7cfa2016-10-18 15:38:38 -070045 "base/packettransportinterface.h",
deadbeef5bd5ca32017-02-10 11:31:50 -080046 "base/packettransportinternal.h",
kjellanderc76dc952016-06-03 03:09:32 -070047 "base/port.cc",
48 "base/port.h",
49 "base/portallocator.cc",
50 "base/portallocator.h",
Steve Anton1cf1b7d2017-10-30 10:00:15 -070051 "base/portinterface.cc",
kjellanderc76dc952016-06-03 03:09:32 -070052 "base/portinterface.h",
53 "base/pseudotcp.cc",
54 "base/pseudotcp.h",
55 "base/relayport.cc",
56 "base/relayport.h",
kjellander5023d412016-06-18 04:23:01 -070057 "base/session.cc",
58 "base/session.h",
kjellanderc76dc952016-06-03 03:09:32 -070059 "base/sessiondescription.cc",
60 "base/sessiondescription.h",
kjellanderc76dc952016-06-03 03:09:32 -070061 "base/stun.cc",
62 "base/stun.h",
63 "base/stunport.cc",
64 "base/stunport.h",
65 "base/stunrequest.cc",
66 "base/stunrequest.h",
kjellanderc76dc952016-06-03 03:09:32 -070067 "base/tcpport.cc",
68 "base/tcpport.h",
deadbeef57fd7262016-12-06 15:28:55 -080069 "base/transport.h",
kjellanderc76dc952016-06-03 03:09:32 -070070 "base/transportdescription.cc",
71 "base/transportdescription.h",
72 "base/transportdescriptionfactory.cc",
73 "base/transportdescriptionfactory.h",
74 "base/transportinfo.h",
75 "base/turnport.cc",
76 "base/turnport.h",
kjellanderc76dc952016-06-03 03:09:32 -070077 "base/udpport.h",
deadbeefd1c09982017-01-18 15:16:37 -080078 "base/udptransport.cc",
79 "base/udptransport.h",
kjellanderc76dc952016-06-03 03:09:32 -070080 "client/basicportallocator.cc",
81 "client/basicportallocator.h",
kjellanderc76dc952016-06-03 03:09:32 -070082 "client/socketmonitor.cc",
83 "client/socketmonitor.h",
84 ]
85
deadbeef1b54a5f2017-01-23 19:39:57 -080086 defines = []
kjellanderc76dc952016-06-03 03:09:32 -070087
88 deps = [
kjellander8a116632017-04-21 05:17:08 -070089 "../api:libjingle_peerconnection_api",
kwiberg84f6a3f2017-09-05 08:43:13 -070090 "../api:optional",
kjellander8a116632017-04-21 05:17:08 -070091 "../api:ortc_api",
ehmaldonadof6a861a2017-07-19 10:40:47 -070092 "../rtc_base:rtc_base",
kjellander8a116632017-04-21 05:17:08 -070093 "../system_wrappers:field_trial_api",
kjellanderc76dc952016-06-03 03:09:32 -070094 ]
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 }
kjellanderc76dc952016-06-03 03:09:32 -0700121}
122
ehmaldonadoda8dcfb2017-01-04 07:11:23 -0800123if (rtc_include_tests) {
deadbeef59edb922017-04-18 15:49:09 -0700124 rtc_source_set("p2p_test_utils") {
ehmaldonadoda8dcfb2017-01-04 07:11:23 -0800125 testonly = true
126 sources = [
kjellander8a116632017-04-21 05:17:08 -0700127 "base/fakecandidatepair.h",
kjellander98e15312017-03-04 15:08:44 -0800128 "base/fakedtlstransport.h",
129 "base/fakeicetransport.h",
130 "base/fakepackettransport.h",
131 "base/fakeportallocator.h",
kjellander98e15312017-03-04 15:08:44 -0800132 "base/mockicetransport.h",
deadbeef59edb922017-04-18 15:49:09 -0700133 "base/testrelayserver.h",
Steve Antoneae3e652017-10-25 14:46:18 -0700134 "base/teststunserver.cc",
deadbeef59edb922017-04-18 15:49:09 -0700135 "base/teststunserver.h",
Jonas Orelandbdcee282017-10-10 14:01:40 +0200136 "base/testturncustomizer.h",
deadbeef59edb922017-04-18 15:49:09 -0700137 "base/testturnserver.h",
138 ]
deadbeef59edb922017-04-18 15:49:09 -0700139 deps = [
140 ":rtc_p2p",
kjellander8a116632017-04-21 05:17:08 -0700141 "../api:ortc_api",
ehmaldonadof6a861a2017-07-19 10:40:47 -0700142 "../rtc_base:rtc_base",
143 "../rtc_base:rtc_base_approved",
144 "../rtc_base:rtc_base_tests_utils",
kjellander8a116632017-04-21 05:17:08 -0700145 "../test:test_support",
deadbeef59edb922017-04-18 15:49:09 -0700146 "//testing/gmock",
147 ]
deadbeef59edb922017-04-18 15:49:09 -0700148 }
149
150 rtc_source_set("rtc_p2p_unittests") {
151 testonly = true
kjellandere0629c02017-04-25 04:04:50 -0700152
153 # Skip restricting visibility on mobile platforms since the tests on those
154 # gets additional generated targets which would require many lines here to
155 # cover (which would be confusing to read and hard to maintain).
156 if (!is_android && !is_ios) {
jianjun.zhuc0247402017-07-11 06:20:45 -0700157 visibility = [ "..:rtc_unittests" ]
kjellandere0629c02017-04-25 04:04:50 -0700158 }
deadbeef59edb922017-04-18 15:49:09 -0700159 sources = [
160 "base/asyncstuntcpsocket_unittest.cc",
zhihuangca6d3b62017-08-23 18:05:50 -0700161 "base/dtlstransport_unittest.cc",
deadbeef59edb922017-04-18 15:49:09 -0700162 "base/jseptransport_unittest.cc",
ehmaldonadoda8dcfb2017-01-04 07:11:23 -0800163 "base/p2ptransportchannel_unittest.cc",
zsteinabbacbf2017-03-20 10:53:12 -0700164 "base/packetlossestimator_unittest.cc",
ehmaldonadoda8dcfb2017-01-04 07:11:23 -0800165 "base/port_unittest.cc",
166 "base/portallocator_unittest.cc",
167 "base/pseudotcp_unittest.cc",
168 "base/relayport_unittest.cc",
169 "base/relayserver_unittest.cc",
170 "base/stun_unittest.cc",
171 "base/stunport_unittest.cc",
172 "base/stunrequest_unittest.cc",
173 "base/stunserver_unittest.cc",
174 "base/tcpport_unittest.cc",
ehmaldonadoda8dcfb2017-01-04 07:11:23 -0800175 "base/transportdescriptionfactory_unittest.cc",
176 "base/turnport_unittest.cc",
177 "base/turnserver_unittest.cc",
deadbeefd1c09982017-01-18 15:16:37 -0800178 "base/udptransport_unittest.cc",
ehmaldonadoda8dcfb2017-01-04 07:11:23 -0800179 "client/basicportallocator_unittest.cc",
180 ]
ehmaldonadoda8dcfb2017-01-04 07:11:23 -0800181 deps = [
deadbeef59edb922017-04-18 15:49:09 -0700182 ":p2p_test_utils",
ehmaldonadoda8dcfb2017-01-04 07:11:23 -0800183 ":rtc_p2p",
184 "../api:fakemetricsobserver",
kjellander8a116632017-04-21 05:17:08 -0700185 "../api:ortc_api",
ehmaldonadof6a861a2017-07-19 10:40:47 -0700186 "../rtc_base:rtc_base",
187 "../rtc_base:rtc_base_approved",
188 "../rtc_base:rtc_base_tests_utils",
kjellander8a116632017-04-21 05:17:08 -0700189 "../test:test_support",
ehmaldonadoda8dcfb2017-01-04 07:11:23 -0800190 "//testing/gmock",
191 "//testing/gtest",
192 ]
193 if (!build_with_chromium && is_clang) {
194 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
195 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
196 }
197 defines = [ "GTEST_RELATIVE_PATH" ]
198 }
199}
200
kjellanderb62dbbe2016-09-23 00:38:52 -0700201rtc_static_library("libstunprober") {
kjellanderc76dc952016-06-03 03:09:32 -0700202 sources = [
203 "stunprober/stunprober.cc",
Mirko Bonadei66972782017-10-12 09:42:07 +0200204 "stunprober/stunprober.h",
kjellanderc76dc952016-06-03 03:09:32 -0700205 ]
206
kjellanderc76dc952016-06-03 03:09:32 -0700207 deps = [
kjellander8a116632017-04-21 05:17:08 -0700208 ":rtc_p2p",
kjellanderc76dc952016-06-03 03:09:32 -0700209 "..:webrtc_common",
ehmaldonadof6a861a2017-07-19 10:40:47 -0700210 "../rtc_base:rtc_base",
kjellanderc76dc952016-06-03 03:09:32 -0700211 ]
212}
ehmaldonadoda8dcfb2017-01-04 07:11:23 -0800213
214if (rtc_include_tests) {
215 rtc_source_set("libstunprober_unittests") {
216 testonly = true
kjellandere0629c02017-04-25 04:04:50 -0700217
218 # Skip restricting visibility on mobile platforms since the tests on those
219 # gets additional generated targets which would require many lines here to
220 # cover (which would be confusing to read and hard to maintain).
221 if (!is_android && !is_ios) {
jianjun.zhuc0247402017-07-11 06:20:45 -0700222 visibility = [ "..:rtc_unittests" ]
kjellandere0629c02017-04-25 04:04:50 -0700223 }
ehmaldonadoda8dcfb2017-01-04 07:11:23 -0800224 sources = [
225 "stunprober/stunprober_unittest.cc",
226 ]
227 deps = [
228 ":libstunprober",
kjellander8a116632017-04-21 05:17:08 -0700229 ":p2p_test_utils",
230 ":rtc_p2p",
ehmaldonadof6a861a2017-07-19 10:40:47 -0700231 "../rtc_base:rtc_base",
232 "../rtc_base:rtc_base_tests_utils",
ehmaldonadoda8dcfb2017-01-04 07:11:23 -0800233 "//testing/gmock",
234 "//testing/gtest",
235 ]
ehmaldonadoda8dcfb2017-01-04 07:11:23 -0800236 defines = [ "GTEST_RELATIVE_PATH" ]
237 }
238}