blob: 22286c4860bd111279628d6034b8bf95e9e5a629 [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",
kjellanderc76dc952016-06-03 03:09:32 -070043 "base/packetsocketfactory.h",
johana9c7cfa2016-10-18 15:38:38 -070044 "base/packettransportinterface.h",
deadbeef5bd5ca32017-02-10 11:31:50 -080045 "base/packettransportinternal.h",
kjellanderc76dc952016-06-03 03:09:32 -070046 "base/port.cc",
47 "base/port.h",
48 "base/portallocator.cc",
49 "base/portallocator.h",
50 "base/portinterface.h",
51 "base/pseudotcp.cc",
52 "base/pseudotcp.h",
53 "base/relayport.cc",
54 "base/relayport.h",
kjellander5023d412016-06-18 04:23:01 -070055 "base/session.cc",
56 "base/session.h",
kjellanderc76dc952016-06-03 03:09:32 -070057 "base/sessiondescription.cc",
58 "base/sessiondescription.h",
kjellanderc76dc952016-06-03 03:09:32 -070059 "base/stun.cc",
60 "base/stun.h",
61 "base/stunport.cc",
62 "base/stunport.h",
63 "base/stunrequest.cc",
64 "base/stunrequest.h",
kjellanderc76dc952016-06-03 03:09:32 -070065 "base/tcpport.cc",
66 "base/tcpport.h",
deadbeef57fd7262016-12-06 15:28:55 -080067 "base/transport.h",
kjellanderc76dc952016-06-03 03:09:32 -070068 "base/transportdescription.cc",
69 "base/transportdescription.h",
70 "base/transportdescriptionfactory.cc",
71 "base/transportdescriptionfactory.h",
72 "base/transportinfo.h",
73 "base/turnport.cc",
74 "base/turnport.h",
kjellanderc76dc952016-06-03 03:09:32 -070075 "base/udpport.h",
deadbeefd1c09982017-01-18 15:16:37 -080076 "base/udptransport.cc",
77 "base/udptransport.h",
kjellanderc76dc952016-06-03 03:09:32 -070078 "client/basicportallocator.cc",
79 "client/basicportallocator.h",
kjellanderc76dc952016-06-03 03:09:32 -070080 "client/socketmonitor.cc",
81 "client/socketmonitor.h",
82 ]
83
deadbeef1b54a5f2017-01-23 19:39:57 -080084 defines = []
kjellanderc76dc952016-06-03 03:09:32 -070085
86 deps = [
kjellander8a116632017-04-21 05:17:08 -070087 "../api:libjingle_peerconnection_api",
kwiberg84f6a3f2017-09-05 08:43:13 -070088 "../api:optional",
kjellander8a116632017-04-21 05:17:08 -070089 "../api:ortc_api",
ehmaldonadof6a861a2017-07-19 10:40:47 -070090 "../rtc_base:rtc_base",
kjellander8a116632017-04-21 05:17:08 -070091 "../system_wrappers:field_trial_api",
kjellanderc76dc952016-06-03 03:09:32 -070092 ]
93
ehmaldonadoe9cc6862016-09-05 06:10:18 -070094 public_configs = [ ":rtc_p2p_inherited_config" ]
kjellanderc76dc952016-06-03 03:09:32 -070095
kjellander5023d412016-06-18 04:23:01 -070096 if (build_with_chromium) {
97 if (is_nacl) {
98 deps += [ "//native_client_sdk/src/libraries/nacl_io" ]
99 }
100 } else {
101 sources += [
102 "base/relayserver.cc",
103 "base/relayserver.h",
104 "base/stunserver.cc",
105 "base/stunserver.h",
106 "base/turnserver.cc",
107 "base/turnserver.h",
108 ]
kjellanderc76dc952016-06-03 03:09:32 -0700109 defines += [
110 "FEATURE_ENABLE_VOICEMAIL",
111 "FEATURE_ENABLE_PSTN",
112 ]
113
kjellandere40a7ee2016-10-16 23:56:12 -0700114 if (!build_with_chromium && is_clang) {
115 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
ehmaldonado38a21322016-09-02 04:10:34 -0700116 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
kjellanderc76dc952016-06-03 03:09:32 -0700117 }
118 }
kjellanderc76dc952016-06-03 03:09:32 -0700119}
120
ehmaldonadoda8dcfb2017-01-04 07:11:23 -0800121if (rtc_include_tests) {
deadbeef59edb922017-04-18 15:49:09 -0700122 rtc_source_set("p2p_test_utils") {
ehmaldonadoda8dcfb2017-01-04 07:11:23 -0800123 testonly = true
124 sources = [
kjellander8a116632017-04-21 05:17:08 -0700125 "base/fakecandidatepair.h",
kjellander98e15312017-03-04 15:08:44 -0800126 "base/fakedtlstransport.h",
127 "base/fakeicetransport.h",
128 "base/fakepackettransport.h",
129 "base/fakeportallocator.h",
kjellander98e15312017-03-04 15:08:44 -0800130 "base/mockicetransport.h",
deadbeef59edb922017-04-18 15:49:09 -0700131 "base/testrelayserver.h",
Steve Antoneae3e652017-10-25 14:46:18 -0700132 "base/teststunserver.cc",
deadbeef59edb922017-04-18 15:49:09 -0700133 "base/teststunserver.h",
Jonas Orelandbdcee282017-10-10 14:01:40 +0200134 "base/testturncustomizer.h",
deadbeef59edb922017-04-18 15:49:09 -0700135 "base/testturnserver.h",
136 ]
deadbeef59edb922017-04-18 15:49:09 -0700137 deps = [
138 ":rtc_p2p",
kjellander8a116632017-04-21 05:17:08 -0700139 "../api:ortc_api",
ehmaldonadof6a861a2017-07-19 10:40:47 -0700140 "../rtc_base:rtc_base",
141 "../rtc_base:rtc_base_approved",
142 "../rtc_base:rtc_base_tests_utils",
kjellander8a116632017-04-21 05:17:08 -0700143 "../test:test_support",
deadbeef59edb922017-04-18 15:49:09 -0700144 "//testing/gmock",
145 ]
deadbeef59edb922017-04-18 15:49:09 -0700146 }
147
148 rtc_source_set("rtc_p2p_unittests") {
149 testonly = true
kjellandere0629c02017-04-25 04:04:50 -0700150
151 # Skip restricting visibility on mobile platforms since the tests on those
152 # gets additional generated targets which would require many lines here to
153 # cover (which would be confusing to read and hard to maintain).
154 if (!is_android && !is_ios) {
jianjun.zhuc0247402017-07-11 06:20:45 -0700155 visibility = [ "..:rtc_unittests" ]
kjellandere0629c02017-04-25 04:04:50 -0700156 }
deadbeef59edb922017-04-18 15:49:09 -0700157 sources = [
158 "base/asyncstuntcpsocket_unittest.cc",
zhihuangca6d3b62017-08-23 18:05:50 -0700159 "base/dtlstransport_unittest.cc",
deadbeef59edb922017-04-18 15:49:09 -0700160 "base/jseptransport_unittest.cc",
ehmaldonadoda8dcfb2017-01-04 07:11:23 -0800161 "base/p2ptransportchannel_unittest.cc",
zsteinabbacbf2017-03-20 10:53:12 -0700162 "base/packetlossestimator_unittest.cc",
ehmaldonadoda8dcfb2017-01-04 07:11:23 -0800163 "base/port_unittest.cc",
164 "base/portallocator_unittest.cc",
165 "base/pseudotcp_unittest.cc",
166 "base/relayport_unittest.cc",
167 "base/relayserver_unittest.cc",
168 "base/stun_unittest.cc",
169 "base/stunport_unittest.cc",
170 "base/stunrequest_unittest.cc",
171 "base/stunserver_unittest.cc",
172 "base/tcpport_unittest.cc",
ehmaldonadoda8dcfb2017-01-04 07:11:23 -0800173 "base/transportdescriptionfactory_unittest.cc",
174 "base/turnport_unittest.cc",
175 "base/turnserver_unittest.cc",
deadbeefd1c09982017-01-18 15:16:37 -0800176 "base/udptransport_unittest.cc",
ehmaldonadoda8dcfb2017-01-04 07:11:23 -0800177 "client/basicportallocator_unittest.cc",
178 ]
ehmaldonadoda8dcfb2017-01-04 07:11:23 -0800179 deps = [
deadbeef59edb922017-04-18 15:49:09 -0700180 ":p2p_test_utils",
ehmaldonadoda8dcfb2017-01-04 07:11:23 -0800181 ":rtc_p2p",
182 "../api:fakemetricsobserver",
kjellander8a116632017-04-21 05:17:08 -0700183 "../api:ortc_api",
ehmaldonadof6a861a2017-07-19 10:40:47 -0700184 "../rtc_base:rtc_base",
185 "../rtc_base:rtc_base_approved",
186 "../rtc_base:rtc_base_tests_utils",
kjellander8a116632017-04-21 05:17:08 -0700187 "../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 }
197}
198
kjellanderb62dbbe2016-09-23 00:38:52 -0700199rtc_static_library("libstunprober") {
kjellanderc76dc952016-06-03 03:09:32 -0700200 sources = [
201 "stunprober/stunprober.cc",
Mirko Bonadei66972782017-10-12 09:42:07 +0200202 "stunprober/stunprober.h",
kjellanderc76dc952016-06-03 03:09:32 -0700203 ]
204
kjellanderc76dc952016-06-03 03:09:32 -0700205 deps = [
kjellander8a116632017-04-21 05:17:08 -0700206 ":rtc_p2p",
kjellanderc76dc952016-06-03 03:09:32 -0700207 "..:webrtc_common",
ehmaldonadof6a861a2017-07-19 10:40:47 -0700208 "../rtc_base:rtc_base",
kjellanderc76dc952016-06-03 03:09:32 -0700209 ]
210}
ehmaldonadoda8dcfb2017-01-04 07:11:23 -0800211
212if (rtc_include_tests) {
213 rtc_source_set("libstunprober_unittests") {
214 testonly = true
kjellandere0629c02017-04-25 04:04:50 -0700215
216 # Skip restricting visibility on mobile platforms since the tests on those
217 # gets additional generated targets which would require many lines here to
218 # cover (which would be confusing to read and hard to maintain).
219 if (!is_android && !is_ios) {
jianjun.zhuc0247402017-07-11 06:20:45 -0700220 visibility = [ "..:rtc_unittests" ]
kjellandere0629c02017-04-25 04:04:50 -0700221 }
ehmaldonadoda8dcfb2017-01-04 07:11:23 -0800222 sources = [
223 "stunprober/stunprober_unittest.cc",
224 ]
225 deps = [
226 ":libstunprober",
kjellander8a116632017-04-21 05:17:08 -0700227 ":p2p_test_utils",
228 ":rtc_p2p",
ehmaldonadof6a861a2017-07-19 10:40:47 -0700229 "../rtc_base:rtc_base",
230 "../rtc_base:rtc_base_tests_utils",
ehmaldonadoda8dcfb2017-01-04 07:11:23 -0800231 "//testing/gmock",
232 "//testing/gtest",
233 ]
ehmaldonadoda8dcfb2017-01-04 07:11:23 -0800234 defines = [ "GTEST_RELATIVE_PATH" ]
235 }
236}