blob: 0f9a3bc4a6f76df8c7dc5bd1db7aff0802017d31 [file] [log] [blame]
Sami Kalliomaki9c0c75b2016-06-29 14:55:00 +02001# 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")
Qiang Chen43fb9122017-12-20 10:47:36 -080010
Sami Kalliomaki9c0c75b2016-06-29 14:55:00 +020011if (is_android) {
12 import("//build/config/android/config.gni")
13 import("//build/config/android/rules.gni")
tkchin2ddfdba2016-08-07 21:37:45 -070014} else if (is_mac) {
15 import("//build/config/mac/rules.gni")
16} else if (is_ios) {
17 import("//build/config/ios/rules.gni")
Sami Kalliomaki9c0c75b2016-06-29 14:55:00 +020018}
19
20group("examples") {
kjellander6ceab082016-10-28 05:44:03 -070021 # This target shall build all targets in examples.
22 testonly = true
Mirko Bonadei1a339c32017-12-14 13:06:10 +010023 deps = []
Sami Kalliomaki9c0c75b2016-06-29 14:55:00 +020024
tkchin2ddfdba2016-08-07 21:37:45 -070025 if (is_android) {
Mirko Bonadei1a339c32017-12-14 13:06:10 +010026 deps += [
kjellander6ceab082016-10-28 05:44:03 -070027 ":AppRTCMobile",
Sami Kalliomäkid54f5f52018-08-03 13:23:05 +020028 ":AppRTCMobile_test_apk",
George Zhou2770c3d2018-03-07 09:58:54 -080029 ":libwebrtc_unity",
Jason Long00b84622020-07-20 17:52:12 -040030 "androidvoip",
kjellander6ceab082016-10-28 05:44:03 -070031 ]
Sami Kalliomäki3e77afd2018-03-08 16:43:16 +010032
33 # TODO(sakal): We include some code from the tests. Remove this dependency
34 # and remove this if-clause.
35 if (rtc_include_tests) {
Artem Titov94b57c02019-03-21 13:35:10 +010036 deps += [ "androidnativeapi" ]
Sami Kalliomäki3e77afd2018-03-08 16:43:16 +010037 }
kjellander6ceab082016-10-28 05:44:03 -070038 }
39
charujainaca3a242016-11-01 03:09:15 -070040 if (!build_with_chromium) {
Mirko Bonadei1a339c32017-12-14 13:06:10 +010041 deps += [ ":stun_prober" ]
charujainaca3a242016-11-01 03:09:15 -070042 }
43
kjellander6ceab082016-10-28 05:44:03 -070044 if (is_ios || (is_mac && target_cpu != "x86")) {
Mirko Bonadei1a339c32017-12-14 13:06:10 +010045 deps += [ ":AppRTCMobile" ]
Sami Kalliomaki9c0c75b2016-06-29 14:55:00 +020046 }
kjellander6ceab082016-10-28 05:44:03 -070047
Hidehiko Abef264e702020-09-10 18:10:11 +090048 if (is_linux || is_chromeos || is_win) {
Mirko Bonadei1a339c32017-12-14 13:06:10 +010049 deps += [
kthelgason0727f152016-08-08 09:03:23 -070050 ":peerconnection_server",
kthelgason0727f152016-08-08 09:03:23 -070051 ":stunserver",
52 ":turnserver",
53 ]
Robin Raymondce1b1402018-11-22 20:10:11 -050054 if (current_os != "winuwp") {
55 deps += [ ":peerconnection_client" ]
56 }
kthelgason0727f152016-08-08 09:03:23 -070057 }
George Zhou2770c3d2018-03-07 09:58:54 -080058
59 if (is_android || is_win) {
60 deps += [ ":webrtc_unity_plugin" ]
61 }
Sami Kalliomaki9c0c75b2016-06-29 14:55:00 +020062}
63
Mirko Bonadei86d053c2019-10-17 21:32:04 +020064rtc_library("read_auth_file") {
Niels Möller9862c2e2018-10-30 12:20:03 +010065 testonly = true
66 sources = [
67 "turnserver/read_auth_file.cc",
68 "turnserver/read_auth_file.h",
69 ]
Ali Tofighfd6a4d62022-03-31 10:36:48 +020070 deps = [
71 "../api:array_view",
72 "../rtc_base",
Florent Castelli57aa81b2022-04-04 17:14:02 +020073 "../rtc_base:stringutils",
Ali Tofighfd6a4d62022-03-31 10:36:48 +020074 ]
75 absl_deps = [ "//third_party/abseil-cpp/absl/strings:strings" ]
Niels Möller9862c2e2018-10-30 12:20:03 +010076}
77
78if (rtc_include_tests) {
79 rtc_test("examples_unittests") {
80 testonly = true
Mirko Bonadeiccbe95f2020-01-21 12:10:10 +010081 sources = [ "turnserver/read_auth_file_unittest.cc" ]
Niels Möller9862c2e2018-10-30 12:20:03 +010082 deps = [
83 ":read_auth_file",
84 "../test:test_main",
85 "//test:test_support",
86 "//testing/gtest",
87 ]
88 }
89}
90
tkchin2ddfdba2016-08-07 21:37:45 -070091if (is_android) {
Mirko Bonadeifbb3b7d2017-11-07 15:36:33 +000092 rtc_android_apk("AppRTCMobile") {
kjellander1993b1d2017-03-06 00:29:21 -080093 testonly = true
Magnus Jedvertc1815cf2016-09-27 10:10:41 +020094 apk_name = "AppRTCMobile"
Sami Kalliomaki9c0c75b2016-06-29 14:55:00 +020095 android_manifest = "androidapp/AndroidManifest.xml"
Jeremy Leconteb19cfee2020-06-25 22:57:49 +020096 min_sdk_version = 21
Oleh Prypin4cbb4ef2019-06-18 17:09:51 +020097 target_sdk_version = 29
Sami Kalliomaki9c0c75b2016-06-29 14:55:00 +020098
99 deps = [
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200100 ":AppRTCMobile_javalib",
101 ":AppRTCMobile_resources",
jianjun.zhuc0247402017-07-11 06:20:45 -0700102 "../rtc_base:base_java",
Sami Kalliomaki9c0c75b2016-06-29 14:55:00 +0200103 ]
104
jianjun.zhuc0247402017-07-11 06:20:45 -0700105 shared_libraries = [ "../sdk/android:libjingle_peerconnection_so" ]
Sami Kalliomaki9c0c75b2016-06-29 14:55:00 +0200106 }
107
Mirko Bonadeifbb3b7d2017-11-07 15:36:33 +0000108 rtc_android_library("AppRTCMobile_javalib") {
kjellander1993b1d2017-03-06 00:29:21 -0800109 testonly = true
Courtney Edwards35c87b62020-05-19 13:44:42 +0200110 android_manifest = "androidapp/AndroidManifest.xml"
sakal07a050f2017-02-13 05:58:27 -0800111
Natalie Chouinard65bbcab2019-12-23 14:02:25 -0800112 sources = [
Sami Kalliomaki9c0c75b2016-06-29 14:55:00 +0200113 "androidapp/src/org/appspot/apprtc/AppRTCAudioManager.java",
henrikac3c2f312016-12-14 07:36:56 -0800114 "androidapp/src/org/appspot/apprtc/AppRTCBluetoothManager.java",
Sami Kalliomaki9c0c75b2016-06-29 14:55:00 +0200115 "androidapp/src/org/appspot/apprtc/AppRTCClient.java",
116 "androidapp/src/org/appspot/apprtc/AppRTCProximitySensor.java",
117 "androidapp/src/org/appspot/apprtc/CallActivity.java",
118 "androidapp/src/org/appspot/apprtc/CallFragment.java",
119 "androidapp/src/org/appspot/apprtc/CaptureQualityController.java",
120 "androidapp/src/org/appspot/apprtc/ConnectActivity.java",
121 "androidapp/src/org/appspot/apprtc/CpuMonitor.java",
122 "androidapp/src/org/appspot/apprtc/DirectRTCClient.java",
123 "androidapp/src/org/appspot/apprtc/HudFragment.java",
124 "androidapp/src/org/appspot/apprtc/PeerConnectionClient.java",
Natalie Chouinard65bbcab2019-12-23 14:02:25 -0800125 "androidapp/src/org/appspot/apprtc/RecordedAudioToFileController.java",
Sami Kalliomaki9c0c75b2016-06-29 14:55:00 +0200126 "androidapp/src/org/appspot/apprtc/RoomParametersFetcher.java",
Qingsi Wanga4e72b72018-02-12 10:34:18 -0800127 "androidapp/src/org/appspot/apprtc/RtcEventLog.java",
Sami Kalliomaki9c0c75b2016-06-29 14:55:00 +0200128 "androidapp/src/org/appspot/apprtc/SettingsActivity.java",
129 "androidapp/src/org/appspot/apprtc/SettingsFragment.java",
130 "androidapp/src/org/appspot/apprtc/TCPChannelClient.java",
131 "androidapp/src/org/appspot/apprtc/UnhandledExceptionHandler.java",
132 "androidapp/src/org/appspot/apprtc/WebSocketChannelClient.java",
133 "androidapp/src/org/appspot/apprtc/WebSocketRTCClient.java",
134 "androidapp/src/org/appspot/apprtc/util/AppRTCUtils.java",
135 "androidapp/src/org/appspot/apprtc/util/AsyncHttpURLConnection.java",
Sami Kalliomaki9c0c75b2016-06-29 14:55:00 +0200136 ]
137
Mohamed Heikal3f94fc52020-09-01 15:51:12 -0400138 resources_package = "org.appspot.apprtc"
Sami Kalliomaki9c0c75b2016-06-29 14:55:00 +0200139 deps = [
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200140 ":AppRTCMobile_resources",
jianjun.zhuc0247402017-07-11 06:20:45 -0700141 "../rtc_base:base_java",
Sami Kalliomäki7d8f5942018-04-23 15:07:34 +0200142 "../sdk/android:audio_api_java",
Sami Kalliomäki725c1062018-03-28 10:49:18 +0200143 "../sdk/android:base_java",
Sami Kalliomäki1641ca32018-04-04 15:59:31 +0200144 "../sdk/android:camera_java",
Anders Carlsson1e06d882018-07-10 09:33:30 +0200145 "../sdk/android:default_video_codec_factory_java",
Sami Kalliomäki1641ca32018-04-04 15:59:31 +0200146 "../sdk/android:filevideo_java",
Sami Kalliomäki725c1062018-03-28 10:49:18 +0200147 "../sdk/android:hwcodecs_java",
Sami Kalliomäki7d8f5942018-04-23 15:07:34 +0200148 "../sdk/android:java_audio_device_module_java",
jianjun.zhuc0247402017-07-11 06:20:45 -0700149 "../sdk/android:libjingle_peerconnection_java",
150 "../sdk/android:libjingle_peerconnection_metrics_default_java",
Sami Kalliomäki1641ca32018-04-04 15:59:31 +0200151 "../sdk/android:peerconnection_java",
152 "../sdk/android:screencapturer_java",
153 "../sdk/android:surfaceviewrenderer_java",
Sami Kalliomäki725c1062018-03-28 10:49:18 +0200154 "../sdk/android:swcodecs_java",
Sami Kalliomäki1641ca32018-04-04 15:59:31 +0200155 "../sdk/android:video_api_java",
Sami Kalliomäki903bd412018-07-24 10:53:28 +0200156 "../sdk/android:video_java",
jianjun.zhuc0247402017-07-11 06:20:45 -0700157 "androidapp/third_party/autobanh:autobanh_java",
Byoungchan Lee02334e02021-08-14 11:41:59 +0900158 "//third_party/androidx:androidx_annotation_annotation_java",
Sami Kalliomaki9c0c75b2016-06-29 14:55:00 +0200159 ]
160 }
161
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200162 android_resources("AppRTCMobile_resources") {
kjellander1993b1d2017-03-06 00:29:21 -0800163 testonly = true
Andrew Grieved4262df2020-03-25 12:59:50 -0400164 sources = [
165 "androidapp/res/drawable-hdpi/disconnect.png",
166 "androidapp/res/drawable-hdpi/ic_action_full_screen.png",
167 "androidapp/res/drawable-hdpi/ic_action_return_from_full_screen.png",
168 "androidapp/res/drawable-hdpi/ic_launcher.png",
169 "androidapp/res/drawable-hdpi/ic_loopback_call.png",
170 "androidapp/res/drawable-ldpi/disconnect.png",
171 "androidapp/res/drawable-ldpi/ic_action_full_screen.png",
172 "androidapp/res/drawable-ldpi/ic_action_return_from_full_screen.png",
173 "androidapp/res/drawable-ldpi/ic_launcher.png",
174 "androidapp/res/drawable-ldpi/ic_loopback_call.png",
175 "androidapp/res/drawable-mdpi/disconnect.png",
176 "androidapp/res/drawable-mdpi/ic_action_full_screen.png",
177 "androidapp/res/drawable-mdpi/ic_action_return_from_full_screen.png",
178 "androidapp/res/drawable-mdpi/ic_launcher.png",
179 "androidapp/res/drawable-mdpi/ic_loopback_call.png",
180 "androidapp/res/drawable-xhdpi/disconnect.png",
181 "androidapp/res/drawable-xhdpi/ic_action_full_screen.png",
182 "androidapp/res/drawable-xhdpi/ic_action_return_from_full_screen.png",
183 "androidapp/res/drawable-xhdpi/ic_launcher.png",
184 "androidapp/res/drawable-xhdpi/ic_loopback_call.png",
185 "androidapp/res/layout/activity_call.xml",
186 "androidapp/res/layout/activity_connect.xml",
187 "androidapp/res/layout/fragment_call.xml",
188 "androidapp/res/layout/fragment_hud.xml",
189 "androidapp/res/menu/connect_menu.xml",
Andrew Grieved4262df2020-03-25 12:59:50 -0400190 "androidapp/res/values-v17/styles.xml",
191 "androidapp/res/values-v21/styles.xml",
Artem Titova4dfe242020-06-03 16:42:57 +0200192 "androidapp/res/values/arrays.xml",
193 "androidapp/res/values/strings.xml",
Andrew Grieved4262df2020-03-25 12:59:50 -0400194 "androidapp/res/xml/preferences.xml",
195 ]
Andrew Grieved4262df2020-03-25 12:59:50 -0400196
197 # Needed for Bazel converter.
Mohamed Heikal3f94fc52020-09-01 15:51:12 -0400198 custom_package = "org.appspot.apprtc"
Andrew Grieved4262df2020-03-25 12:59:50 -0400199 resource_dirs = [ "androidapp/res" ]
200 assert(resource_dirs != []) # Mark as used.
Sami Kalliomaki9c0c75b2016-06-29 14:55:00 +0200201 }
202
Sami Kalliomäkid54f5f52018-08-03 13:23:05 +0200203 rtc_instrumentation_test_apk("AppRTCMobile_test_apk") {
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200204 apk_name = "AppRTCMobileTest"
Sami Kalliomaki9c0c75b2016-06-29 14:55:00 +0200205 android_manifest = "androidtests/AndroidManifest.xml"
Jeremy Leconteb19cfee2020-06-25 22:57:49 +0200206 min_sdk_version = 21
Oleh Prypin4cbb4ef2019-06-18 17:09:51 +0200207 target_sdk_version = 21
Sami Kalliomaki9c0c75b2016-06-29 14:55:00 +0200208
Natalie Chouinard65bbcab2019-12-23 14:02:25 -0800209 sources = [
Patrik Höglunda8005cf2017-12-13 16:05:42 +0100210 "androidtests/src/org/appspot/apprtc/test/PeerConnectionClientTest.java",
211 ]
Sami Kalliomaki9c0c75b2016-06-29 14:55:00 +0200212
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200213 apk_under_test = ":AppRTCMobile"
Sami Kalliomaki9c0c75b2016-06-29 14:55:00 +0200214
215 deps = [
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200216 ":AppRTCMobile_javalib",
Mirko Bonadei5e987422020-07-10 10:36:04 +0200217 "../sdk/android:base_java",
Artem Titova4dfe242020-06-03 16:42:57 +0200218 "../sdk/android:camera_java",
jianjun.zhuc0247402017-07-11 06:20:45 -0700219 "../sdk/android:libjingle_peerconnection_java",
Artem Titova4dfe242020-06-03 16:42:57 +0200220 "../sdk/android:peerconnection_java",
221 "../sdk/android:video_api_java",
Sami Kalliomäki903bd412018-07-24 10:53:28 +0200222 "../sdk/android:video_java",
sakalcb79d512017-01-11 06:21:26 -0800223 "//third_party/android_support_test_runner:runner_java",
Mirko Bonadei56c24062021-07-30 10:21:30 +0200224 "//third_party/androidx:androidx_test_runner_java",
sakalcb79d512017-01-11 06:21:26 -0800225 "//third_party/junit",
Sami Kalliomaki9c0c75b2016-06-29 14:55:00 +0200226 ]
227 }
Sami Kalliomaki9c0c75b2016-06-29 14:55:00 +0200228}
tkchin2ddfdba2016-08-07 21:37:45 -0700229
230if (is_ios || (is_mac && target_cpu != "x86")) {
tkchin2ddfdba2016-08-07 21:37:45 -0700231 config("apprtc_common_config") {
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200232 include_dirs = [ "objc/AppRTCMobile/common" ]
tkchin2ddfdba2016-08-07 21:37:45 -0700233 }
234
Mirko Bonadei86d053c2019-10-17 21:32:04 +0200235 rtc_library("apprtc_common") {
kjellander1993b1d2017-03-06 00:29:21 -0800236 testonly = true
tkchin2ddfdba2016-08-07 21:37:45 -0700237 sources = [
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200238 "objc/AppRTCMobile/common/ARDUtilities.h",
239 "objc/AppRTCMobile/common/ARDUtilities.m",
tkchin2ddfdba2016-08-07 21:37:45 -0700240 ]
ehmaldonadoe9cc6862016-09-05 06:10:18 -0700241 public_configs = [ ":apprtc_common_config" ]
Mirko Bonadei19640aa2020-10-19 16:12:43 +0200242 deps = [ "../sdk:base_objc" ]
tkchin2ddfdba2016-08-07 21:37:45 -0700243 }
244
245 config("apprtc_signaling_config") {
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200246 include_dirs = [ "objc/AppRTCMobile" ]
tkchin2ddfdba2016-08-07 21:37:45 -0700247 }
248
Mirko Bonadei86d053c2019-10-17 21:32:04 +0200249 rtc_library("apprtc_signaling") {
kjellander1993b1d2017-03-06 00:29:21 -0800250 testonly = true
tkchin2ddfdba2016-08-07 21:37:45 -0700251 sources = [
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200252 "objc/AppRTCMobile/ARDAppClient+Internal.h",
253 "objc/AppRTCMobile/ARDAppClient.h",
254 "objc/AppRTCMobile/ARDAppClient.m",
255 "objc/AppRTCMobile/ARDAppEngineClient.h",
256 "objc/AppRTCMobile/ARDAppEngineClient.m",
sakalc522e752017-04-05 12:17:48 -0700257 "objc/AppRTCMobile/ARDCaptureController.h",
258 "objc/AppRTCMobile/ARDCaptureController.m",
Anders Carlsson358f2e02018-06-04 10:24:37 +0200259 "objc/AppRTCMobile/ARDExternalSampleCapturer.h",
260 "objc/AppRTCMobile/ARDExternalSampleCapturer.m",
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200261 "objc/AppRTCMobile/ARDJoinResponse+Internal.h",
262 "objc/AppRTCMobile/ARDJoinResponse.h",
263 "objc/AppRTCMobile/ARDJoinResponse.m",
264 "objc/AppRTCMobile/ARDMessageResponse+Internal.h",
265 "objc/AppRTCMobile/ARDMessageResponse.h",
266 "objc/AppRTCMobile/ARDMessageResponse.m",
267 "objc/AppRTCMobile/ARDRoomServerClient.h",
sakalc4adacf2017-03-28 01:22:48 -0700268 "objc/AppRTCMobile/ARDSettingsModel+Private.h",
269 "objc/AppRTCMobile/ARDSettingsModel.h",
270 "objc/AppRTCMobile/ARDSettingsModel.m",
271 "objc/AppRTCMobile/ARDSettingsStore.h",
272 "objc/AppRTCMobile/ARDSettingsStore.m",
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200273 "objc/AppRTCMobile/ARDSignalingChannel.h",
274 "objc/AppRTCMobile/ARDSignalingMessage.h",
275 "objc/AppRTCMobile/ARDSignalingMessage.m",
276 "objc/AppRTCMobile/ARDStatsBuilder.h",
277 "objc/AppRTCMobile/ARDStatsBuilder.m",
kthelgasoncc882af2017-01-13 05:59:46 -0800278 "objc/AppRTCMobile/ARDTURNClient+Internal.h",
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200279 "objc/AppRTCMobile/ARDTURNClient.h",
kthelgasoncc882af2017-01-13 05:59:46 -0800280 "objc/AppRTCMobile/ARDTURNClient.m",
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200281 "objc/AppRTCMobile/ARDWebSocketChannel.h",
282 "objc/AppRTCMobile/ARDWebSocketChannel.m",
283 "objc/AppRTCMobile/RTCIceCandidate+JSON.h",
284 "objc/AppRTCMobile/RTCIceCandidate+JSON.m",
285 "objc/AppRTCMobile/RTCIceServer+JSON.h",
286 "objc/AppRTCMobile/RTCIceServer+JSON.m",
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200287 "objc/AppRTCMobile/RTCSessionDescription+JSON.h",
288 "objc/AppRTCMobile/RTCSessionDescription+JSON.m",
tkchin2ddfdba2016-08-07 21:37:45 -0700289 ]
ehmaldonadoe9cc6862016-09-05 06:10:18 -0700290 public_configs = [ ":apprtc_signaling_config" ]
tkchin2ddfdba2016-08-07 21:37:45 -0700291 deps = [
292 ":apprtc_common",
293 ":socketrocket",
Mirko Bonadei19640aa2020-10-19 16:12:43 +0200294 "../sdk:base_objc",
295 "../sdk:default_codec_factory_objc",
296 "../sdk:file_logger_objc",
297 "../sdk:helpers_objc",
298 "../sdk:mediaconstraints_objc",
299 "../sdk:peerconnectionfactory_base_objc",
300 "../sdk:videocapture_objc",
301 "../sdk:videoframebuffer_objc",
302 "../sdk:videosource_objc",
tkchin2ddfdba2016-08-07 21:37:45 -0700303 ]
Sylvain Defresnec7f0dff2020-07-03 10:19:30 +0200304 frameworks = [
Kári Tristan Helgason8a1e35c2019-03-07 10:44:26 +0100305 "CoreMedia.framework",
306 "QuartzCore.framework",
307 ]
tkchin2ddfdba2016-08-07 21:37:45 -0700308 }
309
310 if (is_ios) {
Mirko Bonadei86d053c2019-10-17 21:32:04 +0200311 rtc_library("AppRTCMobile_lib") {
Mirko Bonadeicbaaaed2018-02-19 15:14:04 +0100312 # iOS must use WebRTC.framework which is dynamically linked.
kjellander1993b1d2017-03-06 00:29:21 -0800313 testonly = true
tkchin2ddfdba2016-08-07 21:37:45 -0700314 sources = [
Patrik Höglund49acb1e2018-01-02 14:41:54 +0100315 "objc/AppRTCMobile/ios/ARDAppDelegate.h",
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200316 "objc/AppRTCMobile/ios/ARDAppDelegate.m",
Daniela012b56b2017-11-15 13:15:24 +0100317 "objc/AppRTCMobile/ios/ARDFileCaptureController.h",
318 "objc/AppRTCMobile/ios/ARDFileCaptureController.m",
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200319 "objc/AppRTCMobile/ios/ARDMainView.h",
320 "objc/AppRTCMobile/ios/ARDMainView.m",
321 "objc/AppRTCMobile/ios/ARDMainViewController.h",
322 "objc/AppRTCMobile/ios/ARDMainViewController.m",
denicijad17d5362016-11-02 02:56:09 -0700323 "objc/AppRTCMobile/ios/ARDSettingsViewController.h",
324 "objc/AppRTCMobile/ios/ARDSettingsViewController.m",
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200325 "objc/AppRTCMobile/ios/ARDStatsView.h",
326 "objc/AppRTCMobile/ios/ARDStatsView.m",
327 "objc/AppRTCMobile/ios/ARDVideoCallView.h",
328 "objc/AppRTCMobile/ios/ARDVideoCallView.m",
329 "objc/AppRTCMobile/ios/ARDVideoCallViewController.h",
330 "objc/AppRTCMobile/ios/ARDVideoCallViewController.m",
Anders Carlsson6bf43d22017-10-16 13:51:43 +0200331 "objc/AppRTCMobile/ios/RTCVideoCodecInfo+HumanReadable.h",
332 "objc/AppRTCMobile/ios/RTCVideoCodecInfo+HumanReadable.m",
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200333 "objc/AppRTCMobile/ios/UIImage+ARDUtilities.h",
334 "objc/AppRTCMobile/ios/UIImage+ARDUtilities.m",
denicija77bfd7c2016-11-15 00:41:26 -0800335 ]
denicija77bfd7c2016-11-15 00:41:26 -0800336
Anders Carlsson96fccfe2019-02-21 16:11:40 +0100337 configs += [ "..:common_objc" ]
338
denicija77bfd7c2016-11-15 00:41:26 -0800339 deps = [
340 ":apprtc_common",
341 ":apprtc_signaling",
Mirko Bonadei19640aa2020-10-19 16:12:43 +0200342 "../sdk:audio_session_objc",
343 "../sdk:base_objc",
344 "../sdk:helpers_objc",
345 "../sdk:mediaconstraints_objc",
Jake Bromberg28e582d2021-06-22 11:34:29 -0700346 "../sdk:metal_objc",
Mirko Bonadei19640aa2020-10-19 16:12:43 +0200347 "../sdk:peerconnectionfactory_base_objc",
348 "../sdk:peerconnectionfactory_base_objc",
Mirko Bonadei19640aa2020-10-19 16:12:43 +0200349 "../sdk:videocapture_objc",
350 "../sdk:videocodec_objc",
denicija77bfd7c2016-11-15 00:41:26 -0800351 ]
Jordan Rose53d3fc92021-07-06 12:16:41 -0700352 if (rtc_ios_macos_use_opengl_rendering) {
353 deps += [ "../sdk:opengl_ui_objc" ]
354 }
Kári Tristan Helgason8a1e35c2019-03-07 10:44:26 +0100355
Sylvain Defresnec7f0dff2020-07-03 10:19:30 +0200356 frameworks = [ "AVFoundation.framework" ]
denicija77bfd7c2016-11-15 00:41:26 -0800357 }
358
359 ios_app_bundle("AppRTCMobile") {
kjellander1993b1d2017-03-06 00:29:21 -0800360 testonly = true
Mirko Bonadeiccbe95f2020-01-21 12:10:10 +0100361 sources = [ "objc/AppRTCMobile/ios/main.m" ]
tkchin2ddfdba2016-08-07 21:37:45 -0700362
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200363 info_plist = "objc/AppRTCMobile/ios/Info.plist"
tkchin2ddfdba2016-08-07 21:37:45 -0700364
denicija77bfd7c2016-11-15 00:41:26 -0800365 configs += [ "..:common_config" ]
tkchin2ddfdba2016-08-07 21:37:45 -0700366 public_configs = [ "..:common_inherited_config" ]
367
368 deps = [
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200369 ":AppRTCMobile_ios_bundle_data",
denicija77bfd7c2016-11-15 00:41:26 -0800370 ":AppRTCMobile_lib",
Mirko Bonadei1a339c32017-12-14 13:06:10 +0100371 "../sdk:framework_objc",
Anders Carlsson7bca8ca2018-08-30 09:30:29 +0200372 "../sdk:ios_framework_bundle",
tkchin2ddfdba2016-08-07 21:37:45 -0700373 ]
374
Anders Carlsson358f2e02018-06-04 10:24:37 +0200375 if (rtc_apprtcmobile_broadcast_extension) {
376 deps += [
377 ":AppRTCMobileBroadcastSetupUI_extension_bundle",
378 ":AppRTCMobileBroadcastUpload_extension_bundle",
379 ]
380 }
381
tkchin2ddfdba2016-08-07 21:37:45 -0700382 if (target_cpu == "x86") {
Artem Titov94b57c02019-03-21 13:35:10 +0100383 deps += [ "//testing/iossim" ]
tkchin2ddfdba2016-08-07 21:37:45 -0700384 }
385 }
386
Anders Carlsson358f2e02018-06-04 10:24:37 +0200387 if (rtc_apprtcmobile_broadcast_extension) {
388 bundle_data("AppRTCMobileBroadcastUpload_extension_bundle") {
389 testonly = true
Artem Titova4dfe242020-06-03 16:42:57 +0200390 public_deps = [ # no-presubmit-check TODO(webrtc:8603)
391 ":AppRTCMobileBroadcastUpload", # prevent code format
392 ]
Mirko Bonadeiccbe95f2020-01-21 12:10:10 +0100393 sources = [ "$root_out_dir/AppRTCMobileBroadcastUpload.appex" ]
394 outputs = [ "{{bundle_contents_dir}}/Plugins/{{source_file_part}}" ]
Anders Carlsson358f2e02018-06-04 10:24:37 +0200395 }
396
397 bundle_data("AppRTCMobileBroadcastSetupUI_extension_bundle") {
398 testonly = true
Artem Titova4dfe242020-06-03 16:42:57 +0200399 public_deps = [ # no-presubmit-check TODO(webrtc:8603)
400 ":AppRTCMobileBroadcastSetupUI", # prevent code format
401 ]
Mirko Bonadeiccbe95f2020-01-21 12:10:10 +0100402 sources = [ "$root_out_dir/AppRTCMobileBroadcastSetupUI.appex" ]
403 outputs = [ "{{bundle_contents_dir}}/Plugins/{{source_file_part}}" ]
Anders Carlsson358f2e02018-06-04 10:24:37 +0200404 }
405
Mirko Bonadei86d053c2019-10-17 21:32:04 +0200406 rtc_library("AppRTCMobileBroadcastUpload_lib") {
Anders Carlsson358f2e02018-06-04 10:24:37 +0200407 testonly = true
408 sources = [
409 "objc/AppRTCMobile/ios/broadcast_extension/ARDBroadcastSampleHandler.h",
410 "objc/AppRTCMobile/ios/broadcast_extension/ARDBroadcastSampleHandler.m",
411 ]
412
413 deps = [
Anders Carlsson358f2e02018-06-04 10:24:37 +0200414 ":apprtc_signaling",
Anders Carlsson7bca8ca2018-08-30 09:30:29 +0200415 "../sdk:framework_objc+link",
416 "../sdk:ios_framework_bundle",
Anders Carlsson358f2e02018-06-04 10:24:37 +0200417 ]
418
Sylvain Defresnec7f0dff2020-07-03 10:19:30 +0200419 frameworks = [ "ReplayKit.framework" ]
Anders Carlsson358f2e02018-06-04 10:24:37 +0200420 }
421
422 ios_appex_bundle("AppRTCMobileBroadcastUpload") {
423 testonly = true
424 configs += [ "..:common_config" ]
425 public_configs = [ "..:common_inherited_config" ]
426
427 info_plist = "objc/AppRTCMobile/ios/broadcast_extension/BroadcastUploadInfo.plist"
428
429 deps = [
430 ":AppRTCMobileBroadcastUpload_lib",
431 "../sdk:framework_objc",
432 ]
433 }
434
435 ios_appex_bundle("AppRTCMobileBroadcastSetupUI") {
436 sources = [
437 "objc/AppRTCMobile/ios/broadcast_extension/ARDBroadcastSetupViewController.h",
438 "objc/AppRTCMobile/ios/broadcast_extension/ARDBroadcastSetupViewController.m",
439 ]
440
441 info_plist = "objc/AppRTCMobile/ios/broadcast_extension/BroadcastSetupUIInfo.plist"
442
Sylvain Defresnec7f0dff2020-07-03 10:19:30 +0200443 frameworks = [ "ReplayKit.framework" ]
Anders Carlsson358f2e02018-06-04 10:24:37 +0200444
Mirko Bonadeiccbe95f2020-01-21 12:10:10 +0100445 deps = [ ":AppRTCMobile_ios_bundle_data" ]
Anders Carlsson358f2e02018-06-04 10:24:37 +0200446 }
447 }
448
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200449 bundle_data("AppRTCMobile_ios_bundle_data") {
tkchin2ddfdba2016-08-07 21:37:45 -0700450 sources = [
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200451 "objc/AppRTCMobile/ios/resources/Roboto-Regular.ttf",
Daniela012b56b2017-11-15 13:15:24 +0100452
453 # Sample video taken from https://media.xiph.org/video/derf/
454 "objc/AppRTCMobile/ios/resources/foreman.mp4",
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200455 "objc/AppRTCMobile/ios/resources/iPhone5@2x.png",
456 "objc/AppRTCMobile/ios/resources/iPhone6@2x.png",
457 "objc/AppRTCMobile/ios/resources/iPhone6p@3x.png",
458 "objc/AppRTCMobile/ios/resources/ic_call_end_black_24dp.png",
459 "objc/AppRTCMobile/ios/resources/ic_call_end_black_24dp@2x.png",
460 "objc/AppRTCMobile/ios/resources/ic_clear_black_24dp.png",
461 "objc/AppRTCMobile/ios/resources/ic_clear_black_24dp@2x.png",
denicija6d6762c2016-10-28 04:53:16 -0700462 "objc/AppRTCMobile/ios/resources/ic_settings_black_24dp.png",
463 "objc/AppRTCMobile/ios/resources/ic_settings_black_24dp@2x.png",
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200464 "objc/AppRTCMobile/ios/resources/ic_surround_sound_black_24dp.png",
465 "objc/AppRTCMobile/ios/resources/ic_surround_sound_black_24dp@2x.png",
466 "objc/AppRTCMobile/ios/resources/ic_switch_video_black_24dp.png",
467 "objc/AppRTCMobile/ios/resources/ic_switch_video_black_24dp@2x.png",
468 "objc/AppRTCMobile/ios/resources/mozart.mp3",
anderscb5ed9052017-08-15 04:07:12 -0700469 "objc/Icon-120.png",
470 "objc/Icon-180.png",
tkchin2ddfdba2016-08-07 21:37:45 -0700471 "objc/Icon.png",
472 ]
Mirko Bonadeiccbe95f2020-01-21 12:10:10 +0100473 outputs = [ "{{bundle_resources_dir}}/{{source_file_part}}" ]
tkchin2ddfdba2016-08-07 21:37:45 -0700474 }
Anders Carlsson73119182018-03-15 09:41:03 +0100475
Mirko Bonadei86d053c2019-10-17 21:32:04 +0200476 rtc_library("ObjCNativeAPIDemo_lib") {
Anders Carlsson73119182018-03-15 09:41:03 +0100477 testonly = true
478 sources = [
479 "objcnativeapi/objc/NADAppDelegate.h",
480 "objcnativeapi/objc/NADAppDelegate.m",
481 "objcnativeapi/objc/NADViewController.h",
482 "objcnativeapi/objc/NADViewController.mm",
Steve Anton10542f22019-01-11 09:11:00 -0800483 "objcnativeapi/objc/objc_call_client.h",
484 "objcnativeapi/objc/objc_call_client.mm",
Anders Carlsson73119182018-03-15 09:41:03 +0100485 ]
486
Anders Carlsson73119182018-03-15 09:41:03 +0100487 deps = [
488 "../api:libjingle_peerconnection_api",
Mirko Bonadeid9708072019-01-25 20:26:48 +0100489 "../api:scoped_refptr",
Florent Castelli8d4e9fb2022-04-04 17:18:21 +0200490 "../api:sequence_checker",
Anders Carlsson73119182018-03-15 09:41:03 +0100491 "../api/audio_codecs:builtin_audio_decoder_factory",
492 "../api/audio_codecs:builtin_audio_encoder_factory",
Danil Chapovalov4ba04b72019-06-26 15:49:47 +0200493 "../api/rtc_event_log:rtc_event_log_factory",
Danil Chapovalovaaa11432019-05-17 13:20:14 +0200494 "../api/task_queue:default_task_queue_factory",
Anders Carlsson73119182018-03-15 09:41:03 +0100495 "../media:rtc_audio_video",
Artem Titov94b57c02019-03-21 13:35:10 +0100496 "../modules/audio_processing",
Alessio Bazzicab768e882018-11-07 14:29:54 +0000497 "../modules/audio_processing:api",
Anders Carlsson73119182018-03-15 09:41:03 +0100498 "../pc:libjingle_peerconnection",
Artem Titov94b57c02019-03-21 13:35:10 +0100499 "../rtc_base",
Markus Handell06d034f2020-07-07 09:17:56 +0200500 "../rtc_base/synchronization:mutex",
Anders Carlsson7bca8ca2018-08-30 09:30:29 +0200501 "../sdk:base_objc",
Anders Carlsson73119182018-03-15 09:41:03 +0100502 "../sdk:default_codec_factory_objc",
Anders Carlsson7bca8ca2018-08-30 09:30:29 +0200503 "../sdk:helpers_objc",
Jake Bromberg28e582d2021-06-22 11:34:29 -0700504 "../sdk:metal_objc",
Anders Carlsson73119182018-03-15 09:41:03 +0100505 "../sdk:native_api",
Anders Carlsson7bca8ca2018-08-30 09:30:29 +0200506 "../sdk:videocapture_objc",
Anders Carlsson73119182018-03-15 09:41:03 +0100507 "../sdk:videotoolbox_objc",
Anders Carlsson73119182018-03-15 09:41:03 +0100508 ]
509
Jordan Rose53d3fc92021-07-06 12:16:41 -0700510 if (rtc_ios_macos_use_opengl_rendering) {
511 deps += [ "../sdk:opengl_ui_objc" ]
Anders Carlsson73119182018-03-15 09:41:03 +0100512 }
513 }
514
515 ios_app_bundle("ObjCNativeAPIDemo") {
516 testonly = true
Mirko Bonadeiccbe95f2020-01-21 12:10:10 +0100517 sources = [ "objcnativeapi/objc/main.m" ]
Anders Carlsson73119182018-03-15 09:41:03 +0100518
519 info_plist = "objcnativeapi/Info.plist"
520
521 configs += [ "..:common_config" ]
522 public_configs = [ "..:common_inherited_config" ]
523
Mirko Bonadeiccbe95f2020-01-21 12:10:10 +0100524 deps = [ ":ObjCNativeAPIDemo_lib" ]
Anders Carlsson73119182018-03-15 09:41:03 +0100525
526 if (target_cpu == "x86") {
Artem Titov94b57c02019-03-21 13:35:10 +0100527 deps += [ "//testing/iossim" ]
Anders Carlsson73119182018-03-15 09:41:03 +0100528 }
529 }
tkchin2ddfdba2016-08-07 21:37:45 -0700530 }
531
532 if (is_mac) {
Mirko Bonadei86d053c2019-10-17 21:32:04 +0200533 rtc_library("AppRTCMobile_lib") {
kjellander1993b1d2017-03-06 00:29:21 -0800534 testonly = true
tkchin2ddfdba2016-08-07 21:37:45 -0700535 sources = [
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200536 "objc/AppRTCMobile/mac/APPRTCAppDelegate.h",
537 "objc/AppRTCMobile/mac/APPRTCAppDelegate.m",
538 "objc/AppRTCMobile/mac/APPRTCViewController.h",
539 "objc/AppRTCMobile/mac/APPRTCViewController.m",
tkchin2ddfdba2016-08-07 21:37:45 -0700540 ]
jianjun.zhuc0247402017-07-11 06:20:45 -0700541 configs += [ "..:common_objc" ]
tkchin2ddfdba2016-08-07 21:37:45 -0700542 deps = [
543 ":apprtc_common",
544 ":apprtc_signaling",
Mirko Bonadei19640aa2020-10-19 16:12:43 +0200545 "../sdk:base_objc",
546 "../sdk:helpers_objc",
547 "../sdk:mediaconstraints_objc",
548 "../sdk:metal_objc",
Jordan Rose53d3fc92021-07-06 12:16:41 -0700549 "../sdk:opengl_ui_objc",
Mirko Bonadei19640aa2020-10-19 16:12:43 +0200550 "../sdk:peerconnectionfactory_base_objc",
551 "../sdk:peerconnectionfactory_base_objc",
Mirko Bonadei19640aa2020-10-19 16:12:43 +0200552 "../sdk:videocapture_objc",
553 "../sdk:videocodec_objc",
tkchin2ddfdba2016-08-07 21:37:45 -0700554 ]
555 }
556
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200557 mac_app_bundle("AppRTCMobile") {
kjellander1993b1d2017-03-06 00:29:21 -0800558 testonly = true
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200559 output_name = "AppRTCMobile"
tkchin2ddfdba2016-08-07 21:37:45 -0700560
Mirko Bonadeiccbe95f2020-01-21 12:10:10 +0100561 sources = [ "objc/AppRTCMobile/mac/main.m" ]
tkchin2ddfdba2016-08-07 21:37:45 -0700562
563 public_configs = [ "..:common_inherited_config" ]
564
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200565 info_plist = "objc/AppRTCMobile/mac/Info.plist"
tkchin2ddfdba2016-08-07 21:37:45 -0700566
Sylvain Defresnec7f0dff2020-07-03 10:19:30 +0200567 frameworks = [ "AppKit.framework" ]
tkchin2ddfdba2016-08-07 21:37:45 -0700568
Anders Carlsson24d8ec32018-12-10 14:04:12 +0100569 ldflags = [
570 "-rpath",
571 "@executable_path/../Frameworks",
572 ]
573
tkchin2ddfdba2016-08-07 21:37:45 -0700574 deps = [
denicija77bfd7c2016-11-15 00:41:26 -0800575 ":AppRTCMobile_lib",
Anders Carlsson7bca8ca2018-08-30 09:30:29 +0200576 "../sdk:mac_framework_bundle",
577 "../sdk:mac_framework_objc+link",
tkchin2ddfdba2016-08-07 21:37:45 -0700578 ]
579 }
580 }
581
582 config("socketrocket_include_config") {
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200583 include_dirs = [ "objc/AppRTCMobile/third_party/SocketRocket" ]
tkchin2ddfdba2016-08-07 21:37:45 -0700584 }
585
586 config("socketrocket_warning_config") {
587 # GN orders flags on a target before flags from configs. The default config
588 # adds these flags so to cancel them out they need to come from a config and
589 # cannot be on the target directly.
590 cflags = [
591 "-Wno-deprecated-declarations",
592 "-Wno-nonnull",
tkchin2ddfdba2016-08-07 21:37:45 -0700593 "-Wno-semicolon-before-method-body",
kthelgasone47de1a2017-02-24 01:56:01 -0800594 "-Wno-unused-variable",
tkchin2ddfdba2016-08-07 21:37:45 -0700595 ]
596
henrika27d8b612016-09-21 04:13:00 -0700597 cflags_objc = [
598 # Enabled for cflags_objc in build/config/compiler/BUILD.gn.
599 "-Wno-objc-missing-property-synthesis",
henrika27d8b612016-09-21 04:13:00 -0700600 ]
tkchin2ddfdba2016-08-07 21:37:45 -0700601 }
602
Mirko Bonadei86d053c2019-10-17 21:32:04 +0200603 rtc_library("socketrocket") {
kjellander1993b1d2017-03-06 00:29:21 -0800604 testonly = true
tkchin2ddfdba2016-08-07 21:37:45 -0700605 sources = [
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200606 "objc/AppRTCMobile/third_party/SocketRocket/SRWebSocket.h",
607 "objc/AppRTCMobile/third_party/SocketRocket/SRWebSocket.m",
tkchin2ddfdba2016-08-07 21:37:45 -0700608 ]
kthelgasonc0977102017-04-24 00:57:16 -0700609 configs += [ ":socketrocket_warning_config" ]
ehmaldonadoe9cc6862016-09-05 06:10:18 -0700610 public_configs = [ ":socketrocket_include_config" ]
tkchin2ddfdba2016-08-07 21:37:45 -0700611
Sylvain Defresnec7f0dff2020-07-03 10:19:30 +0200612 libs = [ "icucore" ]
613 frameworks = [
tkchin2ddfdba2016-08-07 21:37:45 -0700614 "CFNetwork.framework",
Oleh Prypinb3f78de2019-07-18 22:25:48 +0200615 "Security.framework",
tkchin2ddfdba2016-08-07 21:37:45 -0700616 ]
617 }
adam.fedorbcc5d872016-11-07 14:53:28 -0800618
619 if (rtc_include_tests) {
kthelgason4065a572017-02-14 04:58:56 -0800620 # TODO(kthelgason): compile xctests on mac when chromium supports it.
621 if (is_ios) {
Mirko Bonadei86d053c2019-10-17 21:32:04 +0200622 rtc_library("apprtcmobile_test_sources") {
Mirko Bonadeicbaaaed2018-02-19 15:14:04 +0100623 # iOS must use WebRTC.framework which is dynamically linked.
kjellander1993b1d2017-03-06 00:29:21 -0800624 testonly = true
kthelgason4065a572017-02-14 04:58:56 -0800625 include_dirs = [
626 "objc/AppRTCMobile",
627 "objc/AppRTCMobile/ios",
628 ]
kthelgason4065a572017-02-14 04:58:56 -0800629 sources = [
630 "objc/AppRTCMobile/tests/ARDAppClient_xctest.mm",
Daniela012b56b2017-11-15 13:15:24 +0100631 "objc/AppRTCMobile/tests/ARDFileCaptureController_xctest.mm",
kthelgason4065a572017-02-14 04:58:56 -0800632 "objc/AppRTCMobile/tests/ARDSettingsModel_xctest.mm",
633 ]
kjellander1993b1d2017-03-06 00:29:21 -0800634 deps = [
kthelgason4065a572017-02-14 04:58:56 -0800635 ":AppRTCMobile_lib",
Mirko Bonadeicbaaaed2018-02-19 15:14:04 +0100636 ":apprtc_signaling",
Artem Titov94b57c02019-03-21 13:35:10 +0100637 "../rtc_base",
Mirko Bonadei19640aa2020-10-19 16:12:43 +0200638 "../sdk:mediaconstraints_objc",
639 "../sdk:peerconnectionfactory_base_objc",
640 "../sdk:videocapture_objc",
kthelgason4065a572017-02-14 04:58:56 -0800641 "//build/config/ios:xctest",
642 "//third_party/ocmock",
643 ]
adam.fedorbcc5d872016-11-07 14:53:28 -0800644 }
645
Mirko Bonadeiaef8a212020-09-16 15:09:53 +0200646 rtc_test("apprtcmobile_tests") {
647 is_xctest = true
kthelgason4065a572017-02-14 04:58:56 -0800648 info_plist = "objc/AppRTCMobile/ios/Info.plist"
Mirko Bonadeiccbe95f2020-01-21 12:10:10 +0100649 sources = [ "objc/AppRTCMobile/tests/main.mm" ]
kthelgason4065a572017-02-14 04:58:56 -0800650 deps = [
Mirko Bonadeicbaaaed2018-02-19 15:14:04 +0100651 ":AppRTCMobile_lib",
kthelgason4065a572017-02-14 04:58:56 -0800652 ":apprtcmobile_test_sources",
Mirko Bonadei1a339c32017-12-14 13:06:10 +0100653 "../sdk:framework_objc",
Artem Titarenko34fc3462018-11-06 12:29:29 +0100654 "//test:test_support",
kthelgason4065a572017-02-14 04:58:56 -0800655 ]
656 ldflags = [ "-all_load" ]
657 }
adam.fedorbcc5d872016-11-07 14:53:28 -0800658 }
659 }
tkchin2ddfdba2016-08-07 21:37:45 -0700660}
kthelgason0727f152016-08-08 09:03:23 -0700661
Hidehiko Abef264e702020-09-10 18:10:11 +0900662if (is_linux || is_chromeos || is_win) {
ehmaldonado38a21322016-09-02 04:10:34 -0700663 rtc_executable("peerconnection_client") {
kjellander1993b1d2017-03-06 00:29:21 -0800664 testonly = true
kthelgason0727f152016-08-08 09:03:23 -0700665 sources = [
666 "peerconnection/client/conductor.cc",
667 "peerconnection/client/conductor.h",
668 "peerconnection/client/defaults.cc",
669 "peerconnection/client/defaults.h",
670 "peerconnection/client/peer_connection_client.cc",
671 "peerconnection/client/peer_connection_client.h",
672 ]
ehmaldonado7a2ce0b2016-09-05 01:35:44 -0700673
Patrik Höglundb5b5bce2017-11-13 10:19:58 +0100674 deps = [
Yves Gerey3e707812018-11-28 16:47:49 +0100675 "../api:audio_options_api",
Mirko Bonadei2ff3f492018-11-22 09:00:13 +0100676 "../api:create_peerconnection_factory",
Mirko Bonadei34814c72018-01-11 10:13:56 +0100677 "../api:libjingle_peerconnection_api",
Niels Möllere942b142019-09-17 14:30:41 +0200678 "../api:media_stream_interface",
Mirko Bonadeid9708072019-01-25 20:26:48 +0100679 "../api:scoped_refptr",
Yves Gerey3e707812018-11-28 16:47:49 +0100680 "../api/audio:audio_mixer_api",
681 "../api/audio_codecs:audio_codecs_api",
Ilya Nikolaevskiy38e9b062020-10-08 14:36:33 +0000682 "../api/video:video_frame",
Chen Xing5d24b162019-06-10 12:59:38 +0200683 "../api/video:video_rtp_headers",
Yves Gerey3e707812018-11-28 16:47:49 +0100684 "../api/video_codecs:video_codecs_api",
685 "../media:rtc_media_base",
686 "../p2p:rtc_p2p",
Harald Alvestrand445e6b02020-09-29 14:21:47 +0000687 "../pc:video_track_source",
Patrik Höglunda8005cf2017-12-13 16:05:42 +0100688 "../rtc_base:checks",
Florent Castelli0af55ba2022-04-04 15:06:30 +0200689 "../rtc_base:logging",
Florent Castelli4467ad72022-04-04 15:18:46 +0200690 "../rtc_base:macromagic",
Mirko Bonadeie5f4c6b2021-01-15 10:41:01 +0100691 "../rtc_base:net_helpers",
Florent Castellif86f6f92022-04-05 02:54:12 +0200692 "../rtc_base:refcount",
Florent Castelli57aa81b2022-04-04 17:14:02 +0200693 "../rtc_base:stringutils",
Mirko Bonadeie5f4c6b2021-01-15 10:41:01 +0100694 "../rtc_base:threading",
Artem Titove41c4332018-07-25 15:04:28 +0200695 "../rtc_base/third_party/sigslot",
Bjorn Terelius3e676762018-10-29 15:26:27 +0100696 "../system_wrappers:field_trial",
697 "../test:field_trial",
Kári Tristan Helgasonede7cb22019-03-06 10:34:09 +0100698 "../test:platform_video_capturer",
Tommi25eb47c2019-08-29 16:39:05 +0200699 "../test:rtp_test_utils",
Niels Möllerb76be9a2018-12-20 16:28:23 +0100700 "//third_party/abseil-cpp/absl/memory",
Yves Gerey3e707812018-11-28 16:47:49 +0100701 "//third_party/abseil-cpp/absl/types:optional",
Patrik Höglundb5b5bce2017-11-13 10:19:58 +0100702 ]
kthelgason0727f152016-08-08 09:03:23 -0700703 if (is_win) {
704 sources += [
Steve Anton10542f22019-01-11 09:11:00 -0800705 "peerconnection/client/flag_defs.h",
kthelgason0727f152016-08-08 09:03:23 -0700706 "peerconnection/client/main.cc",
707 "peerconnection/client/main_wnd.cc",
708 "peerconnection/client/main_wnd.h",
709 ]
kthelgason0727f152016-08-08 09:03:23 -0700710 configs += [ "//build/config/win:windowed" ]
Tommi16db7ff2020-09-26 11:57:26 +0200711 deps += [
712 "../media:rtc_media_base",
713 "../rtc_base:win32",
714 ]
kthelgason0727f152016-08-08 09:03:23 -0700715 }
Hidehiko Abef264e702020-09-10 18:10:11 +0900716 if (is_linux || is_chromeos) {
kthelgason0727f152016-08-08 09:03:23 -0700717 sources += [
718 "peerconnection/client/linux/main.cc",
719 "peerconnection/client/linux/main_wnd.cc",
720 "peerconnection/client/linux/main_wnd.h",
721 ]
Henrik Kjellanderefbde2c2017-03-27 08:28:27 +0200722 cflags = [ "-Wno-deprecated-declarations" ]
kthelgason0727f152016-08-08 09:03:23 -0700723 libs = [
724 "X11",
725 "Xcomposite",
726 "Xext",
727 "Xrender",
728 ]
thomasandersonef16e992016-12-13 02:57:43 -0800729 deps += [ "//build/config/linux/gtk" ]
kthelgason0727f152016-08-08 09:03:23 -0700730 }
kjellander1993b1d2017-03-06 00:29:21 -0800731
732 deps += [
Niels Möller8366e172018-02-14 12:20:13 +0100733 "../api:libjingle_peerconnection_api",
Karl Wiberg1b0eae32017-10-17 14:48:54 +0200734 "../api/audio_codecs:builtin_audio_decoder_factory",
735 "../api/audio_codecs:builtin_audio_encoder_factory",
Niels Möllerc6ce9c52018-05-11 11:15:30 +0200736 "../api/video:video_frame",
Chen Xing5d24b162019-06-10 12:59:38 +0200737 "../api/video:video_rtp_headers",
Anders Carlsson67537952018-05-03 11:28:29 +0200738 "../api/video_codecs:builtin_video_decoder_factory",
739 "../api/video_codecs:builtin_video_encoder_factory",
Mirko Bonadei75baa492018-01-11 17:07:30 +0100740 "../media:rtc_audio_video",
Artem Titov94b57c02019-03-21 13:35:10 +0100741 "../modules/audio_device",
742 "../modules/audio_processing",
Alessio Bazzicab768e882018-11-07 14:29:54 +0000743 "../modules/audio_processing:api",
jianjun.zhuc0247402017-07-11 06:20:45 -0700744 "../modules/video_capture:video_capture_module",
745 "../pc:libjingle_peerconnection",
Artem Titov94b57c02019-03-21 13:35:10 +0100746 "../rtc_base",
ehmaldonadof6a861a2017-07-19 10:40:47 -0700747 "../rtc_base:rtc_base_approved",
748 "../rtc_base:rtc_json",
Niels Möllerb76be9a2018-12-20 16:28:23 +0100749 "../test:video_test_common",
Mirko Bonadei0be40bf2019-07-16 18:40:05 +0200750 "//third_party/abseil-cpp/absl/flags:flag",
751 "//third_party/abseil-cpp/absl/flags:parse",
kjellander1993b1d2017-03-06 00:29:21 -0800752 "//third_party/libyuv",
kjellander1993b1d2017-03-06 00:29:21 -0800753 ]
kthelgason0727f152016-08-08 09:03:23 -0700754 }
kjellanderd4626e52016-09-07 02:33:01 -0700755
ehmaldonado38a21322016-09-02 04:10:34 -0700756 rtc_executable("peerconnection_server") {
kjellander1993b1d2017-03-06 00:29:21 -0800757 testonly = true
kthelgason0727f152016-08-08 09:03:23 -0700758 sources = [
759 "peerconnection/server/data_socket.cc",
760 "peerconnection/server/data_socket.h",
761 "peerconnection/server/main.cc",
762 "peerconnection/server/peer_channel.cc",
763 "peerconnection/server/peer_channel.h",
764 "peerconnection/server/utils.cc",
765 "peerconnection/server/utils.h",
766 ]
767 deps = [
Mirko Bonadei25ab3222021-07-08 20:08:20 +0200768 "../rtc_base:checks",
ehmaldonadof6a861a2017-07-19 10:40:47 -0700769 "../rtc_base:rtc_base_approved",
Florent Castelli57aa81b2022-04-04 17:14:02 +0200770 "../rtc_base:stringutils",
Bjorn Terelius3e676762018-10-29 15:26:27 +0100771 "../system_wrappers:field_trial",
772 "../test:field_trial",
Mirko Bonadei04cffe32019-06-25 15:43:23 +0200773 "//third_party/abseil-cpp/absl/flags:flag",
774 "//third_party/abseil-cpp/absl/flags:parse",
Mirko Bonadei76c89da2019-07-19 12:12:14 +0200775 "//third_party/abseil-cpp/absl/flags:usage",
kthelgason0727f152016-08-08 09:03:23 -0700776 ]
kthelgason0727f152016-08-08 09:03:23 -0700777 }
ehmaldonado38a21322016-09-02 04:10:34 -0700778 rtc_executable("turnserver") {
kjellander1993b1d2017-03-06 00:29:21 -0800779 testonly = true
Mirko Bonadeiccbe95f2020-01-21 12:10:10 +0100780 sources = [ "turnserver/turnserver_main.cc" ]
kthelgason0727f152016-08-08 09:03:23 -0700781 deps = [
Niels Möller9862c2e2018-10-30 12:20:03 +0100782 ":read_auth_file",
Niels Möllera1342042018-11-08 16:47:14 +0100783 "../p2p:p2p_server_utils",
jianjun.zhuc0247402017-07-11 06:20:45 -0700784 "../p2p:rtc_p2p",
785 "../pc:rtc_pc",
Artem Titov94b57c02019-03-21 13:35:10 +0100786 "../rtc_base",
Mirko Bonadeie5f4c6b2021-01-15 10:41:01 +0100787 "../rtc_base:ip_address",
ehmaldonadof6a861a2017-07-19 10:40:47 -0700788 "../rtc_base:rtc_base_approved",
Mirko Bonadeie5f4c6b2021-01-15 10:41:01 +0100789 "../rtc_base:socket_address",
790 "../rtc_base:socket_server",
791 "../rtc_base:threading",
kthelgason0727f152016-08-08 09:03:23 -0700792 ]
kthelgason0727f152016-08-08 09:03:23 -0700793 }
ehmaldonado38a21322016-09-02 04:10:34 -0700794 rtc_executable("stunserver") {
kjellander1993b1d2017-03-06 00:29:21 -0800795 testonly = true
Mirko Bonadeiccbe95f2020-01-21 12:10:10 +0100796 sources = [ "stunserver/stunserver_main.cc" ]
kthelgason0727f152016-08-08 09:03:23 -0700797 deps = [
Niels Möllera1342042018-11-08 16:47:14 +0100798 "../p2p:p2p_server_utils",
jianjun.zhuc0247402017-07-11 06:20:45 -0700799 "../p2p:rtc_p2p",
800 "../pc:rtc_pc",
Artem Titov94b57c02019-03-21 13:35:10 +0100801 "../rtc_base",
ehmaldonadof6a861a2017-07-19 10:40:47 -0700802 "../rtc_base:rtc_base_approved",
Mirko Bonadeie5f4c6b2021-01-15 10:41:01 +0100803 "../rtc_base:socket_address",
804 "../rtc_base:socket_server",
805 "../rtc_base:threading",
kthelgason0727f152016-08-08 09:03:23 -0700806 ]
kthelgason0727f152016-08-08 09:03:23 -0700807 }
808}
charujainaca3a242016-11-01 03:09:15 -0700809
qiangchen42f96d52017-08-08 17:08:03 -0700810if (is_win || is_android) {
gyzhouad7cad82017-05-11 16:10:03 -0700811 rtc_shared_library("webrtc_unity_plugin") {
812 testonly = true
813 sources = [
814 "unityplugin/simple_peer_connection.cc",
815 "unityplugin/simple_peer_connection.h",
816 "unityplugin/unity_plugin_apis.cc",
817 "unityplugin/unity_plugin_apis.h",
gyzhoub38f3862017-07-25 16:04:31 -0700818 "unityplugin/video_observer.cc",
819 "unityplugin/video_observer.h",
gyzhouad7cad82017-05-11 16:10:03 -0700820 ]
qiangchen42f96d52017-08-08 17:08:03 -0700821
822 if (is_android) {
823 sources += [
Steve Anton10542f22019-01-11 09:11:00 -0800824 "unityplugin/class_reference_holder.cc",
825 "unityplugin/class_reference_holder.h",
qiangchen42f96d52017-08-08 17:08:03 -0700826 "unityplugin/jni_onload.cc",
827 ]
Qiang Chen43fb9122017-12-20 10:47:36 -0800828 suppressed_configs += [ "//build/config/android:hide_all_but_jni_onload" ]
qiangchen42f96d52017-08-08 17:08:03 -0700829 }
830
qiangchen42f96d52017-08-08 17:08:03 -0700831 if (is_win) {
Mirko Bonadeif957dd92018-07-11 10:47:42 +0200832 configs += [ "//build/config/win:windowed" ]
qiangchen42f96d52017-08-08 17:08:03 -0700833 }
gyzhouad7cad82017-05-11 16:10:03 -0700834 deps = [
Mirko Bonadei2ff3f492018-11-22 09:00:13 +0100835 "../api:create_peerconnection_factory",
Mirko Bonadei34814c72018-01-11 10:13:56 +0100836 "../api:libjingle_peerconnection_api",
Niels Möllere942b142019-09-17 14:30:41 +0200837 "../api:media_stream_interface",
Qiang Chen51e20462017-12-05 11:11:21 -0800838 "../api/audio_codecs:builtin_audio_decoder_factory",
839 "../api/audio_codecs:builtin_audio_encoder_factory",
Niels Möllerc6ce9c52018-05-11 11:15:30 +0200840 "../api/video:video_frame",
Chen Xing5d24b162019-06-10 12:59:38 +0200841 "../api/video:video_rtp_headers",
Mirko Bonadei75baa492018-01-11 17:07:30 +0100842 "../media:rtc_audio_video",
Anders Carlssona114c882018-01-04 15:10:22 +0100843 "../media:rtc_internal_video_codecs",
jianjun.zhuc0247402017-07-11 06:20:45 -0700844 "../media:rtc_media",
845 "../media:rtc_media_base",
Artem Titov94b57c02019-03-21 13:35:10 +0100846 "../modules/audio_device",
847 "../modules/audio_processing",
Alessio Bazzicab768e882018-11-07 14:29:54 +0000848 "../modules/audio_processing:api",
jianjun.zhuc0247402017-07-11 06:20:45 -0700849 "../modules/video_capture:video_capture_module",
850 "../pc:libjingle_peerconnection",
Harald Alvestrand445e6b02020-09-29 14:21:47 +0000851 "../pc:video_track_source",
Artem Titov94b57c02019-03-21 13:35:10 +0100852 "../rtc_base",
Kári Tristan Helgasonede7cb22019-03-06 10:34:09 +0100853 "../test:platform_video_capturer",
Niels Möller0a595352019-01-02 15:12:38 +0100854 "../test:video_test_common",
Karl Wiberg918f50c2018-07-05 11:40:33 +0200855 "//third_party/abseil-cpp/absl/memory",
gyzhouad7cad82017-05-11 16:10:03 -0700856 ]
qiangchen42f96d52017-08-08 17:08:03 -0700857 if (is_android) {
George Zhou2770c3d2018-03-07 09:58:54 -0800858 deps += [
Artem Titov94b57c02019-03-21 13:35:10 +0100859 "../modules/utility",
George Zhou2770c3d2018-03-07 09:58:54 -0800860 "../sdk/android:libjingle_peerconnection_jni",
861 ]
qiangchen42f96d52017-08-08 17:08:03 -0700862 }
863 }
864}
865
866if (is_android) {
Mirko Bonadeifbb3b7d2017-11-07 15:36:33 +0000867 rtc_android_library("webrtc_unity_java") {
Mirko Bonadeiccbe95f2020-01-21 12:10:10 +0100868 sources = [ "unityplugin/java/src/org/webrtc/UnityUtility.java" ]
qiangchen42f96d52017-08-08 17:08:03 -0700869 deps = [
870 "../rtc_base:base_java",
Artem Titarenko69540f42018-12-10 12:30:46 +0100871 "../sdk/android:camera_java",
qiangchen42f96d52017-08-08 17:08:03 -0700872 "../sdk/android:libjingle_peerconnection_java",
Artem Titarenko69540f42018-12-10 12:30:46 +0100873 "../sdk/android:peerconnection_java",
Mirko Bonadei5e987422020-07-10 10:36:04 +0200874 "../sdk/android:video_api_java",
Artem Titarenko69540f42018-12-10 12:30:46 +0100875 "../sdk/android:video_java",
Byoungchan Lee02334e02021-08-14 11:41:59 +0900876 "//third_party/androidx:androidx_annotation_annotation_java",
qiangchen42f96d52017-08-08 17:08:03 -0700877 ]
878 }
879
880 dist_jar("libwebrtc_unity") {
881 _target_dir_name = get_label_info(":$target_name", "dir")
882 output = "${root_out_dir}/lib.java${_target_dir_name}/${target_name}.jar"
George Zhou2770c3d2018-03-07 09:58:54 -0800883 direct_deps_only = false
qiangchen42f96d52017-08-08 17:08:03 -0700884 use_interface_jars = false
George Zhou2770c3d2018-03-07 09:58:54 -0800885 use_unprocessed_jars = false
Oleh Prypin86021d92017-09-24 22:29:06 +0200886 requires_android = true
qiangchen42f96d52017-08-08 17:08:03 -0700887 deps = [
888 ":webrtc_unity_java",
qiangchen42f96d52017-08-08 17:08:03 -0700889 "../rtc_base:base_java",
890 "../sdk/android:libjingle_peerconnection_java",
891 "../sdk/android:libjingle_peerconnection_metrics_default_java",
Byoungchan Lee02334e02021-08-14 11:41:59 +0900892 "//third_party/androidx:androidx_annotation_annotation_java",
qiangchen42f96d52017-08-08 17:08:03 -0700893 ]
gyzhouad7cad82017-05-11 16:10:03 -0700894 }
Mirko Bonadei73aa2de2020-01-20 15:28:57 +0100895
896 junit_binary("android_examples_junit_tests") {
897 sources = [
898 "androidjunit/src/org/appspot/apprtc/BluetoothManagerTest.java",
899 "androidjunit/src/org/appspot/apprtc/DirectRTCClientTest.java",
900 "androidjunit/src/org/appspot/apprtc/TCPChannelClientTest.java",
901 ]
902
903 deps = [
904 ":AppRTCMobile_javalib",
Artem Titova4dfe242020-06-03 16:42:57 +0200905 "../sdk/android:peerconnection_java",
Artem Titovebc563e2021-02-17 11:56:28 +0100906 "//third_party/androidx:androidx_test_core_java",
Mirko Bonadei73aa2de2020-01-20 15:28:57 +0100907 "//third_party/google-truth:google_truth_java",
908 ]
909
910 additional_jar_files = [ [
911 "../sdk/android/tests/resources/robolectric.properties",
912 "robolectric.properties",
913 ] ]
914 }
gyzhouad7cad82017-05-11 16:10:03 -0700915}
916
charujainaca3a242016-11-01 03:09:15 -0700917if (!build_with_chromium) {
918 # Doesn't build within Chrome on Win.
919 rtc_executable("stun_prober") {
kjellander1993b1d2017-03-06 00:29:21 -0800920 testonly = true
Mirko Bonadeiccbe95f2020-01-21 12:10:10 +0100921 sources = [ "stunprober/main.cc" ]
charujainaca3a242016-11-01 03:09:15 -0700922 deps = [
923 "../p2p:libstunprober",
924 "../p2p:rtc_p2p",
Artem Titov94b57c02019-03-21 13:35:10 +0100925 "../rtc_base",
Patrik Höglunda8005cf2017-12-13 16:05:42 +0100926 "../rtc_base:checks",
Florent Castelli0af55ba2022-04-04 15:06:30 +0200927 "../rtc_base:logging",
ehmaldonadof6a861a2017-07-19 10:40:47 -0700928 "../rtc_base:rtc_base_approved",
Mirko Bonadeie5f4c6b2021-01-15 10:41:01 +0100929 "../rtc_base:socket_address",
930 "../rtc_base:threading",
Florent Castellidd837e22022-04-04 17:16:15 +0200931 "../rtc_base:timeutils",
Jonas Orelandc06fe8b2022-03-28 14:58:26 +0200932 "../test:scoped_key_value_config",
Mirko Bonadei0be40bf2019-07-16 18:40:05 +0200933 "//third_party/abseil-cpp/absl/flags:flag",
934 "//third_party/abseil-cpp/absl/flags:parse",
charujainaca3a242016-11-01 03:09:15 -0700935 ]
936 }
937}