blob: 2d351bb0fa2cff038923bf6127e7bf37e5fbb1a7 [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
kjellanderb62dbbe2016-09-23 00:38:52 -070018rtc_static_library("rtc_p2p") {
Per Kjellandera7f2d842018-01-10 15:54:53 +000019 visibility = [ "*" ]
kjellanderc76dc952016-06-03 03:09:32 -070020 sources = [
21 "base/asyncstuntcpsocket.cc",
22 "base/asyncstuntcpsocket.h",
Zach Steine20867f2018-08-02 13:20:15 -070023 "base/basicasyncresolverfactory.cc",
24 "base/basicasyncresolverfactory.h",
kjellanderc76dc952016-06-03 03:09:32 -070025 "base/basicpacketsocketfactory.cc",
26 "base/basicpacketsocketfactory.h",
Mirko Bonadei66972782017-10-12 09:42:07 +020027 "base/candidatepairinterface.h",
zhihuangca6d3b62017-08-23 18:05:50 -070028 "base/dtlstransport.cc",
29 "base/dtlstransport.h",
Steve Anton33f69db2017-10-30 10:01:15 -070030 "base/dtlstransportinternal.cc",
zhihuange50658d2017-01-03 11:34:12 -080031 "base/dtlstransportinternal.h",
Steve Anton33f69db2017-10-30 10:01:15 -070032 "base/icetransportinternal.cc",
zhihuang86abd6f2016-12-19 11:54:05 -080033 "base/icetransportinternal.h",
Qingsi Wang558b93b2018-08-30 10:38:44 -070034 "base/mdns_message.cc",
35 "base/mdns_message.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",
zsteinabbacbf2017-03-20 10:53:12 -070040 "base/packetlossestimator.cc",
41 "base/packetlossestimator.h",
Steve Anton9d4a2e62017-10-26 11:23:08 -070042 "base/packetsocketfactory.cc",
kjellanderc76dc952016-06-03 03:09:32 -070043 "base/packetsocketfactory.h",
johana9c7cfa2016-10-18 15:38:38 -070044 "base/packettransportinterface.h",
Steve Anton33f69db2017-10-30 10:01:15 -070045 "base/packettransportinternal.cc",
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",
Qingsi Wang1b368942018-06-13 13:54:08 -070055 "base/regatheringcontroller.cc",
56 "base/regatheringcontroller.h",
kjellanderc76dc952016-06-03 03:09:32 -070057 "base/relayport.cc",
58 "base/relayport.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",
Zhi Huange818b6e2018-02-22 15:26:27 -080072 "base/transportfactoryinterface.h",
kjellanderc76dc952016-06-03 03:09:32 -070073 "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",
Jonas Oreland202994c2017-12-18 12:10:43 +010081 "client/relayportfactoryinterface.h",
Jonas Oreland202994c2017-12-18 12:10:43 +010082 "client/turnportfactory.cc",
83 "client/turnportfactory.h",
kjellanderc76dc952016-06-03 03:09:32 -070084 ]
85
kjellanderc76dc952016-06-03 03:09:32 -070086 deps = [
kjellander8a116632017-04-21 05:17:08 -070087 "../api:libjingle_peerconnection_api",
88 "../api:ortc_api",
Qingsi Wang93a84392018-01-30 17:13:09 -080089 "../logging:ice_log",
Patrik Höglunda8005cf2017-12-13 16:05:42 +010090 "../rtc_base:checks",
ehmaldonadof6a861a2017-07-19 10:40:47 -070091 "../rtc_base:rtc_base",
Karl Wiberg12edf4c2018-03-07 14:18:56 +010092 "../rtc_base:safe_minmax",
Patrik Höglund3e113432017-12-15 14:40:10 +010093 "../rtc_base:stringutils",
Qingsi Wang09619332018-09-12 22:51:55 -070094 "../rtc_base:weak_ptr",
Artem Titova76af0c2018-07-23 17:38:12 +020095 "../rtc_base/third_party/base64",
Artem Titove41c4332018-07-25 15:04:28 +020096 "../rtc_base/third_party/sigslot",
Mirko Bonadei17f48782018-09-28 08:51:10 +020097 "../system_wrappers:field_trial",
98 "../system_wrappers:metrics",
Karl Wiberg918f50c2018-07-05 11:40:33 +020099 "//third_party/abseil-cpp/absl/memory",
Danil Chapovalov00c71832018-06-15 15:58:38 +0200100 "//third_party/abseil-cpp/absl/types:optional",
kjellanderc76dc952016-06-03 03:09:32 -0700101 ]
102
kjellander5023d412016-06-18 04:23:01 -0700103 if (build_with_chromium) {
104 if (is_nacl) {
105 deps += [ "//native_client_sdk/src/libraries/nacl_io" ]
106 }
107 } else {
108 sources += [
109 "base/relayserver.cc",
110 "base/relayserver.h",
111 "base/stunserver.cc",
112 "base/stunserver.h",
113 "base/turnserver.cc",
114 "base/turnserver.h",
115 ]
kjellanderc76dc952016-06-03 03:09:32 -0700116 }
kjellanderc76dc952016-06-03 03:09:32 -0700117}
118
ehmaldonadoda8dcfb2017-01-04 07:11:23 -0800119if (rtc_include_tests) {
deadbeef59edb922017-04-18 15:49:09 -0700120 rtc_source_set("p2p_test_utils") {
ehmaldonadoda8dcfb2017-01-04 07:11:23 -0800121 testonly = true
122 sources = [
kjellander8a116632017-04-21 05:17:08 -0700123 "base/fakecandidatepair.h",
kjellander98e15312017-03-04 15:08:44 -0800124 "base/fakedtlstransport.h",
125 "base/fakeicetransport.h",
126 "base/fakepackettransport.h",
127 "base/fakeportallocator.h",
Zach Stein6fcdc2f2018-08-23 16:25:55 -0700128 "base/mockasyncresolver.h",
kjellander98e15312017-03-04 15:08:44 -0800129 "base/mockicetransport.h",
deadbeef59edb922017-04-18 15:49:09 -0700130 "base/testrelayserver.h",
Steve Antoneae3e652017-10-25 14:46:18 -0700131 "base/teststunserver.cc",
deadbeef59edb922017-04-18 15:49:09 -0700132 "base/teststunserver.h",
Jonas Orelandbdcee282017-10-10 14:01:40 +0200133 "base/testturncustomizer.h",
deadbeef59edb922017-04-18 15:49:09 -0700134 "base/testturnserver.h",
135 ]
deadbeef59edb922017-04-18 15:49:09 -0700136 deps = [
137 ":rtc_p2p",
Patrik Höglund7aee3d52017-11-15 13:15:17 +0100138 "../api:libjingle_peerconnection_api",
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",
Artem Titove41c4332018-07-25 15:04:28 +0200143 "../rtc_base/third_party/sigslot",
kjellander8a116632017-04-21 05:17:08 -0700144 "../test:test_support",
Karl Wiberg918f50c2018-07-05 11:40:33 +0200145 "//third_party/abseil-cpp/absl/memory",
deadbeef59edb922017-04-18 15:49:09 -0700146 ]
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
deadbeef59edb922017-04-18 15:49:09 -0700152 sources = [
153 "base/asyncstuntcpsocket_unittest.cc",
Zach Steine20867f2018-08-02 13:20:15 -0700154 "base/basicasyncresolverfactory_unittest.cc",
zhihuangca6d3b62017-08-23 18:05:50 -0700155 "base/dtlstransport_unittest.cc",
Qingsi Wang558b93b2018-08-30 10:38:44 -0700156 "base/mdns_message_unittest.cc",
ehmaldonadoda8dcfb2017-01-04 07:11:23 -0800157 "base/p2ptransportchannel_unittest.cc",
zsteinabbacbf2017-03-20 10:53:12 -0700158 "base/packetlossestimator_unittest.cc",
ehmaldonadoda8dcfb2017-01-04 07:11:23 -0800159 "base/port_unittest.cc",
160 "base/portallocator_unittest.cc",
161 "base/pseudotcp_unittest.cc",
Qingsi Wang1b368942018-06-13 13:54:08 -0700162 "base/regatheringcontroller_unittest.cc",
ehmaldonadoda8dcfb2017-01-04 07:11:23 -0800163 "base/relayport_unittest.cc",
164 "base/relayserver_unittest.cc",
165 "base/stun_unittest.cc",
166 "base/stunport_unittest.cc",
167 "base/stunrequest_unittest.cc",
168 "base/stunserver_unittest.cc",
169 "base/tcpport_unittest.cc",
ehmaldonadoda8dcfb2017-01-04 07:11:23 -0800170 "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 ]
ehmaldonadoda8dcfb2017-01-04 07:11:23 -0800176 deps = [
deadbeef59edb922017-04-18 15:49:09 -0700177 ":p2p_test_utils",
ehmaldonadoda8dcfb2017-01-04 07:11:23 -0800178 ":rtc_p2p",
kjellander8a116632017-04-21 05:17:08 -0700179 "../api:ortc_api",
Patrik Höglunda8005cf2017-12-13 16:05:42 +0100180 "../rtc_base:checks",
ehmaldonadof6a861a2017-07-19 10:40:47 -0700181 "../rtc_base:rtc_base",
182 "../rtc_base:rtc_base_approved",
183 "../rtc_base:rtc_base_tests_utils",
Patrik Höglund3e113432017-12-15 14:40:10 +0100184 "../rtc_base:stringutils",
Mirko Bonadei17f48782018-09-28 08:51:10 +0200185 "../system_wrappers:metrics",
kjellander8a116632017-04-21 05:17:08 -0700186 "../test:test_support",
ehmaldonadoda8dcfb2017-01-04 07:11:23 -0800187 "//testing/gtest",
Karl Wiberg918f50c2018-07-05 11:40:33 +0200188 "//third_party/abseil-cpp/absl/memory",
ehmaldonadoda8dcfb2017-01-04 07:11:23 -0800189 ]
190 if (!build_with_chromium && is_clang) {
191 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
192 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
193 }
ehmaldonadoda8dcfb2017-01-04 07:11:23 -0800194 }
195}
196
kjellanderb62dbbe2016-09-23 00:38:52 -0700197rtc_static_library("libstunprober") {
Per Kjellandera7f2d842018-01-10 15:54:53 +0000198 visibility = [ "*" ]
kjellanderc76dc952016-06-03 03:09:32 -0700199 sources = [
200 "stunprober/stunprober.cc",
Mirko Bonadei66972782017-10-12 09:42:07 +0200201 "stunprober/stunprober.h",
kjellanderc76dc952016-06-03 03:09:32 -0700202 ]
203
kjellanderc76dc952016-06-03 03:09:32 -0700204 deps = [
kjellander8a116632017-04-21 05:17:08 -0700205 ":rtc_p2p",
kjellanderc76dc952016-06-03 03:09:32 -0700206 "..:webrtc_common",
Patrik Höglunda8005cf2017-12-13 16:05:42 +0100207 "../rtc_base:checks",
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
ehmaldonadoda8dcfb2017-01-04 07:11:23 -0800216 sources = [
217 "stunprober/stunprober_unittest.cc",
218 ]
219 deps = [
220 ":libstunprober",
kjellander8a116632017-04-21 05:17:08 -0700221 ":p2p_test_utils",
222 ":rtc_p2p",
Patrik Höglunda8005cf2017-12-13 16:05:42 +0100223 "../rtc_base:checks",
ehmaldonadof6a861a2017-07-19 10:40:47 -0700224 "../rtc_base:rtc_base",
225 "../rtc_base:rtc_base_tests_utils",
ehmaldonadoda8dcfb2017-01-04 07:11:23 -0800226 "//testing/gtest",
227 ]
ehmaldonadoda8dcfb2017-01-04 07:11:23 -0800228 }
229}