blob: a2f51608d4d47b662eb90956ae0ac42f345bdca3 [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",
23 "base/basicpacketsocketfactory.cc",
24 "base/basicpacketsocketfactory.h",
Mirko Bonadei66972782017-10-12 09:42:07 +020025 "base/candidatepairinterface.h",
zhihuangca6d3b62017-08-23 18:05:50 -070026 "base/dtlstransport.cc",
27 "base/dtlstransport.h",
Steve Anton33f69db2017-10-30 10:01:15 -070028 "base/dtlstransportinternal.cc",
zhihuange50658d2017-01-03 11:34:12 -080029 "base/dtlstransportinternal.h",
Steve Anton33f69db2017-10-30 10:01:15 -070030 "base/icetransportinternal.cc",
zhihuang86abd6f2016-12-19 11:54:05 -080031 "base/icetransportinternal.h",
kjellanderc76dc952016-06-03 03:09:32 -070032 "base/p2pconstants.cc",
33 "base/p2pconstants.h",
kjellanderc76dc952016-06-03 03:09:32 -070034 "base/p2ptransportchannel.cc",
35 "base/p2ptransportchannel.h",
zsteinabbacbf2017-03-20 10:53:12 -070036 "base/packetlossestimator.cc",
37 "base/packetlossestimator.h",
Steve Anton9d4a2e62017-10-26 11:23:08 -070038 "base/packetsocketfactory.cc",
kjellanderc76dc952016-06-03 03:09:32 -070039 "base/packetsocketfactory.h",
johana9c7cfa2016-10-18 15:38:38 -070040 "base/packettransportinterface.h",
Steve Anton33f69db2017-10-30 10:01:15 -070041 "base/packettransportinternal.cc",
deadbeef5bd5ca32017-02-10 11:31:50 -080042 "base/packettransportinternal.h",
kjellanderc76dc952016-06-03 03:09:32 -070043 "base/port.cc",
44 "base/port.h",
45 "base/portallocator.cc",
46 "base/portallocator.h",
Steve Anton1cf1b7d2017-10-30 10:00:15 -070047 "base/portinterface.cc",
kjellanderc76dc952016-06-03 03:09:32 -070048 "base/portinterface.h",
49 "base/pseudotcp.cc",
50 "base/pseudotcp.h",
Qingsi Wang1b368942018-06-13 13:54:08 -070051 "base/regatheringcontroller.cc",
52 "base/regatheringcontroller.h",
kjellanderc76dc952016-06-03 03:09:32 -070053 "base/relayport.cc",
54 "base/relayport.h",
kjellanderc76dc952016-06-03 03:09:32 -070055 "base/stun.cc",
56 "base/stun.h",
57 "base/stunport.cc",
58 "base/stunport.h",
59 "base/stunrequest.cc",
60 "base/stunrequest.h",
kjellanderc76dc952016-06-03 03:09:32 -070061 "base/tcpport.cc",
62 "base/tcpport.h",
deadbeef57fd7262016-12-06 15:28:55 -080063 "base/transport.h",
kjellanderc76dc952016-06-03 03:09:32 -070064 "base/transportdescription.cc",
65 "base/transportdescription.h",
66 "base/transportdescriptionfactory.cc",
67 "base/transportdescriptionfactory.h",
Zhi Huange818b6e2018-02-22 15:26:27 -080068 "base/transportfactoryinterface.h",
kjellanderc76dc952016-06-03 03:09:32 -070069 "base/transportinfo.h",
70 "base/turnport.cc",
71 "base/turnport.h",
kjellanderc76dc952016-06-03 03:09:32 -070072 "base/udpport.h",
deadbeefd1c09982017-01-18 15:16:37 -080073 "base/udptransport.cc",
74 "base/udptransport.h",
kjellanderc76dc952016-06-03 03:09:32 -070075 "client/basicportallocator.cc",
76 "client/basicportallocator.h",
Jonas Oreland202994c2017-12-18 12:10:43 +010077 "client/relayportfactoryinterface.h",
Jonas Oreland202994c2017-12-18 12:10:43 +010078 "client/turnportfactory.cc",
79 "client/turnportfactory.h",
kjellanderc76dc952016-06-03 03:09:32 -070080 ]
81
deadbeef1b54a5f2017-01-23 19:39:57 -080082 defines = []
kjellanderc76dc952016-06-03 03:09:32 -070083
84 deps = [
kjellander8a116632017-04-21 05:17:08 -070085 "../api:libjingle_peerconnection_api",
86 "../api:ortc_api",
Qingsi Wang93a84392018-01-30 17:13:09 -080087 "../logging:ice_log",
Artem Titov6bbeb082018-06-18 14:25:54 +020088 "../rtc_base:base64",
Patrik Höglunda8005cf2017-12-13 16:05:42 +010089 "../rtc_base:checks",
ehmaldonadof6a861a2017-07-19 10:40:47 -070090 "../rtc_base:rtc_base",
Karl Wiberg12edf4c2018-03-07 14:18:56 +010091 "../rtc_base:safe_minmax",
Patrik Höglund3e113432017-12-15 14:40:10 +010092 "../rtc_base:stringutils",
kjellander8a116632017-04-21 05:17:08 -070093 "../system_wrappers:field_trial_api",
Karl Wiberg918f50c2018-07-05 11:40:33 +020094 "//third_party/abseil-cpp/absl/memory",
Danil Chapovalov00c71832018-06-15 15:58:38 +020095 "//third_party/abseil-cpp/absl/types:optional",
kjellanderc76dc952016-06-03 03:09:32 -070096 ]
97
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 ]
kjellanderc76dc952016-06-03 03:09:32 -0700115 }
kjellanderc76dc952016-06-03 03:09:32 -0700116}
117
ehmaldonadoda8dcfb2017-01-04 07:11:23 -0800118if (rtc_include_tests) {
deadbeef59edb922017-04-18 15:49:09 -0700119 rtc_source_set("p2p_test_utils") {
ehmaldonadoda8dcfb2017-01-04 07:11:23 -0800120 testonly = true
121 sources = [
kjellander8a116632017-04-21 05:17:08 -0700122 "base/fakecandidatepair.h",
kjellander98e15312017-03-04 15:08:44 -0800123 "base/fakedtlstransport.h",
124 "base/fakeicetransport.h",
125 "base/fakepackettransport.h",
126 "base/fakeportallocator.h",
kjellander98e15312017-03-04 15:08:44 -0800127 "base/mockicetransport.h",
deadbeef59edb922017-04-18 15:49:09 -0700128 "base/testrelayserver.h",
Steve Antoneae3e652017-10-25 14:46:18 -0700129 "base/teststunserver.cc",
deadbeef59edb922017-04-18 15:49:09 -0700130 "base/teststunserver.h",
Jonas Orelandbdcee282017-10-10 14:01:40 +0200131 "base/testturncustomizer.h",
deadbeef59edb922017-04-18 15:49:09 -0700132 "base/testturnserver.h",
133 ]
deadbeef59edb922017-04-18 15:49:09 -0700134 deps = [
135 ":rtc_p2p",
Patrik Höglund7aee3d52017-11-15 13:15:17 +0100136 "../api:libjingle_peerconnection_api",
kjellander8a116632017-04-21 05:17:08 -0700137 "../api:ortc_api",
ehmaldonadof6a861a2017-07-19 10:40:47 -0700138 "../rtc_base:rtc_base",
139 "../rtc_base:rtc_base_approved",
140 "../rtc_base:rtc_base_tests_utils",
kjellander8a116632017-04-21 05:17:08 -0700141 "../test:test_support",
Karl Wiberg918f50c2018-07-05 11:40:33 +0200142 "//third_party/abseil-cpp/absl/memory",
deadbeef59edb922017-04-18 15:49:09 -0700143 ]
deadbeef59edb922017-04-18 15:49:09 -0700144 }
145
146 rtc_source_set("rtc_p2p_unittests") {
147 testonly = true
kjellandere0629c02017-04-25 04:04:50 -0700148
deadbeef59edb922017-04-18 15:49:09 -0700149 sources = [
150 "base/asyncstuntcpsocket_unittest.cc",
zhihuangca6d3b62017-08-23 18:05:50 -0700151 "base/dtlstransport_unittest.cc",
ehmaldonadoda8dcfb2017-01-04 07:11:23 -0800152 "base/p2ptransportchannel_unittest.cc",
zsteinabbacbf2017-03-20 10:53:12 -0700153 "base/packetlossestimator_unittest.cc",
ehmaldonadoda8dcfb2017-01-04 07:11:23 -0800154 "base/port_unittest.cc",
155 "base/portallocator_unittest.cc",
156 "base/pseudotcp_unittest.cc",
Qingsi Wang1b368942018-06-13 13:54:08 -0700157 "base/regatheringcontroller_unittest.cc",
ehmaldonadoda8dcfb2017-01-04 07:11:23 -0800158 "base/relayport_unittest.cc",
159 "base/relayserver_unittest.cc",
160 "base/stun_unittest.cc",
161 "base/stunport_unittest.cc",
162 "base/stunrequest_unittest.cc",
163 "base/stunserver_unittest.cc",
164 "base/tcpport_unittest.cc",
ehmaldonadoda8dcfb2017-01-04 07:11:23 -0800165 "base/transportdescriptionfactory_unittest.cc",
166 "base/turnport_unittest.cc",
167 "base/turnserver_unittest.cc",
deadbeefd1c09982017-01-18 15:16:37 -0800168 "base/udptransport_unittest.cc",
ehmaldonadoda8dcfb2017-01-04 07:11:23 -0800169 "client/basicportallocator_unittest.cc",
170 ]
ehmaldonadoda8dcfb2017-01-04 07:11:23 -0800171 deps = [
deadbeef59edb922017-04-18 15:49:09 -0700172 ":p2p_test_utils",
ehmaldonadoda8dcfb2017-01-04 07:11:23 -0800173 ":rtc_p2p",
174 "../api:fakemetricsobserver",
kjellander8a116632017-04-21 05:17:08 -0700175 "../api:ortc_api",
Patrik Höglunda8005cf2017-12-13 16:05:42 +0100176 "../rtc_base:checks",
ehmaldonadof6a861a2017-07-19 10:40:47 -0700177 "../rtc_base:rtc_base",
178 "../rtc_base:rtc_base_approved",
179 "../rtc_base:rtc_base_tests_utils",
Patrik Höglund3e113432017-12-15 14:40:10 +0100180 "../rtc_base:stringutils",
kjellander8a116632017-04-21 05:17:08 -0700181 "../test:test_support",
ehmaldonadoda8dcfb2017-01-04 07:11:23 -0800182 "//testing/gtest",
Karl Wiberg918f50c2018-07-05 11:40:33 +0200183 "//third_party/abseil-cpp/absl/memory",
ehmaldonadoda8dcfb2017-01-04 07:11:23 -0800184 ]
185 if (!build_with_chromium && is_clang) {
186 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
187 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
188 }
189 defines = [ "GTEST_RELATIVE_PATH" ]
190 }
191}
192
kjellanderb62dbbe2016-09-23 00:38:52 -0700193rtc_static_library("libstunprober") {
Per Kjellandera7f2d842018-01-10 15:54:53 +0000194 visibility = [ "*" ]
kjellanderc76dc952016-06-03 03:09:32 -0700195 sources = [
196 "stunprober/stunprober.cc",
Mirko Bonadei66972782017-10-12 09:42:07 +0200197 "stunprober/stunprober.h",
kjellanderc76dc952016-06-03 03:09:32 -0700198 ]
199
kjellanderc76dc952016-06-03 03:09:32 -0700200 deps = [
kjellander8a116632017-04-21 05:17:08 -0700201 ":rtc_p2p",
kjellanderc76dc952016-06-03 03:09:32 -0700202 "..:webrtc_common",
Patrik Höglund3e113432017-12-15 14:40:10 +0100203 "../:typedefs",
Patrik Höglunda8005cf2017-12-13 16:05:42 +0100204 "../rtc_base:checks",
ehmaldonadof6a861a2017-07-19 10:40:47 -0700205 "../rtc_base:rtc_base",
kjellanderc76dc952016-06-03 03:09:32 -0700206 ]
207}
ehmaldonadoda8dcfb2017-01-04 07:11:23 -0800208
209if (rtc_include_tests) {
210 rtc_source_set("libstunprober_unittests") {
211 testonly = true
kjellandere0629c02017-04-25 04:04:50 -0700212
ehmaldonadoda8dcfb2017-01-04 07:11:23 -0800213 sources = [
214 "stunprober/stunprober_unittest.cc",
215 ]
216 deps = [
217 ":libstunprober",
kjellander8a116632017-04-21 05:17:08 -0700218 ":p2p_test_utils",
219 ":rtc_p2p",
Patrik Höglunda8005cf2017-12-13 16:05:42 +0100220 "../rtc_base:checks",
ehmaldonadof6a861a2017-07-19 10:40:47 -0700221 "../rtc_base:rtc_base",
222 "../rtc_base:rtc_base_tests_utils",
ehmaldonadoda8dcfb2017-01-04 07:11:23 -0800223 "//testing/gtest",
224 ]
ehmaldonadoda8dcfb2017-01-04 07:11:23 -0800225 defines = [ "GTEST_RELATIVE_PATH" ]
226 }
227}