blob: d292174e188b471ab8040708d45e9206c817a2a6 [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",
Anders Carlsson73119182018-03-15 09:41:03 +0100490 "../api/audio_codecs:builtin_audio_decoder_factory",
491 "../api/audio_codecs:builtin_audio_encoder_factory",
Danil Chapovalov4ba04b72019-06-26 15:49:47 +0200492 "../api/rtc_event_log:rtc_event_log_factory",
Danil Chapovalovaaa11432019-05-17 13:20:14 +0200493 "../api/task_queue:default_task_queue_factory",
Anders Carlsson73119182018-03-15 09:41:03 +0100494 "../media:rtc_audio_video",
Artem Titov94b57c02019-03-21 13:35:10 +0100495 "../modules/audio_processing",
Alessio Bazzicab768e882018-11-07 14:29:54 +0000496 "../modules/audio_processing:api",
Anders Carlsson73119182018-03-15 09:41:03 +0100497 "../pc:libjingle_peerconnection",
Artem Titov94b57c02019-03-21 13:35:10 +0100498 "../rtc_base",
Markus Handell06d034f2020-07-07 09:17:56 +0200499 "../rtc_base/synchronization:mutex",
Anders Carlsson7bca8ca2018-08-30 09:30:29 +0200500 "../sdk:base_objc",
Anders Carlsson73119182018-03-15 09:41:03 +0100501 "../sdk:default_codec_factory_objc",
Anders Carlsson7bca8ca2018-08-30 09:30:29 +0200502 "../sdk:helpers_objc",
Jake Bromberg28e582d2021-06-22 11:34:29 -0700503 "../sdk:metal_objc",
Anders Carlsson73119182018-03-15 09:41:03 +0100504 "../sdk:native_api",
Anders Carlsson7bca8ca2018-08-30 09:30:29 +0200505 "../sdk:videocapture_objc",
Anders Carlsson73119182018-03-15 09:41:03 +0100506 "../sdk:videotoolbox_objc",
Anders Carlsson73119182018-03-15 09:41:03 +0100507 ]
508
Jordan Rose53d3fc92021-07-06 12:16:41 -0700509 if (rtc_ios_macos_use_opengl_rendering) {
510 deps += [ "../sdk:opengl_ui_objc" ]
Anders Carlsson73119182018-03-15 09:41:03 +0100511 }
512 }
513
514 ios_app_bundle("ObjCNativeAPIDemo") {
515 testonly = true
Mirko Bonadeiccbe95f2020-01-21 12:10:10 +0100516 sources = [ "objcnativeapi/objc/main.m" ]
Anders Carlsson73119182018-03-15 09:41:03 +0100517
518 info_plist = "objcnativeapi/Info.plist"
519
520 configs += [ "..:common_config" ]
521 public_configs = [ "..:common_inherited_config" ]
522
Mirko Bonadeiccbe95f2020-01-21 12:10:10 +0100523 deps = [ ":ObjCNativeAPIDemo_lib" ]
Anders Carlsson73119182018-03-15 09:41:03 +0100524
525 if (target_cpu == "x86") {
Artem Titov94b57c02019-03-21 13:35:10 +0100526 deps += [ "//testing/iossim" ]
Anders Carlsson73119182018-03-15 09:41:03 +0100527 }
528 }
tkchin2ddfdba2016-08-07 21:37:45 -0700529 }
530
531 if (is_mac) {
Mirko Bonadei86d053c2019-10-17 21:32:04 +0200532 rtc_library("AppRTCMobile_lib") {
kjellander1993b1d2017-03-06 00:29:21 -0800533 testonly = true
tkchin2ddfdba2016-08-07 21:37:45 -0700534 sources = [
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200535 "objc/AppRTCMobile/mac/APPRTCAppDelegate.h",
536 "objc/AppRTCMobile/mac/APPRTCAppDelegate.m",
537 "objc/AppRTCMobile/mac/APPRTCViewController.h",
538 "objc/AppRTCMobile/mac/APPRTCViewController.m",
tkchin2ddfdba2016-08-07 21:37:45 -0700539 ]
jianjun.zhuc0247402017-07-11 06:20:45 -0700540 configs += [ "..:common_objc" ]
tkchin2ddfdba2016-08-07 21:37:45 -0700541 deps = [
542 ":apprtc_common",
543 ":apprtc_signaling",
Mirko Bonadei19640aa2020-10-19 16:12:43 +0200544 "../sdk:base_objc",
545 "../sdk:helpers_objc",
546 "../sdk:mediaconstraints_objc",
547 "../sdk:metal_objc",
Jordan Rose53d3fc92021-07-06 12:16:41 -0700548 "../sdk:opengl_ui_objc",
Mirko Bonadei19640aa2020-10-19 16:12:43 +0200549 "../sdk:peerconnectionfactory_base_objc",
550 "../sdk:peerconnectionfactory_base_objc",
Mirko Bonadei19640aa2020-10-19 16:12:43 +0200551 "../sdk:videocapture_objc",
552 "../sdk:videocodec_objc",
tkchin2ddfdba2016-08-07 21:37:45 -0700553 ]
554 }
555
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200556 mac_app_bundle("AppRTCMobile") {
kjellander1993b1d2017-03-06 00:29:21 -0800557 testonly = true
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200558 output_name = "AppRTCMobile"
tkchin2ddfdba2016-08-07 21:37:45 -0700559
Mirko Bonadeiccbe95f2020-01-21 12:10:10 +0100560 sources = [ "objc/AppRTCMobile/mac/main.m" ]
tkchin2ddfdba2016-08-07 21:37:45 -0700561
562 public_configs = [ "..:common_inherited_config" ]
563
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200564 info_plist = "objc/AppRTCMobile/mac/Info.plist"
tkchin2ddfdba2016-08-07 21:37:45 -0700565
Sylvain Defresnec7f0dff2020-07-03 10:19:30 +0200566 frameworks = [ "AppKit.framework" ]
tkchin2ddfdba2016-08-07 21:37:45 -0700567
Anders Carlsson24d8ec32018-12-10 14:04:12 +0100568 ldflags = [
569 "-rpath",
570 "@executable_path/../Frameworks",
571 ]
572
tkchin2ddfdba2016-08-07 21:37:45 -0700573 deps = [
denicija77bfd7c2016-11-15 00:41:26 -0800574 ":AppRTCMobile_lib",
Anders Carlsson7bca8ca2018-08-30 09:30:29 +0200575 "../sdk:mac_framework_bundle",
576 "../sdk:mac_framework_objc+link",
tkchin2ddfdba2016-08-07 21:37:45 -0700577 ]
578 }
579 }
580
581 config("socketrocket_include_config") {
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200582 include_dirs = [ "objc/AppRTCMobile/third_party/SocketRocket" ]
tkchin2ddfdba2016-08-07 21:37:45 -0700583 }
584
585 config("socketrocket_warning_config") {
586 # GN orders flags on a target before flags from configs. The default config
587 # adds these flags so to cancel them out they need to come from a config and
588 # cannot be on the target directly.
589 cflags = [
590 "-Wno-deprecated-declarations",
591 "-Wno-nonnull",
tkchin2ddfdba2016-08-07 21:37:45 -0700592 "-Wno-semicolon-before-method-body",
kthelgasone47de1a2017-02-24 01:56:01 -0800593 "-Wno-unused-variable",
tkchin2ddfdba2016-08-07 21:37:45 -0700594 ]
595
henrika27d8b612016-09-21 04:13:00 -0700596 cflags_objc = [
597 # Enabled for cflags_objc in build/config/compiler/BUILD.gn.
598 "-Wno-objc-missing-property-synthesis",
henrika27d8b612016-09-21 04:13:00 -0700599 ]
tkchin2ddfdba2016-08-07 21:37:45 -0700600 }
601
Mirko Bonadei86d053c2019-10-17 21:32:04 +0200602 rtc_library("socketrocket") {
kjellander1993b1d2017-03-06 00:29:21 -0800603 testonly = true
tkchin2ddfdba2016-08-07 21:37:45 -0700604 sources = [
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200605 "objc/AppRTCMobile/third_party/SocketRocket/SRWebSocket.h",
606 "objc/AppRTCMobile/third_party/SocketRocket/SRWebSocket.m",
tkchin2ddfdba2016-08-07 21:37:45 -0700607 ]
kthelgasonc0977102017-04-24 00:57:16 -0700608 configs += [ ":socketrocket_warning_config" ]
ehmaldonadoe9cc6862016-09-05 06:10:18 -0700609 public_configs = [ ":socketrocket_include_config" ]
tkchin2ddfdba2016-08-07 21:37:45 -0700610
Sylvain Defresnec7f0dff2020-07-03 10:19:30 +0200611 libs = [ "icucore" ]
612 frameworks = [
tkchin2ddfdba2016-08-07 21:37:45 -0700613 "CFNetwork.framework",
Oleh Prypinb3f78de2019-07-18 22:25:48 +0200614 "Security.framework",
tkchin2ddfdba2016-08-07 21:37:45 -0700615 ]
616 }
adam.fedorbcc5d872016-11-07 14:53:28 -0800617
618 if (rtc_include_tests) {
kthelgason4065a572017-02-14 04:58:56 -0800619 # TODO(kthelgason): compile xctests on mac when chromium supports it.
620 if (is_ios) {
Mirko Bonadei86d053c2019-10-17 21:32:04 +0200621 rtc_library("apprtcmobile_test_sources") {
Mirko Bonadeicbaaaed2018-02-19 15:14:04 +0100622 # iOS must use WebRTC.framework which is dynamically linked.
kjellander1993b1d2017-03-06 00:29:21 -0800623 testonly = true
kthelgason4065a572017-02-14 04:58:56 -0800624 include_dirs = [
625 "objc/AppRTCMobile",
626 "objc/AppRTCMobile/ios",
627 ]
kthelgason4065a572017-02-14 04:58:56 -0800628 sources = [
629 "objc/AppRTCMobile/tests/ARDAppClient_xctest.mm",
Daniela012b56b2017-11-15 13:15:24 +0100630 "objc/AppRTCMobile/tests/ARDFileCaptureController_xctest.mm",
kthelgason4065a572017-02-14 04:58:56 -0800631 "objc/AppRTCMobile/tests/ARDSettingsModel_xctest.mm",
632 ]
kjellander1993b1d2017-03-06 00:29:21 -0800633 deps = [
kthelgason4065a572017-02-14 04:58:56 -0800634 ":AppRTCMobile_lib",
Mirko Bonadeicbaaaed2018-02-19 15:14:04 +0100635 ":apprtc_signaling",
Artem Titov94b57c02019-03-21 13:35:10 +0100636 "../rtc_base",
Mirko Bonadei19640aa2020-10-19 16:12:43 +0200637 "../sdk:mediaconstraints_objc",
638 "../sdk:peerconnectionfactory_base_objc",
639 "../sdk:videocapture_objc",
kthelgason4065a572017-02-14 04:58:56 -0800640 "//build/config/ios:xctest",
641 "//third_party/ocmock",
642 ]
adam.fedorbcc5d872016-11-07 14:53:28 -0800643 }
644
Mirko Bonadeiaef8a212020-09-16 15:09:53 +0200645 rtc_test("apprtcmobile_tests") {
646 is_xctest = true
kthelgason4065a572017-02-14 04:58:56 -0800647 info_plist = "objc/AppRTCMobile/ios/Info.plist"
Mirko Bonadeiccbe95f2020-01-21 12:10:10 +0100648 sources = [ "objc/AppRTCMobile/tests/main.mm" ]
kthelgason4065a572017-02-14 04:58:56 -0800649 deps = [
Mirko Bonadeicbaaaed2018-02-19 15:14:04 +0100650 ":AppRTCMobile_lib",
kthelgason4065a572017-02-14 04:58:56 -0800651 ":apprtcmobile_test_sources",
Mirko Bonadei1a339c32017-12-14 13:06:10 +0100652 "../sdk:framework_objc",
Artem Titarenko34fc3462018-11-06 12:29:29 +0100653 "//test:test_support",
kthelgason4065a572017-02-14 04:58:56 -0800654 ]
655 ldflags = [ "-all_load" ]
656 }
adam.fedorbcc5d872016-11-07 14:53:28 -0800657 }
658 }
tkchin2ddfdba2016-08-07 21:37:45 -0700659}
kthelgason0727f152016-08-08 09:03:23 -0700660
Hidehiko Abef264e702020-09-10 18:10:11 +0900661if (is_linux || is_chromeos || is_win) {
ehmaldonado38a21322016-09-02 04:10:34 -0700662 rtc_executable("peerconnection_client") {
kjellander1993b1d2017-03-06 00:29:21 -0800663 testonly = true
kthelgason0727f152016-08-08 09:03:23 -0700664 sources = [
665 "peerconnection/client/conductor.cc",
666 "peerconnection/client/conductor.h",
667 "peerconnection/client/defaults.cc",
668 "peerconnection/client/defaults.h",
669 "peerconnection/client/peer_connection_client.cc",
670 "peerconnection/client/peer_connection_client.h",
671 ]
ehmaldonado7a2ce0b2016-09-05 01:35:44 -0700672
Patrik Höglundb5b5bce2017-11-13 10:19:58 +0100673 deps = [
Yves Gerey3e707812018-11-28 16:47:49 +0100674 "../api:audio_options_api",
Mirko Bonadei2ff3f492018-11-22 09:00:13 +0100675 "../api:create_peerconnection_factory",
Mirko Bonadei34814c72018-01-11 10:13:56 +0100676 "../api:libjingle_peerconnection_api",
Niels Möllere942b142019-09-17 14:30:41 +0200677 "../api:media_stream_interface",
Mirko Bonadeid9708072019-01-25 20:26:48 +0100678 "../api:scoped_refptr",
Yves Gerey3e707812018-11-28 16:47:49 +0100679 "../api/audio:audio_mixer_api",
680 "../api/audio_codecs:audio_codecs_api",
Ilya Nikolaevskiy38e9b062020-10-08 14:36:33 +0000681 "../api/video:video_frame",
Chen Xing5d24b162019-06-10 12:59:38 +0200682 "../api/video:video_rtp_headers",
Yves Gerey3e707812018-11-28 16:47:49 +0100683 "../api/video_codecs:video_codecs_api",
684 "../media:rtc_media_base",
685 "../p2p:rtc_p2p",
Harald Alvestrand445e6b02020-09-29 14:21:47 +0000686 "../pc:video_track_source",
Patrik Höglunda8005cf2017-12-13 16:05:42 +0100687 "../rtc_base:checks",
Florent Castelli0af55ba2022-04-04 15:06:30 +0200688 "../rtc_base:logging",
Florent Castelli4467ad72022-04-04 15:18:46 +0200689 "../rtc_base:macromagic",
Mirko Bonadeie5f4c6b2021-01-15 10:41:01 +0100690 "../rtc_base:net_helpers",
Florent Castellif86f6f92022-04-05 02:54:12 +0200691 "../rtc_base:refcount",
Florent Castelli57aa81b2022-04-04 17:14:02 +0200692 "../rtc_base:stringutils",
Mirko Bonadeie5f4c6b2021-01-15 10:41:01 +0100693 "../rtc_base:threading",
Artem Titove41c4332018-07-25 15:04:28 +0200694 "../rtc_base/third_party/sigslot",
Bjorn Terelius3e676762018-10-29 15:26:27 +0100695 "../system_wrappers:field_trial",
696 "../test:field_trial",
Kári Tristan Helgasonede7cb22019-03-06 10:34:09 +0100697 "../test:platform_video_capturer",
Tommi25eb47c2019-08-29 16:39:05 +0200698 "../test:rtp_test_utils",
Niels Möllerb76be9a2018-12-20 16:28:23 +0100699 "//third_party/abseil-cpp/absl/memory",
Yves Gerey3e707812018-11-28 16:47:49 +0100700 "//third_party/abseil-cpp/absl/types:optional",
Patrik Höglundb5b5bce2017-11-13 10:19:58 +0100701 ]
kthelgason0727f152016-08-08 09:03:23 -0700702 if (is_win) {
703 sources += [
Steve Anton10542f22019-01-11 09:11:00 -0800704 "peerconnection/client/flag_defs.h",
kthelgason0727f152016-08-08 09:03:23 -0700705 "peerconnection/client/main.cc",
706 "peerconnection/client/main_wnd.cc",
707 "peerconnection/client/main_wnd.h",
708 ]
kthelgason0727f152016-08-08 09:03:23 -0700709 configs += [ "//build/config/win:windowed" ]
Tommi16db7ff2020-09-26 11:57:26 +0200710 deps += [
711 "../media:rtc_media_base",
712 "../rtc_base:win32",
713 ]
kthelgason0727f152016-08-08 09:03:23 -0700714 }
Hidehiko Abef264e702020-09-10 18:10:11 +0900715 if (is_linux || is_chromeos) {
kthelgason0727f152016-08-08 09:03:23 -0700716 sources += [
717 "peerconnection/client/linux/main.cc",
718 "peerconnection/client/linux/main_wnd.cc",
719 "peerconnection/client/linux/main_wnd.h",
720 ]
Henrik Kjellanderefbde2c2017-03-27 08:28:27 +0200721 cflags = [ "-Wno-deprecated-declarations" ]
kthelgason0727f152016-08-08 09:03:23 -0700722 libs = [
723 "X11",
724 "Xcomposite",
725 "Xext",
726 "Xrender",
727 ]
thomasandersonef16e992016-12-13 02:57:43 -0800728 deps += [ "//build/config/linux/gtk" ]
kthelgason0727f152016-08-08 09:03:23 -0700729 }
kjellander1993b1d2017-03-06 00:29:21 -0800730
731 deps += [
Niels Möller8366e172018-02-14 12:20:13 +0100732 "../api:libjingle_peerconnection_api",
Karl Wiberg1b0eae32017-10-17 14:48:54 +0200733 "../api/audio_codecs:builtin_audio_decoder_factory",
734 "../api/audio_codecs:builtin_audio_encoder_factory",
Niels Möllerc6ce9c52018-05-11 11:15:30 +0200735 "../api/video:video_frame",
Chen Xing5d24b162019-06-10 12:59:38 +0200736 "../api/video:video_rtp_headers",
Anders Carlsson67537952018-05-03 11:28:29 +0200737 "../api/video_codecs:builtin_video_decoder_factory",
738 "../api/video_codecs:builtin_video_encoder_factory",
Mirko Bonadei75baa492018-01-11 17:07:30 +0100739 "../media:rtc_audio_video",
Artem Titov94b57c02019-03-21 13:35:10 +0100740 "../modules/audio_device",
741 "../modules/audio_processing",
Alessio Bazzicab768e882018-11-07 14:29:54 +0000742 "../modules/audio_processing:api",
jianjun.zhuc0247402017-07-11 06:20:45 -0700743 "../modules/video_capture:video_capture_module",
744 "../pc:libjingle_peerconnection",
Artem Titov94b57c02019-03-21 13:35:10 +0100745 "../rtc_base",
ehmaldonadof6a861a2017-07-19 10:40:47 -0700746 "../rtc_base:rtc_base_approved",
747 "../rtc_base:rtc_json",
Niels Möllerb76be9a2018-12-20 16:28:23 +0100748 "../test:video_test_common",
Mirko Bonadei0be40bf2019-07-16 18:40:05 +0200749 "//third_party/abseil-cpp/absl/flags:flag",
750 "//third_party/abseil-cpp/absl/flags:parse",
kjellander1993b1d2017-03-06 00:29:21 -0800751 "//third_party/libyuv",
kjellander1993b1d2017-03-06 00:29:21 -0800752 ]
kthelgason0727f152016-08-08 09:03:23 -0700753 }
kjellanderd4626e52016-09-07 02:33:01 -0700754
ehmaldonado38a21322016-09-02 04:10:34 -0700755 rtc_executable("peerconnection_server") {
kjellander1993b1d2017-03-06 00:29:21 -0800756 testonly = true
kthelgason0727f152016-08-08 09:03:23 -0700757 sources = [
758 "peerconnection/server/data_socket.cc",
759 "peerconnection/server/data_socket.h",
760 "peerconnection/server/main.cc",
761 "peerconnection/server/peer_channel.cc",
762 "peerconnection/server/peer_channel.h",
763 "peerconnection/server/utils.cc",
764 "peerconnection/server/utils.h",
765 ]
766 deps = [
Mirko Bonadei25ab3222021-07-08 20:08:20 +0200767 "../rtc_base:checks",
ehmaldonadof6a861a2017-07-19 10:40:47 -0700768 "../rtc_base:rtc_base_approved",
Florent Castelli57aa81b2022-04-04 17:14:02 +0200769 "../rtc_base:stringutils",
Bjorn Terelius3e676762018-10-29 15:26:27 +0100770 "../system_wrappers:field_trial",
771 "../test:field_trial",
Mirko Bonadei04cffe32019-06-25 15:43:23 +0200772 "//third_party/abseil-cpp/absl/flags:flag",
773 "//third_party/abseil-cpp/absl/flags:parse",
Mirko Bonadei76c89da2019-07-19 12:12:14 +0200774 "//third_party/abseil-cpp/absl/flags:usage",
kthelgason0727f152016-08-08 09:03:23 -0700775 ]
kthelgason0727f152016-08-08 09:03:23 -0700776 }
ehmaldonado38a21322016-09-02 04:10:34 -0700777 rtc_executable("turnserver") {
kjellander1993b1d2017-03-06 00:29:21 -0800778 testonly = true
Mirko Bonadeiccbe95f2020-01-21 12:10:10 +0100779 sources = [ "turnserver/turnserver_main.cc" ]
kthelgason0727f152016-08-08 09:03:23 -0700780 deps = [
Niels Möller9862c2e2018-10-30 12:20:03 +0100781 ":read_auth_file",
Niels Möllera1342042018-11-08 16:47:14 +0100782 "../p2p:p2p_server_utils",
jianjun.zhuc0247402017-07-11 06:20:45 -0700783 "../p2p:rtc_p2p",
784 "../pc:rtc_pc",
Artem Titov94b57c02019-03-21 13:35:10 +0100785 "../rtc_base",
Mirko Bonadeie5f4c6b2021-01-15 10:41:01 +0100786 "../rtc_base:ip_address",
ehmaldonadof6a861a2017-07-19 10:40:47 -0700787 "../rtc_base:rtc_base_approved",
Mirko Bonadeie5f4c6b2021-01-15 10:41:01 +0100788 "../rtc_base:socket_address",
789 "../rtc_base:socket_server",
790 "../rtc_base:threading",
kthelgason0727f152016-08-08 09:03:23 -0700791 ]
kthelgason0727f152016-08-08 09:03:23 -0700792 }
ehmaldonado38a21322016-09-02 04:10:34 -0700793 rtc_executable("stunserver") {
kjellander1993b1d2017-03-06 00:29:21 -0800794 testonly = true
Mirko Bonadeiccbe95f2020-01-21 12:10:10 +0100795 sources = [ "stunserver/stunserver_main.cc" ]
kthelgason0727f152016-08-08 09:03:23 -0700796 deps = [
Niels Möllera1342042018-11-08 16:47:14 +0100797 "../p2p:p2p_server_utils",
jianjun.zhuc0247402017-07-11 06:20:45 -0700798 "../p2p:rtc_p2p",
799 "../pc:rtc_pc",
Artem Titov94b57c02019-03-21 13:35:10 +0100800 "../rtc_base",
ehmaldonadof6a861a2017-07-19 10:40:47 -0700801 "../rtc_base:rtc_base_approved",
Mirko Bonadeie5f4c6b2021-01-15 10:41:01 +0100802 "../rtc_base:socket_address",
803 "../rtc_base:socket_server",
804 "../rtc_base:threading",
kthelgason0727f152016-08-08 09:03:23 -0700805 ]
kthelgason0727f152016-08-08 09:03:23 -0700806 }
807}
charujainaca3a242016-11-01 03:09:15 -0700808
qiangchen42f96d52017-08-08 17:08:03 -0700809if (is_win || is_android) {
gyzhouad7cad82017-05-11 16:10:03 -0700810 rtc_shared_library("webrtc_unity_plugin") {
811 testonly = true
812 sources = [
813 "unityplugin/simple_peer_connection.cc",
814 "unityplugin/simple_peer_connection.h",
815 "unityplugin/unity_plugin_apis.cc",
816 "unityplugin/unity_plugin_apis.h",
gyzhoub38f3862017-07-25 16:04:31 -0700817 "unityplugin/video_observer.cc",
818 "unityplugin/video_observer.h",
gyzhouad7cad82017-05-11 16:10:03 -0700819 ]
qiangchen42f96d52017-08-08 17:08:03 -0700820
821 if (is_android) {
822 sources += [
Steve Anton10542f22019-01-11 09:11:00 -0800823 "unityplugin/class_reference_holder.cc",
824 "unityplugin/class_reference_holder.h",
qiangchen42f96d52017-08-08 17:08:03 -0700825 "unityplugin/jni_onload.cc",
826 ]
Qiang Chen43fb9122017-12-20 10:47:36 -0800827 suppressed_configs += [ "//build/config/android:hide_all_but_jni_onload" ]
qiangchen42f96d52017-08-08 17:08:03 -0700828 }
829
qiangchen42f96d52017-08-08 17:08:03 -0700830 if (is_win) {
Mirko Bonadeif957dd92018-07-11 10:47:42 +0200831 configs += [ "//build/config/win:windowed" ]
qiangchen42f96d52017-08-08 17:08:03 -0700832 }
gyzhouad7cad82017-05-11 16:10:03 -0700833 deps = [
Mirko Bonadei2ff3f492018-11-22 09:00:13 +0100834 "../api:create_peerconnection_factory",
Mirko Bonadei34814c72018-01-11 10:13:56 +0100835 "../api:libjingle_peerconnection_api",
Niels Möllere942b142019-09-17 14:30:41 +0200836 "../api:media_stream_interface",
Qiang Chen51e20462017-12-05 11:11:21 -0800837 "../api/audio_codecs:builtin_audio_decoder_factory",
838 "../api/audio_codecs:builtin_audio_encoder_factory",
Niels Möllerc6ce9c52018-05-11 11:15:30 +0200839 "../api/video:video_frame",
Chen Xing5d24b162019-06-10 12:59:38 +0200840 "../api/video:video_rtp_headers",
Mirko Bonadei75baa492018-01-11 17:07:30 +0100841 "../media:rtc_audio_video",
Anders Carlssona114c882018-01-04 15:10:22 +0100842 "../media:rtc_internal_video_codecs",
jianjun.zhuc0247402017-07-11 06:20:45 -0700843 "../media:rtc_media",
844 "../media:rtc_media_base",
Artem Titov94b57c02019-03-21 13:35:10 +0100845 "../modules/audio_device",
846 "../modules/audio_processing",
Alessio Bazzicab768e882018-11-07 14:29:54 +0000847 "../modules/audio_processing:api",
jianjun.zhuc0247402017-07-11 06:20:45 -0700848 "../modules/video_capture:video_capture_module",
849 "../pc:libjingle_peerconnection",
Harald Alvestrand445e6b02020-09-29 14:21:47 +0000850 "../pc:video_track_source",
Artem Titov94b57c02019-03-21 13:35:10 +0100851 "../rtc_base",
Kári Tristan Helgasonede7cb22019-03-06 10:34:09 +0100852 "../test:platform_video_capturer",
Niels Möller0a595352019-01-02 15:12:38 +0100853 "../test:video_test_common",
Karl Wiberg918f50c2018-07-05 11:40:33 +0200854 "//third_party/abseil-cpp/absl/memory",
gyzhouad7cad82017-05-11 16:10:03 -0700855 ]
qiangchen42f96d52017-08-08 17:08:03 -0700856 if (is_android) {
George Zhou2770c3d2018-03-07 09:58:54 -0800857 deps += [
Artem Titov94b57c02019-03-21 13:35:10 +0100858 "../modules/utility",
George Zhou2770c3d2018-03-07 09:58:54 -0800859 "../sdk/android:libjingle_peerconnection_jni",
860 ]
qiangchen42f96d52017-08-08 17:08:03 -0700861 }
862 }
863}
864
865if (is_android) {
Mirko Bonadeifbb3b7d2017-11-07 15:36:33 +0000866 rtc_android_library("webrtc_unity_java") {
Mirko Bonadeiccbe95f2020-01-21 12:10:10 +0100867 sources = [ "unityplugin/java/src/org/webrtc/UnityUtility.java" ]
qiangchen42f96d52017-08-08 17:08:03 -0700868 deps = [
869 "../rtc_base:base_java",
Artem Titarenko69540f42018-12-10 12:30:46 +0100870 "../sdk/android:camera_java",
qiangchen42f96d52017-08-08 17:08:03 -0700871 "../sdk/android:libjingle_peerconnection_java",
Artem Titarenko69540f42018-12-10 12:30:46 +0100872 "../sdk/android:peerconnection_java",
Mirko Bonadei5e987422020-07-10 10:36:04 +0200873 "../sdk/android:video_api_java",
Artem Titarenko69540f42018-12-10 12:30:46 +0100874 "../sdk/android:video_java",
Byoungchan Lee02334e02021-08-14 11:41:59 +0900875 "//third_party/androidx:androidx_annotation_annotation_java",
qiangchen42f96d52017-08-08 17:08:03 -0700876 ]
877 }
878
879 dist_jar("libwebrtc_unity") {
880 _target_dir_name = get_label_info(":$target_name", "dir")
881 output = "${root_out_dir}/lib.java${_target_dir_name}/${target_name}.jar"
George Zhou2770c3d2018-03-07 09:58:54 -0800882 direct_deps_only = false
qiangchen42f96d52017-08-08 17:08:03 -0700883 use_interface_jars = false
George Zhou2770c3d2018-03-07 09:58:54 -0800884 use_unprocessed_jars = false
Oleh Prypin86021d92017-09-24 22:29:06 +0200885 requires_android = true
qiangchen42f96d52017-08-08 17:08:03 -0700886 deps = [
887 ":webrtc_unity_java",
qiangchen42f96d52017-08-08 17:08:03 -0700888 "../rtc_base:base_java",
889 "../sdk/android:libjingle_peerconnection_java",
890 "../sdk/android:libjingle_peerconnection_metrics_default_java",
Byoungchan Lee02334e02021-08-14 11:41:59 +0900891 "//third_party/androidx:androidx_annotation_annotation_java",
qiangchen42f96d52017-08-08 17:08:03 -0700892 ]
gyzhouad7cad82017-05-11 16:10:03 -0700893 }
Mirko Bonadei73aa2de2020-01-20 15:28:57 +0100894
895 junit_binary("android_examples_junit_tests") {
896 sources = [
897 "androidjunit/src/org/appspot/apprtc/BluetoothManagerTest.java",
898 "androidjunit/src/org/appspot/apprtc/DirectRTCClientTest.java",
899 "androidjunit/src/org/appspot/apprtc/TCPChannelClientTest.java",
900 ]
901
902 deps = [
903 ":AppRTCMobile_javalib",
Artem Titova4dfe242020-06-03 16:42:57 +0200904 "../sdk/android:peerconnection_java",
Artem Titovebc563e2021-02-17 11:56:28 +0100905 "//third_party/androidx:androidx_test_core_java",
Mirko Bonadei73aa2de2020-01-20 15:28:57 +0100906 "//third_party/google-truth:google_truth_java",
907 ]
908
909 additional_jar_files = [ [
910 "../sdk/android/tests/resources/robolectric.properties",
911 "robolectric.properties",
912 ] ]
913 }
gyzhouad7cad82017-05-11 16:10:03 -0700914}
915
charujainaca3a242016-11-01 03:09:15 -0700916if (!build_with_chromium) {
917 # Doesn't build within Chrome on Win.
918 rtc_executable("stun_prober") {
kjellander1993b1d2017-03-06 00:29:21 -0800919 testonly = true
Mirko Bonadeiccbe95f2020-01-21 12:10:10 +0100920 sources = [ "stunprober/main.cc" ]
charujainaca3a242016-11-01 03:09:15 -0700921 deps = [
922 "../p2p:libstunprober",
923 "../p2p:rtc_p2p",
Artem Titov94b57c02019-03-21 13:35:10 +0100924 "../rtc_base",
Patrik Höglunda8005cf2017-12-13 16:05:42 +0100925 "../rtc_base:checks",
Florent Castelli0af55ba2022-04-04 15:06:30 +0200926 "../rtc_base:logging",
ehmaldonadof6a861a2017-07-19 10:40:47 -0700927 "../rtc_base:rtc_base_approved",
Mirko Bonadeie5f4c6b2021-01-15 10:41:01 +0100928 "../rtc_base:socket_address",
929 "../rtc_base:threading",
Florent Castellidd837e22022-04-04 17:16:15 +0200930 "../rtc_base:timeutils",
Jonas Orelandc06fe8b2022-03-28 14:58:26 +0200931 "../test:scoped_key_value_config",
Mirko Bonadei0be40bf2019-07-16 18:40:05 +0200932 "//third_party/abseil-cpp/absl/flags:flag",
933 "//third_party/abseil-cpp/absl/flags:parse",
charujainaca3a242016-11-01 03:09:15 -0700934 ]
935 }
936}