blob: f6077ff9bb54eba097f63d656e46af7fe2f983dd [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",
51 "base/portinterface.h",
52 "base/pseudotcp.cc",
53 "base/pseudotcp.h",
54 "base/relayport.cc",
55 "base/relayport.h",
kjellander5023d412016-06-18 04:23:01 -070056 "base/session.cc",
57 "base/session.h",
kjellanderc76dc952016-06-03 03:09:32 -070058 "base/sessiondescription.cc",
59 "base/sessiondescription.h",
kjellanderc76dc952016-06-03 03:09:32 -070060 "base/stun.cc",
61 "base/stun.h",
62 "base/stunport.cc",
63 "base/stunport.h",
64 "base/stunrequest.cc",
65 "base/stunrequest.h",
kjellanderc76dc952016-06-03 03:09:32 -070066 "base/tcpport.cc",
67 "base/tcpport.h",
deadbeef57fd7262016-12-06 15:28:55 -080068 "base/transport.h",
kjellanderc76dc952016-06-03 03:09:32 -070069 "base/transportdescription.cc",
70 "base/transportdescription.h",
71 "base/transportdescriptionfactory.cc",
72 "base/transportdescriptionfactory.h",
73 "base/transportinfo.h",
74 "base/turnport.cc",
75 "base/turnport.h",
kjellanderc76dc952016-06-03 03:09:32 -070076 "base/udpport.h",
deadbeefd1c09982017-01-18 15:16:37 -080077 "base/udptransport.cc",
78 "base/udptransport.h",
kjellanderc76dc952016-06-03 03:09:32 -070079 "client/basicportallocator.cc",
80 "client/basicportallocator.h",
kjellanderc76dc952016-06-03 03:09:32 -070081 "client/socketmonitor.cc",
82 "client/socketmonitor.h",
83 ]
84
deadbeef1b54a5f2017-01-23 19:39:57 -080085 defines = []
kjellanderc76dc952016-06-03 03:09:32 -070086
87 deps = [
kjellander8a116632017-04-21 05:17:08 -070088 "../api:libjingle_peerconnection_api",
kwiberg84f6a3f2017-09-05 08:43:13 -070089 "../api:optional",
kjellander8a116632017-04-21 05:17:08 -070090 "../api:ortc_api",
ehmaldonadof6a861a2017-07-19 10:40:47 -070091 "../rtc_base:rtc_base",
kjellander8a116632017-04-21 05:17:08 -070092 "../system_wrappers:field_trial_api",
kjellanderc76dc952016-06-03 03:09:32 -070093 ]
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 }
kjellanderc76dc952016-06-03 03:09:32 -0700120}
121
ehmaldonadoda8dcfb2017-01-04 07:11:23 -0800122if (rtc_include_tests) {
deadbeef59edb922017-04-18 15:49:09 -0700123 rtc_source_set("p2p_test_utils") {
ehmaldonadoda8dcfb2017-01-04 07:11:23 -0800124 testonly = true
125 sources = [
kjellander8a116632017-04-21 05:17:08 -0700126 "base/fakecandidatepair.h",
kjellander98e15312017-03-04 15:08:44 -0800127 "base/fakedtlstransport.h",
128 "base/fakeicetransport.h",
129 "base/fakepackettransport.h",
130 "base/fakeportallocator.h",
kjellander98e15312017-03-04 15:08:44 -0800131 "base/mockicetransport.h",
deadbeef59edb922017-04-18 15:49:09 -0700132 "base/testrelayserver.h",
Steve Antoneae3e652017-10-25 14:46:18 -0700133 "base/teststunserver.cc",
deadbeef59edb922017-04-18 15:49:09 -0700134 "base/teststunserver.h",
Jonas Orelandbdcee282017-10-10 14:01:40 +0200135 "base/testturncustomizer.h",
deadbeef59edb922017-04-18 15:49:09 -0700136 "base/testturnserver.h",
137 ]
deadbeef59edb922017-04-18 15:49:09 -0700138 deps = [
139 ":rtc_p2p",
kjellander8a116632017-04-21 05:17:08 -0700140 "../api:ortc_api",
ehmaldonadof6a861a2017-07-19 10:40:47 -0700141 "../rtc_base:rtc_base",
142 "../rtc_base:rtc_base_approved",
143 "../rtc_base:rtc_base_tests_utils",
kjellander8a116632017-04-21 05:17:08 -0700144 "../test:test_support",
deadbeef59edb922017-04-18 15:49:09 -0700145 "//testing/gmock",
146 ]
deadbeef59edb922017-04-18 15:49:09 -0700147 }
148
149 rtc_source_set("rtc_p2p_unittests") {
150 testonly = true
kjellandere0629c02017-04-25 04:04:50 -0700151
152 # Skip restricting visibility on mobile platforms since the tests on those
153 # gets additional generated targets which would require many lines here to
154 # cover (which would be confusing to read and hard to maintain).
155 if (!is_android && !is_ios) {
jianjun.zhuc0247402017-07-11 06:20:45 -0700156 visibility = [ "..:rtc_unittests" ]
kjellandere0629c02017-04-25 04:04:50 -0700157 }
deadbeef59edb922017-04-18 15:49:09 -0700158 sources = [
159 "base/asyncstuntcpsocket_unittest.cc",
zhihuangca6d3b62017-08-23 18:05:50 -0700160 "base/dtlstransport_unittest.cc",
deadbeef59edb922017-04-18 15:49:09 -0700161 "base/jseptransport_unittest.cc",
ehmaldonadoda8dcfb2017-01-04 07:11:23 -0800162 "base/p2ptransportchannel_unittest.cc",
zsteinabbacbf2017-03-20 10:53:12 -0700163 "base/packetlossestimator_unittest.cc",
ehmaldonadoda8dcfb2017-01-04 07:11:23 -0800164 "base/port_unittest.cc",
165 "base/portallocator_unittest.cc",
166 "base/pseudotcp_unittest.cc",
167 "base/relayport_unittest.cc",
168 "base/relayserver_unittest.cc",
169 "base/stun_unittest.cc",
170 "base/stunport_unittest.cc",
171 "base/stunrequest_unittest.cc",
172 "base/stunserver_unittest.cc",
173 "base/tcpport_unittest.cc",
ehmaldonadoda8dcfb2017-01-04 07:11:23 -0800174 "base/transportdescriptionfactory_unittest.cc",
175 "base/turnport_unittest.cc",
176 "base/turnserver_unittest.cc",
deadbeefd1c09982017-01-18 15:16:37 -0800177 "base/udptransport_unittest.cc",
ehmaldonadoda8dcfb2017-01-04 07:11:23 -0800178 "client/basicportallocator_unittest.cc",
179 ]
ehmaldonadoda8dcfb2017-01-04 07:11:23 -0800180 deps = [
deadbeef59edb922017-04-18 15:49:09 -0700181 ":p2p_test_utils",
ehmaldonadoda8dcfb2017-01-04 07:11:23 -0800182 ":rtc_p2p",
183 "../api:fakemetricsobserver",
kjellander8a116632017-04-21 05:17:08 -0700184 "../api:ortc_api",
ehmaldonadof6a861a2017-07-19 10:40:47 -0700185 "../rtc_base:rtc_base",
186 "../rtc_base:rtc_base_approved",
187 "../rtc_base:rtc_base_tests_utils",
kjellander8a116632017-04-21 05:17:08 -0700188 "../test:test_support",
ehmaldonadoda8dcfb2017-01-04 07:11:23 -0800189 "//testing/gmock",
190 "//testing/gtest",
191 ]
192 if (!build_with_chromium && is_clang) {
193 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
194 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
195 }
196 defines = [ "GTEST_RELATIVE_PATH" ]
197 }
198}
199
kjellanderb62dbbe2016-09-23 00:38:52 -0700200rtc_static_library("libstunprober") {
kjellanderc76dc952016-06-03 03:09:32 -0700201 sources = [
202 "stunprober/stunprober.cc",
Mirko Bonadei66972782017-10-12 09:42:07 +0200203 "stunprober/stunprober.h",
kjellanderc76dc952016-06-03 03:09:32 -0700204 ]
205
kjellanderc76dc952016-06-03 03:09:32 -0700206 deps = [
kjellander8a116632017-04-21 05:17:08 -0700207 ":rtc_p2p",
kjellanderc76dc952016-06-03 03:09:32 -0700208 "..:webrtc_common",
ehmaldonadof6a861a2017-07-19 10:40:47 -0700209 "../rtc_base:rtc_base",
kjellanderc76dc952016-06-03 03:09:32 -0700210 ]
211}
ehmaldonadoda8dcfb2017-01-04 07:11:23 -0800212
213if (rtc_include_tests) {
214 rtc_source_set("libstunprober_unittests") {
215 testonly = true
kjellandere0629c02017-04-25 04:04:50 -0700216
217 # Skip restricting visibility on mobile platforms since the tests on those
218 # gets additional generated targets which would require many lines here to
219 # cover (which would be confusing to read and hard to maintain).
220 if (!is_android && !is_ios) {
jianjun.zhuc0247402017-07-11 06:20:45 -0700221 visibility = [ "..:rtc_unittests" ]
kjellandere0629c02017-04-25 04:04:50 -0700222 }
ehmaldonadoda8dcfb2017-01-04 07:11:23 -0800223 sources = [
224 "stunprober/stunprober_unittest.cc",
225 ]
226 deps = [
227 ":libstunprober",
kjellander8a116632017-04-21 05:17:08 -0700228 ":p2p_test_utils",
229 ":rtc_p2p",
ehmaldonadof6a861a2017-07-19 10:40:47 -0700230 "../rtc_base:rtc_base",
231 "../rtc_base:rtc_base_tests_utils",
ehmaldonadoda8dcfb2017-01-04 07:11:23 -0800232 "//testing/gmock",
233 "//testing/gtest",
234 ]
ehmaldonadoda8dcfb2017-01-04 07:11:23 -0800235 defines = [ "GTEST_RELATIVE_PATH" ]
236 }
237}