blob: f0033f19d3a617a2916576eda905267c2978c2f3 [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",
Jonas Oreland1cd39fa2018-10-11 07:47:12 +020032 "base/icecredentialsiterator.cc",
33 "base/icecredentialsiterator.h",
Steve Anton33f69db2017-10-30 10:01:15 -070034 "base/icetransportinternal.cc",
zhihuang86abd6f2016-12-19 11:54:05 -080035 "base/icetransportinternal.h",
Qingsi Wang558b93b2018-08-30 10:38:44 -070036 "base/mdns_message.cc",
37 "base/mdns_message.h",
kjellanderc76dc952016-06-03 03:09:32 -070038 "base/p2pconstants.cc",
39 "base/p2pconstants.h",
kjellanderc76dc952016-06-03 03:09:32 -070040 "base/p2ptransportchannel.cc",
41 "base/p2ptransportchannel.h",
zsteinabbacbf2017-03-20 10:53:12 -070042 "base/packetlossestimator.cc",
43 "base/packetlossestimator.h",
Steve Anton9d4a2e62017-10-26 11:23:08 -070044 "base/packetsocketfactory.cc",
kjellanderc76dc952016-06-03 03:09:32 -070045 "base/packetsocketfactory.h",
johana9c7cfa2016-10-18 15:38:38 -070046 "base/packettransportinterface.h",
Steve Anton33f69db2017-10-30 10:01:15 -070047 "base/packettransportinternal.cc",
deadbeef5bd5ca32017-02-10 11:31:50 -080048 "base/packettransportinternal.h",
kjellanderc76dc952016-06-03 03:09:32 -070049 "base/port.cc",
50 "base/port.h",
51 "base/portallocator.cc",
52 "base/portallocator.h",
Steve Anton1cf1b7d2017-10-30 10:00:15 -070053 "base/portinterface.cc",
kjellanderc76dc952016-06-03 03:09:32 -070054 "base/portinterface.h",
55 "base/pseudotcp.cc",
56 "base/pseudotcp.h",
Qingsi Wang1b368942018-06-13 13:54:08 -070057 "base/regatheringcontroller.cc",
58 "base/regatheringcontroller.h",
kjellanderc76dc952016-06-03 03:09:32 -070059 "base/relayport.cc",
60 "base/relayport.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",
Zhi Huange818b6e2018-02-22 15:26:27 -080074 "base/transportfactoryinterface.h",
kjellanderc76dc952016-06-03 03:09:32 -070075 "base/transportinfo.h",
76 "base/turnport.cc",
77 "base/turnport.h",
kjellanderc76dc952016-06-03 03:09:32 -070078 "base/udpport.h",
79 "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",
Jonas Olsson81125f02018-10-09 10:52:04 +020089 "../api/transport:enums",
Qingsi Wang93a84392018-01-30 17:13:09 -080090 "../logging:ice_log",
Patrik Höglunda8005cf2017-12-13 16:05:42 +010091 "../rtc_base:checks",
ehmaldonadof6a861a2017-07-19 10:40:47 -070092 "../rtc_base:rtc_base",
Karl Wiberg12edf4c2018-03-07 14:18:56 +010093 "../rtc_base:safe_minmax",
Patrik Höglund3e113432017-12-15 14:40:10 +010094 "../rtc_base:stringutils",
Qingsi Wang09619332018-09-12 22:51:55 -070095 "../rtc_base:weak_ptr",
Mirko Bonadei3b56ee72018-10-15 17:15:12 +020096 "../rtc_base/system:rtc_export",
Artem Titova76af0c2018-07-23 17:38:12 +020097 "../rtc_base/third_party/base64",
Artem Titove41c4332018-07-25 15:04:28 +020098 "../rtc_base/third_party/sigslot",
Mirko Bonadei17f48782018-09-28 08:51:10 +020099 "../system_wrappers:field_trial",
100 "../system_wrappers:metrics",
Karl Wiberg918f50c2018-07-05 11:40:33 +0200101 "//third_party/abseil-cpp/absl/memory",
Niels Möller3c7d5992018-10-19 15:29:54 +0200102 "//third_party/abseil-cpp/absl/strings",
Danil Chapovalov00c71832018-06-15 15:58:38 +0200103 "//third_party/abseil-cpp/absl/types:optional",
kjellanderc76dc952016-06-03 03:09:32 -0700104 ]
105
kjellander5023d412016-06-18 04:23:01 -0700106 if (build_with_chromium) {
107 if (is_nacl) {
108 deps += [ "//native_client_sdk/src/libraries/nacl_io" ]
109 }
Oleh Prypin4191a812018-10-25 07:58:30 +0000110 } else {
111 sources += [
112 "base/relayserver.cc",
113 "base/relayserver.h",
114 "base/stunserver.cc",
115 "base/stunserver.h",
116 "base/turnserver.cc",
117 "base/turnserver.h",
118 ]
kjellanderc76dc952016-06-03 03:09:32 -0700119 }
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",
Zach Stein6fcdc2f2018-08-23 16:25:55 -0700131 "base/mockasyncresolver.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",
Patrik Höglund7aee3d52017-11-15 13:15:17 +0100141 "../api:libjingle_peerconnection_api",
kjellander8a116632017-04-21 05:17:08 -0700142 "../api:ortc_api",
ehmaldonadof6a861a2017-07-19 10:40:47 -0700143 "../rtc_base:rtc_base",
144 "../rtc_base:rtc_base_approved",
145 "../rtc_base:rtc_base_tests_utils",
Artem Titove41c4332018-07-25 15:04:28 +0200146 "../rtc_base/third_party/sigslot",
kjellander8a116632017-04-21 05:17:08 -0700147 "../test:test_support",
Karl Wiberg918f50c2018-07-05 11:40:33 +0200148 "//third_party/abseil-cpp/absl/memory",
deadbeef59edb922017-04-18 15:49:09 -0700149 ]
deadbeef59edb922017-04-18 15:49:09 -0700150 }
151
152 rtc_source_set("rtc_p2p_unittests") {
153 testonly = true
kjellandere0629c02017-04-25 04:04:50 -0700154
deadbeef59edb922017-04-18 15:49:09 -0700155 sources = [
156 "base/asyncstuntcpsocket_unittest.cc",
Zach Steine20867f2018-08-02 13:20:15 -0700157 "base/basicasyncresolverfactory_unittest.cc",
zhihuangca6d3b62017-08-23 18:05:50 -0700158 "base/dtlstransport_unittest.cc",
Jonas Oreland1cd39fa2018-10-11 07:47:12 +0200159 "base/icecredentialsiterator_unittest.cc",
Qingsi Wang558b93b2018-08-30 10:38:44 -0700160 "base/mdns_message_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",
Qingsi Wang1b368942018-06-13 13:54:08 -0700166 "base/regatheringcontroller_unittest.cc",
ehmaldonadoda8dcfb2017-01-04 07:11:23 -0800167 "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",
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",
kjellander8a116632017-04-21 05:17:08 -0700182 "../api:ortc_api",
Patrik Höglunda8005cf2017-12-13 16:05:42 +0100183 "../rtc_base:checks",
ehmaldonadof6a861a2017-07-19 10:40:47 -0700184 "../rtc_base:rtc_base",
185 "../rtc_base:rtc_base_approved",
186 "../rtc_base:rtc_base_tests_utils",
Patrik Höglund3e113432017-12-15 14:40:10 +0100187 "../rtc_base:stringutils",
Mirko Bonadei17f48782018-09-28 08:51:10 +0200188 "../system_wrappers:metrics",
kjellander8a116632017-04-21 05:17:08 -0700189 "../test:test_support",
ehmaldonadoda8dcfb2017-01-04 07:11:23 -0800190 "//testing/gtest",
Karl Wiberg918f50c2018-07-05 11:40:33 +0200191 "//third_party/abseil-cpp/absl/memory",
ehmaldonadoda8dcfb2017-01-04 07:11:23 -0800192 ]
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 }
ehmaldonadoda8dcfb2017-01-04 07:11:23 -0800197 }
198}
199
kjellanderb62dbbe2016-09-23 00:38:52 -0700200rtc_static_library("libstunprober") {
Per Kjellandera7f2d842018-01-10 15:54:53 +0000201 visibility = [ "*" ]
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",
Patrik Höglunda8005cf2017-12-13 16:05:42 +0100210 "../rtc_base:checks",
ehmaldonadof6a861a2017-07-19 10:40:47 -0700211 "../rtc_base:rtc_base",
Mirko Bonadeid65d1792018-10-17 16:50:07 +0200212 "../rtc_base/system:rtc_export",
kjellanderc76dc952016-06-03 03:09:32 -0700213 ]
214}
ehmaldonadoda8dcfb2017-01-04 07:11:23 -0800215
216if (rtc_include_tests) {
217 rtc_source_set("libstunprober_unittests") {
218 testonly = true
kjellandere0629c02017-04-25 04:04:50 -0700219
ehmaldonadoda8dcfb2017-01-04 07:11:23 -0800220 sources = [
221 "stunprober/stunprober_unittest.cc",
222 ]
223 deps = [
224 ":libstunprober",
kjellander8a116632017-04-21 05:17:08 -0700225 ":p2p_test_utils",
226 ":rtc_p2p",
Patrik Höglunda8005cf2017-12-13 16:05:42 +0100227 "../rtc_base:checks",
ehmaldonadof6a861a2017-07-19 10:40:47 -0700228 "../rtc_base:rtc_base",
229 "../rtc_base:rtc_base_tests_utils",
ehmaldonadoda8dcfb2017-01-04 07:11:23 -0800230 "//testing/gtest",
231 ]
ehmaldonadoda8dcfb2017-01-04 07:11:23 -0800232 }
233}