blob: 18cb6ecc679581b42dd705f6e17bea6b7e6d112d [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")
Tom Anderson06e4fc52022-04-06 15:22:33 -070018} else if (is_linux || is_chromeos) {
19 import("//build/config/linux/pkg_config.gni")
Sami Kalliomaki9c0c75b2016-06-29 14:55:00 +020020}
21
22group("examples") {
kjellander6ceab082016-10-28 05:44:03 -070023 # This target shall build all targets in examples.
24 testonly = true
Mirko Bonadei1a339c32017-12-14 13:06:10 +010025 deps = []
Sami Kalliomaki9c0c75b2016-06-29 14:55:00 +020026
tkchin2ddfdba2016-08-07 21:37:45 -070027 if (is_android) {
Mirko Bonadei1a339c32017-12-14 13:06:10 +010028 deps += [
kjellander6ceab082016-10-28 05:44:03 -070029 ":AppRTCMobile",
Sami Kalliomäkid54f5f52018-08-03 13:23:05 +020030 ":AppRTCMobile_test_apk",
George Zhou2770c3d2018-03-07 09:58:54 -080031 ":libwebrtc_unity",
Jason Long00b84622020-07-20 17:52:12 -040032 "androidvoip",
kjellander6ceab082016-10-28 05:44:03 -070033 ]
Sami Kalliomäki3e77afd2018-03-08 16:43:16 +010034
35 # TODO(sakal): We include some code from the tests. Remove this dependency
36 # and remove this if-clause.
37 if (rtc_include_tests) {
Artem Titov94b57c02019-03-21 13:35:10 +010038 deps += [ "androidnativeapi" ]
Sami Kalliomäki3e77afd2018-03-08 16:43:16 +010039 }
kjellander6ceab082016-10-28 05:44:03 -070040 }
41
charujainaca3a242016-11-01 03:09:15 -070042 if (!build_with_chromium) {
Mirko Bonadei1a339c32017-12-14 13:06:10 +010043 deps += [ ":stun_prober" ]
charujainaca3a242016-11-01 03:09:15 -070044 }
45
kjellander6ceab082016-10-28 05:44:03 -070046 if (is_ios || (is_mac && target_cpu != "x86")) {
Mirko Bonadei1a339c32017-12-14 13:06:10 +010047 deps += [ ":AppRTCMobile" ]
Sami Kalliomaki9c0c75b2016-06-29 14:55:00 +020048 }
kjellander6ceab082016-10-28 05:44:03 -070049
Hidehiko Abef264e702020-09-10 18:10:11 +090050 if (is_linux || is_chromeos || is_win) {
Mirko Bonadei1a339c32017-12-14 13:06:10 +010051 deps += [
kthelgason0727f152016-08-08 09:03:23 -070052 ":peerconnection_server",
kthelgason0727f152016-08-08 09:03:23 -070053 ":stunserver",
54 ":turnserver",
55 ]
Robin Raymondce1b1402018-11-22 20:10:11 -050056 if (current_os != "winuwp") {
57 deps += [ ":peerconnection_client" ]
58 }
kthelgason0727f152016-08-08 09:03:23 -070059 }
George Zhou2770c3d2018-03-07 09:58:54 -080060
61 if (is_android || is_win) {
62 deps += [ ":webrtc_unity_plugin" ]
63 }
Sami Kalliomaki9c0c75b2016-06-29 14:55:00 +020064}
65
Mirko Bonadei86d053c2019-10-17 21:32:04 +020066rtc_library("read_auth_file") {
Niels Möller9862c2e2018-10-30 12:20:03 +010067 testonly = true
68 sources = [
69 "turnserver/read_auth_file.cc",
70 "turnserver/read_auth_file.h",
71 ]
Ali Tofighfd6a4d62022-03-31 10:36:48 +020072 deps = [
73 "../api:array_view",
Florent Castelli57aa81b2022-04-04 17:14:02 +020074 "../rtc_base:stringutils",
Ali Tofighfd6a4d62022-03-31 10:36:48 +020075 ]
76 absl_deps = [ "//third_party/abseil-cpp/absl/strings:strings" ]
Niels Möller9862c2e2018-10-30 12:20:03 +010077}
78
79if (rtc_include_tests) {
80 rtc_test("examples_unittests") {
81 testonly = true
Mirko Bonadeiccbe95f2020-01-21 12:10:10 +010082 sources = [ "turnserver/read_auth_file_unittest.cc" ]
Niels Möller9862c2e2018-10-30 12:20:03 +010083 deps = [
84 ":read_auth_file",
85 "../test:test_main",
86 "//test:test_support",
87 "//testing/gtest",
88 ]
89 }
90}
91
tkchin2ddfdba2016-08-07 21:37:45 -070092if (is_android) {
Mirko Bonadeifbb3b7d2017-11-07 15:36:33 +000093 rtc_android_apk("AppRTCMobile") {
kjellander1993b1d2017-03-06 00:29:21 -080094 testonly = true
Magnus Jedvertc1815cf2016-09-27 10:10:41 +020095 apk_name = "AppRTCMobile"
Sami Kalliomaki9c0c75b2016-06-29 14:55:00 +020096 android_manifest = "androidapp/AndroidManifest.xml"
Jeremy Leconteb19cfee2020-06-25 22:57:49 +020097 min_sdk_version = 21
Yaowen Guo9406c222022-05-26 07:39:36 +080098 target_sdk_version = 31
Sami Kalliomaki9c0c75b2016-06-29 14:55:00 +020099
100 deps = [
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200101 ":AppRTCMobile_javalib",
102 ":AppRTCMobile_resources",
jianjun.zhuc0247402017-07-11 06:20:45 -0700103 "../rtc_base:base_java",
Sami Kalliomaki9c0c75b2016-06-29 14:55:00 +0200104 ]
105
jianjun.zhuc0247402017-07-11 06:20:45 -0700106 shared_libraries = [ "../sdk/android:libjingle_peerconnection_so" ]
Sami Kalliomaki9c0c75b2016-06-29 14:55:00 +0200107 }
108
Mirko Bonadeifbb3b7d2017-11-07 15:36:33 +0000109 rtc_android_library("AppRTCMobile_javalib") {
kjellander1993b1d2017-03-06 00:29:21 -0800110 testonly = true
Courtney Edwards35c87b62020-05-19 13:44:42 +0200111 android_manifest = "androidapp/AndroidManifest.xml"
sakal07a050f2017-02-13 05:58:27 -0800112
Natalie Chouinard65bbcab2019-12-23 14:02:25 -0800113 sources = [
Sami Kalliomaki9c0c75b2016-06-29 14:55:00 +0200114 "androidapp/src/org/appspot/apprtc/AppRTCAudioManager.java",
henrikac3c2f312016-12-14 07:36:56 -0800115 "androidapp/src/org/appspot/apprtc/AppRTCBluetoothManager.java",
Sami Kalliomaki9c0c75b2016-06-29 14:55:00 +0200116 "androidapp/src/org/appspot/apprtc/AppRTCClient.java",
117 "androidapp/src/org/appspot/apprtc/AppRTCProximitySensor.java",
118 "androidapp/src/org/appspot/apprtc/CallActivity.java",
119 "androidapp/src/org/appspot/apprtc/CallFragment.java",
120 "androidapp/src/org/appspot/apprtc/CaptureQualityController.java",
121 "androidapp/src/org/appspot/apprtc/ConnectActivity.java",
122 "androidapp/src/org/appspot/apprtc/CpuMonitor.java",
123 "androidapp/src/org/appspot/apprtc/DirectRTCClient.java",
124 "androidapp/src/org/appspot/apprtc/HudFragment.java",
125 "androidapp/src/org/appspot/apprtc/PeerConnectionClient.java",
Natalie Chouinard65bbcab2019-12-23 14:02:25 -0800126 "androidapp/src/org/appspot/apprtc/RecordedAudioToFileController.java",
Sami Kalliomaki9c0c75b2016-06-29 14:55:00 +0200127 "androidapp/src/org/appspot/apprtc/RoomParametersFetcher.java",
Qingsi Wanga4e72b72018-02-12 10:34:18 -0800128 "androidapp/src/org/appspot/apprtc/RtcEventLog.java",
Sami Kalliomaki9c0c75b2016-06-29 14:55:00 +0200129 "androidapp/src/org/appspot/apprtc/SettingsActivity.java",
130 "androidapp/src/org/appspot/apprtc/SettingsFragment.java",
131 "androidapp/src/org/appspot/apprtc/TCPChannelClient.java",
132 "androidapp/src/org/appspot/apprtc/UnhandledExceptionHandler.java",
133 "androidapp/src/org/appspot/apprtc/WebSocketChannelClient.java",
134 "androidapp/src/org/appspot/apprtc/WebSocketRTCClient.java",
135 "androidapp/src/org/appspot/apprtc/util/AppRTCUtils.java",
136 "androidapp/src/org/appspot/apprtc/util/AsyncHttpURLConnection.java",
Sami Kalliomaki9c0c75b2016-06-29 14:55:00 +0200137 ]
138
Mohamed Heikal3f94fc52020-09-01 15:51:12 -0400139 resources_package = "org.appspot.apprtc"
Sami Kalliomaki9c0c75b2016-06-29 14:55:00 +0200140 deps = [
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200141 ":AppRTCMobile_resources",
jianjun.zhuc0247402017-07-11 06:20:45 -0700142 "../rtc_base:base_java",
Sami Kalliomäki7d8f5942018-04-23 15:07:34 +0200143 "../sdk/android:audio_api_java",
Sami Kalliomäki725c1062018-03-28 10:49:18 +0200144 "../sdk/android:base_java",
Sami Kalliomäki1641ca32018-04-04 15:59:31 +0200145 "../sdk/android:camera_java",
Anders Carlsson1e06d882018-07-10 09:33:30 +0200146 "../sdk/android:default_video_codec_factory_java",
Sami Kalliomäki1641ca32018-04-04 15:59:31 +0200147 "../sdk/android:filevideo_java",
Sami Kalliomäki725c1062018-03-28 10:49:18 +0200148 "../sdk/android:hwcodecs_java",
Sami Kalliomäki7d8f5942018-04-23 15:07:34 +0200149 "../sdk/android:java_audio_device_module_java",
jianjun.zhuc0247402017-07-11 06:20:45 -0700150 "../sdk/android:libjingle_peerconnection_java",
151 "../sdk/android:libjingle_peerconnection_metrics_default_java",
Sami Kalliomäki1641ca32018-04-04 15:59:31 +0200152 "../sdk/android:peerconnection_java",
153 "../sdk/android:screencapturer_java",
154 "../sdk/android:surfaceviewrenderer_java",
Sami Kalliomäki725c1062018-03-28 10:49:18 +0200155 "../sdk/android:swcodecs_java",
Sami Kalliomäki1641ca32018-04-04 15:59:31 +0200156 "../sdk/android:video_api_java",
Sami Kalliomäki903bd412018-07-24 10:53:28 +0200157 "../sdk/android:video_java",
jianjun.zhuc0247402017-07-11 06:20:45 -0700158 "androidapp/third_party/autobanh:autobanh_java",
Byoungchan Lee02334e02021-08-14 11:41:59 +0900159 "//third_party/androidx:androidx_annotation_annotation_java",
Sami Kalliomaki9c0c75b2016-06-29 14:55:00 +0200160 ]
161 }
162
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200163 android_resources("AppRTCMobile_resources") {
kjellander1993b1d2017-03-06 00:29:21 -0800164 testonly = true
Andrew Grieved4262df2020-03-25 12:59:50 -0400165 sources = [
166 "androidapp/res/drawable-hdpi/disconnect.png",
167 "androidapp/res/drawable-hdpi/ic_action_full_screen.png",
168 "androidapp/res/drawable-hdpi/ic_action_return_from_full_screen.png",
169 "androidapp/res/drawable-hdpi/ic_launcher.png",
170 "androidapp/res/drawable-hdpi/ic_loopback_call.png",
171 "androidapp/res/drawable-ldpi/disconnect.png",
172 "androidapp/res/drawable-ldpi/ic_action_full_screen.png",
173 "androidapp/res/drawable-ldpi/ic_action_return_from_full_screen.png",
174 "androidapp/res/drawable-ldpi/ic_launcher.png",
175 "androidapp/res/drawable-ldpi/ic_loopback_call.png",
176 "androidapp/res/drawable-mdpi/disconnect.png",
177 "androidapp/res/drawable-mdpi/ic_action_full_screen.png",
178 "androidapp/res/drawable-mdpi/ic_action_return_from_full_screen.png",
179 "androidapp/res/drawable-mdpi/ic_launcher.png",
180 "androidapp/res/drawable-mdpi/ic_loopback_call.png",
181 "androidapp/res/drawable-xhdpi/disconnect.png",
182 "androidapp/res/drawable-xhdpi/ic_action_full_screen.png",
183 "androidapp/res/drawable-xhdpi/ic_action_return_from_full_screen.png",
184 "androidapp/res/drawable-xhdpi/ic_launcher.png",
185 "androidapp/res/drawable-xhdpi/ic_loopback_call.png",
186 "androidapp/res/layout/activity_call.xml",
187 "androidapp/res/layout/activity_connect.xml",
188 "androidapp/res/layout/fragment_call.xml",
189 "androidapp/res/layout/fragment_hud.xml",
190 "androidapp/res/menu/connect_menu.xml",
Andrew Grieved4262df2020-03-25 12:59:50 -0400191 "androidapp/res/values-v17/styles.xml",
192 "androidapp/res/values-v21/styles.xml",
Artem Titova4dfe242020-06-03 16:42:57 +0200193 "androidapp/res/values/arrays.xml",
194 "androidapp/res/values/strings.xml",
Andrew Grieved4262df2020-03-25 12:59:50 -0400195 "androidapp/res/xml/preferences.xml",
196 ]
Andrew Grieved4262df2020-03-25 12:59:50 -0400197
198 # Needed for Bazel converter.
Mohamed Heikal3f94fc52020-09-01 15:51:12 -0400199 custom_package = "org.appspot.apprtc"
Andrew Grieved4262df2020-03-25 12:59:50 -0400200 resource_dirs = [ "androidapp/res" ]
201 assert(resource_dirs != []) # Mark as used.
Sami Kalliomaki9c0c75b2016-06-29 14:55:00 +0200202 }
203
Sami Kalliomäkid54f5f52018-08-03 13:23:05 +0200204 rtc_instrumentation_test_apk("AppRTCMobile_test_apk") {
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200205 apk_name = "AppRTCMobileTest"
Sami Kalliomaki9c0c75b2016-06-29 14:55:00 +0200206 android_manifest = "androidtests/AndroidManifest.xml"
Jeremy Leconteb19cfee2020-06-25 22:57:49 +0200207 min_sdk_version = 21
Yaowen Guo9406c222022-05-26 07:39:36 +0800208 target_sdk_version = 31
Sami Kalliomaki9c0c75b2016-06-29 14:55:00 +0200209
Natalie Chouinard65bbcab2019-12-23 14:02:25 -0800210 sources = [
Patrik Höglunda8005cf2017-12-13 16:05:42 +0100211 "androidtests/src/org/appspot/apprtc/test/PeerConnectionClientTest.java",
212 ]
Sami Kalliomaki9c0c75b2016-06-29 14:55:00 +0200213
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200214 apk_under_test = ":AppRTCMobile"
Sami Kalliomaki9c0c75b2016-06-29 14:55:00 +0200215
216 deps = [
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200217 ":AppRTCMobile_javalib",
Mirko Bonadei5e987422020-07-10 10:36:04 +0200218 "../sdk/android:base_java",
Artem Titova4dfe242020-06-03 16:42:57 +0200219 "../sdk/android:camera_java",
jianjun.zhuc0247402017-07-11 06:20:45 -0700220 "../sdk/android:libjingle_peerconnection_java",
Artem Titova4dfe242020-06-03 16:42:57 +0200221 "../sdk/android:peerconnection_java",
222 "../sdk/android:video_api_java",
Sami Kalliomäki903bd412018-07-24 10:53:28 +0200223 "../sdk/android:video_java",
sakalcb79d512017-01-11 06:21:26 -0800224 "//third_party/android_support_test_runner:runner_java",
Mirko Bonadei56c24062021-07-30 10:21:30 +0200225 "//third_party/androidx:androidx_test_runner_java",
sakalcb79d512017-01-11 06:21:26 -0800226 "//third_party/junit",
Sami Kalliomaki9c0c75b2016-06-29 14:55:00 +0200227 ]
228 }
Sami Kalliomaki9c0c75b2016-06-29 14:55:00 +0200229}
tkchin2ddfdba2016-08-07 21:37:45 -0700230
231if (is_ios || (is_mac && target_cpu != "x86")) {
tkchin2ddfdba2016-08-07 21:37:45 -0700232 config("apprtc_common_config") {
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200233 include_dirs = [ "objc/AppRTCMobile/common" ]
tkchin2ddfdba2016-08-07 21:37:45 -0700234 }
235
Mirko Bonadei86d053c2019-10-17 21:32:04 +0200236 rtc_library("apprtc_common") {
kjellander1993b1d2017-03-06 00:29:21 -0800237 testonly = true
tkchin2ddfdba2016-08-07 21:37:45 -0700238 sources = [
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200239 "objc/AppRTCMobile/common/ARDUtilities.h",
240 "objc/AppRTCMobile/common/ARDUtilities.m",
tkchin2ddfdba2016-08-07 21:37:45 -0700241 ]
ehmaldonadoe9cc6862016-09-05 06:10:18 -0700242 public_configs = [ ":apprtc_common_config" ]
Mirko Bonadei19640aa2020-10-19 16:12:43 +0200243 deps = [ "../sdk:base_objc" ]
tkchin2ddfdba2016-08-07 21:37:45 -0700244 }
245
246 config("apprtc_signaling_config") {
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200247 include_dirs = [ "objc/AppRTCMobile" ]
tkchin2ddfdba2016-08-07 21:37:45 -0700248 }
249
Mirko Bonadei86d053c2019-10-17 21:32:04 +0200250 rtc_library("apprtc_signaling") {
kjellander1993b1d2017-03-06 00:29:21 -0800251 testonly = true
tkchin2ddfdba2016-08-07 21:37:45 -0700252 sources = [
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200253 "objc/AppRTCMobile/ARDAppClient+Internal.h",
254 "objc/AppRTCMobile/ARDAppClient.h",
255 "objc/AppRTCMobile/ARDAppClient.m",
256 "objc/AppRTCMobile/ARDAppEngineClient.h",
257 "objc/AppRTCMobile/ARDAppEngineClient.m",
sakalc522e752017-04-05 12:17:48 -0700258 "objc/AppRTCMobile/ARDCaptureController.h",
259 "objc/AppRTCMobile/ARDCaptureController.m",
Anders Carlsson358f2e02018-06-04 10:24:37 +0200260 "objc/AppRTCMobile/ARDExternalSampleCapturer.h",
261 "objc/AppRTCMobile/ARDExternalSampleCapturer.m",
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200262 "objc/AppRTCMobile/ARDJoinResponse+Internal.h",
263 "objc/AppRTCMobile/ARDJoinResponse.h",
264 "objc/AppRTCMobile/ARDJoinResponse.m",
265 "objc/AppRTCMobile/ARDMessageResponse+Internal.h",
266 "objc/AppRTCMobile/ARDMessageResponse.h",
267 "objc/AppRTCMobile/ARDMessageResponse.m",
268 "objc/AppRTCMobile/ARDRoomServerClient.h",
sakalc4adacf2017-03-28 01:22:48 -0700269 "objc/AppRTCMobile/ARDSettingsModel+Private.h",
270 "objc/AppRTCMobile/ARDSettingsModel.h",
271 "objc/AppRTCMobile/ARDSettingsModel.m",
272 "objc/AppRTCMobile/ARDSettingsStore.h",
273 "objc/AppRTCMobile/ARDSettingsStore.m",
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200274 "objc/AppRTCMobile/ARDSignalingChannel.h",
275 "objc/AppRTCMobile/ARDSignalingMessage.h",
276 "objc/AppRTCMobile/ARDSignalingMessage.m",
277 "objc/AppRTCMobile/ARDStatsBuilder.h",
278 "objc/AppRTCMobile/ARDStatsBuilder.m",
kthelgasoncc882af2017-01-13 05:59:46 -0800279 "objc/AppRTCMobile/ARDTURNClient+Internal.h",
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200280 "objc/AppRTCMobile/ARDTURNClient.h",
kthelgasoncc882af2017-01-13 05:59:46 -0800281 "objc/AppRTCMobile/ARDTURNClient.m",
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200282 "objc/AppRTCMobile/ARDWebSocketChannel.h",
283 "objc/AppRTCMobile/ARDWebSocketChannel.m",
284 "objc/AppRTCMobile/RTCIceCandidate+JSON.h",
285 "objc/AppRTCMobile/RTCIceCandidate+JSON.m",
286 "objc/AppRTCMobile/RTCIceServer+JSON.h",
287 "objc/AppRTCMobile/RTCIceServer+JSON.m",
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200288 "objc/AppRTCMobile/RTCSessionDescription+JSON.h",
289 "objc/AppRTCMobile/RTCSessionDescription+JSON.m",
tkchin2ddfdba2016-08-07 21:37:45 -0700290 ]
ehmaldonadoe9cc6862016-09-05 06:10:18 -0700291 public_configs = [ ":apprtc_signaling_config" ]
tkchin2ddfdba2016-08-07 21:37:45 -0700292 deps = [
293 ":apprtc_common",
294 ":socketrocket",
Mirko Bonadei19640aa2020-10-19 16:12:43 +0200295 "../sdk:base_objc",
296 "../sdk:default_codec_factory_objc",
297 "../sdk:file_logger_objc",
298 "../sdk:helpers_objc",
299 "../sdk:mediaconstraints_objc",
300 "../sdk:peerconnectionfactory_base_objc",
301 "../sdk:videocapture_objc",
302 "../sdk:videoframebuffer_objc",
303 "../sdk:videosource_objc",
tkchin2ddfdba2016-08-07 21:37:45 -0700304 ]
Sylvain Defresnec7f0dff2020-07-03 10:19:30 +0200305 frameworks = [
Kári Tristan Helgason8a1e35c2019-03-07 10:44:26 +0100306 "CoreMedia.framework",
307 "QuartzCore.framework",
308 ]
tkchin2ddfdba2016-08-07 21:37:45 -0700309 }
310
311 if (is_ios) {
Mirko Bonadei86d053c2019-10-17 21:32:04 +0200312 rtc_library("AppRTCMobile_lib") {
Mirko Bonadeicbaaaed2018-02-19 15:14:04 +0100313 # iOS must use WebRTC.framework which is dynamically linked.
kjellander1993b1d2017-03-06 00:29:21 -0800314 testonly = true
tkchin2ddfdba2016-08-07 21:37:45 -0700315 sources = [
Patrik Höglund49acb1e2018-01-02 14:41:54 +0100316 "objc/AppRTCMobile/ios/ARDAppDelegate.h",
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200317 "objc/AppRTCMobile/ios/ARDAppDelegate.m",
Daniela012b56b2017-11-15 13:15:24 +0100318 "objc/AppRTCMobile/ios/ARDFileCaptureController.h",
319 "objc/AppRTCMobile/ios/ARDFileCaptureController.m",
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200320 "objc/AppRTCMobile/ios/ARDMainView.h",
321 "objc/AppRTCMobile/ios/ARDMainView.m",
322 "objc/AppRTCMobile/ios/ARDMainViewController.h",
323 "objc/AppRTCMobile/ios/ARDMainViewController.m",
denicijad17d5362016-11-02 02:56:09 -0700324 "objc/AppRTCMobile/ios/ARDSettingsViewController.h",
325 "objc/AppRTCMobile/ios/ARDSettingsViewController.m",
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200326 "objc/AppRTCMobile/ios/ARDStatsView.h",
327 "objc/AppRTCMobile/ios/ARDStatsView.m",
328 "objc/AppRTCMobile/ios/ARDVideoCallView.h",
329 "objc/AppRTCMobile/ios/ARDVideoCallView.m",
330 "objc/AppRTCMobile/ios/ARDVideoCallViewController.h",
331 "objc/AppRTCMobile/ios/ARDVideoCallViewController.m",
Anders Carlsson6bf43d22017-10-16 13:51:43 +0200332 "objc/AppRTCMobile/ios/RTCVideoCodecInfo+HumanReadable.h",
333 "objc/AppRTCMobile/ios/RTCVideoCodecInfo+HumanReadable.m",
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200334 "objc/AppRTCMobile/ios/UIImage+ARDUtilities.h",
335 "objc/AppRTCMobile/ios/UIImage+ARDUtilities.m",
denicija77bfd7c2016-11-15 00:41:26 -0800336 ]
denicija77bfd7c2016-11-15 00:41:26 -0800337
Anders Carlsson96fccfe2019-02-21 16:11:40 +0100338 configs += [ "..:common_objc" ]
339
denicija77bfd7c2016-11-15 00:41:26 -0800340 deps = [
341 ":apprtc_common",
342 ":apprtc_signaling",
Mirko Bonadei19640aa2020-10-19 16:12:43 +0200343 "../sdk:audio_session_objc",
344 "../sdk:base_objc",
345 "../sdk:helpers_objc",
346 "../sdk:mediaconstraints_objc",
Jake Bromberg28e582d2021-06-22 11:34:29 -0700347 "../sdk:metal_objc",
Mirko Bonadei19640aa2020-10-19 16:12:43 +0200348 "../sdk:peerconnectionfactory_base_objc",
349 "../sdk:peerconnectionfactory_base_objc",
Mirko Bonadei19640aa2020-10-19 16:12:43 +0200350 "../sdk:videocapture_objc",
351 "../sdk:videocodec_objc",
denicija77bfd7c2016-11-15 00:41:26 -0800352 ]
Jordan Rose53d3fc92021-07-06 12:16:41 -0700353 if (rtc_ios_macos_use_opengl_rendering) {
354 deps += [ "../sdk:opengl_ui_objc" ]
355 }
Kári Tristan Helgason8a1e35c2019-03-07 10:44:26 +0100356
Sylvain Defresnec7f0dff2020-07-03 10:19:30 +0200357 frameworks = [ "AVFoundation.framework" ]
denicija77bfd7c2016-11-15 00:41:26 -0800358 }
359
360 ios_app_bundle("AppRTCMobile") {
kjellander1993b1d2017-03-06 00:29:21 -0800361 testonly = true
Mirko Bonadeiccbe95f2020-01-21 12:10:10 +0100362 sources = [ "objc/AppRTCMobile/ios/main.m" ]
tkchin2ddfdba2016-08-07 21:37:45 -0700363
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200364 info_plist = "objc/AppRTCMobile/ios/Info.plist"
tkchin2ddfdba2016-08-07 21:37:45 -0700365
denicija77bfd7c2016-11-15 00:41:26 -0800366 configs += [ "..:common_config" ]
tkchin2ddfdba2016-08-07 21:37:45 -0700367 public_configs = [ "..:common_inherited_config" ]
368
369 deps = [
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200370 ":AppRTCMobile_ios_bundle_data",
denicija77bfd7c2016-11-15 00:41:26 -0800371 ":AppRTCMobile_lib",
Mirko Bonadei1a339c32017-12-14 13:06:10 +0100372 "../sdk:framework_objc",
Anders Carlsson7bca8ca2018-08-30 09:30:29 +0200373 "../sdk:ios_framework_bundle",
tkchin2ddfdba2016-08-07 21:37:45 -0700374 ]
375
Anders Carlsson358f2e02018-06-04 10:24:37 +0200376 if (rtc_apprtcmobile_broadcast_extension) {
377 deps += [
378 ":AppRTCMobileBroadcastSetupUI_extension_bundle",
379 ":AppRTCMobileBroadcastUpload_extension_bundle",
380 ]
381 }
382
tkchin2ddfdba2016-08-07 21:37:45 -0700383 if (target_cpu == "x86") {
Artem Titov94b57c02019-03-21 13:35:10 +0100384 deps += [ "//testing/iossim" ]
tkchin2ddfdba2016-08-07 21:37:45 -0700385 }
386 }
387
Anders Carlsson358f2e02018-06-04 10:24:37 +0200388 if (rtc_apprtcmobile_broadcast_extension) {
389 bundle_data("AppRTCMobileBroadcastUpload_extension_bundle") {
390 testonly = true
Artem Titova4dfe242020-06-03 16:42:57 +0200391 public_deps = [ # no-presubmit-check TODO(webrtc:8603)
392 ":AppRTCMobileBroadcastUpload", # prevent code format
393 ]
Mirko Bonadeiccbe95f2020-01-21 12:10:10 +0100394 sources = [ "$root_out_dir/AppRTCMobileBroadcastUpload.appex" ]
395 outputs = [ "{{bundle_contents_dir}}/Plugins/{{source_file_part}}" ]
Anders Carlsson358f2e02018-06-04 10:24:37 +0200396 }
397
398 bundle_data("AppRTCMobileBroadcastSetupUI_extension_bundle") {
399 testonly = true
Artem Titova4dfe242020-06-03 16:42:57 +0200400 public_deps = [ # no-presubmit-check TODO(webrtc:8603)
401 ":AppRTCMobileBroadcastSetupUI", # prevent code format
402 ]
Mirko Bonadeiccbe95f2020-01-21 12:10:10 +0100403 sources = [ "$root_out_dir/AppRTCMobileBroadcastSetupUI.appex" ]
404 outputs = [ "{{bundle_contents_dir}}/Plugins/{{source_file_part}}" ]
Anders Carlsson358f2e02018-06-04 10:24:37 +0200405 }
406
Mirko Bonadei86d053c2019-10-17 21:32:04 +0200407 rtc_library("AppRTCMobileBroadcastUpload_lib") {
Anders Carlsson358f2e02018-06-04 10:24:37 +0200408 testonly = true
409 sources = [
410 "objc/AppRTCMobile/ios/broadcast_extension/ARDBroadcastSampleHandler.h",
411 "objc/AppRTCMobile/ios/broadcast_extension/ARDBroadcastSampleHandler.m",
412 ]
413
414 deps = [
Anders Carlsson358f2e02018-06-04 10:24:37 +0200415 ":apprtc_signaling",
Anders Carlsson7bca8ca2018-08-30 09:30:29 +0200416 "../sdk:framework_objc+link",
417 "../sdk:ios_framework_bundle",
Anders Carlsson358f2e02018-06-04 10:24:37 +0200418 ]
419
Sylvain Defresnec7f0dff2020-07-03 10:19:30 +0200420 frameworks = [ "ReplayKit.framework" ]
Anders Carlsson358f2e02018-06-04 10:24:37 +0200421 }
422
423 ios_appex_bundle("AppRTCMobileBroadcastUpload") {
424 testonly = true
425 configs += [ "..:common_config" ]
426 public_configs = [ "..:common_inherited_config" ]
427
428 info_plist = "objc/AppRTCMobile/ios/broadcast_extension/BroadcastUploadInfo.plist"
429
430 deps = [
431 ":AppRTCMobileBroadcastUpload_lib",
432 "../sdk:framework_objc",
433 ]
434 }
435
436 ios_appex_bundle("AppRTCMobileBroadcastSetupUI") {
437 sources = [
438 "objc/AppRTCMobile/ios/broadcast_extension/ARDBroadcastSetupViewController.h",
439 "objc/AppRTCMobile/ios/broadcast_extension/ARDBroadcastSetupViewController.m",
440 ]
441
442 info_plist = "objc/AppRTCMobile/ios/broadcast_extension/BroadcastSetupUIInfo.plist"
443
Sylvain Defresnec7f0dff2020-07-03 10:19:30 +0200444 frameworks = [ "ReplayKit.framework" ]
Anders Carlsson358f2e02018-06-04 10:24:37 +0200445
Mirko Bonadeiccbe95f2020-01-21 12:10:10 +0100446 deps = [ ":AppRTCMobile_ios_bundle_data" ]
Anders Carlsson358f2e02018-06-04 10:24:37 +0200447 }
448 }
449
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200450 bundle_data("AppRTCMobile_ios_bundle_data") {
tkchin2ddfdba2016-08-07 21:37:45 -0700451 sources = [
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200452 "objc/AppRTCMobile/ios/resources/Roboto-Regular.ttf",
Daniela012b56b2017-11-15 13:15:24 +0100453
454 # Sample video taken from https://media.xiph.org/video/derf/
455 "objc/AppRTCMobile/ios/resources/foreman.mp4",
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200456 "objc/AppRTCMobile/ios/resources/iPhone5@2x.png",
457 "objc/AppRTCMobile/ios/resources/iPhone6@2x.png",
458 "objc/AppRTCMobile/ios/resources/iPhone6p@3x.png",
459 "objc/AppRTCMobile/ios/resources/ic_call_end_black_24dp.png",
460 "objc/AppRTCMobile/ios/resources/ic_call_end_black_24dp@2x.png",
461 "objc/AppRTCMobile/ios/resources/ic_clear_black_24dp.png",
462 "objc/AppRTCMobile/ios/resources/ic_clear_black_24dp@2x.png",
denicija6d6762c2016-10-28 04:53:16 -0700463 "objc/AppRTCMobile/ios/resources/ic_settings_black_24dp.png",
464 "objc/AppRTCMobile/ios/resources/ic_settings_black_24dp@2x.png",
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200465 "objc/AppRTCMobile/ios/resources/ic_surround_sound_black_24dp.png",
466 "objc/AppRTCMobile/ios/resources/ic_surround_sound_black_24dp@2x.png",
467 "objc/AppRTCMobile/ios/resources/ic_switch_video_black_24dp.png",
468 "objc/AppRTCMobile/ios/resources/ic_switch_video_black_24dp@2x.png",
469 "objc/AppRTCMobile/ios/resources/mozart.mp3",
anderscb5ed9052017-08-15 04:07:12 -0700470 "objc/Icon-120.png",
471 "objc/Icon-180.png",
tkchin2ddfdba2016-08-07 21:37:45 -0700472 "objc/Icon.png",
473 ]
Mirko Bonadeiccbe95f2020-01-21 12:10:10 +0100474 outputs = [ "{{bundle_resources_dir}}/{{source_file_part}}" ]
tkchin2ddfdba2016-08-07 21:37:45 -0700475 }
Anders Carlsson73119182018-03-15 09:41:03 +0100476
Mirko Bonadei86d053c2019-10-17 21:32:04 +0200477 rtc_library("ObjCNativeAPIDemo_lib") {
Anders Carlsson73119182018-03-15 09:41:03 +0100478 testonly = true
479 sources = [
480 "objcnativeapi/objc/NADAppDelegate.h",
481 "objcnativeapi/objc/NADAppDelegate.m",
482 "objcnativeapi/objc/NADViewController.h",
483 "objcnativeapi/objc/NADViewController.mm",
Steve Anton10542f22019-01-11 09:11:00 -0800484 "objcnativeapi/objc/objc_call_client.h",
485 "objcnativeapi/objc/objc_call_client.mm",
Anders Carlsson73119182018-03-15 09:41:03 +0100486 ]
487
Anders Carlsson73119182018-03-15 09:41:03 +0100488 deps = [
489 "../api:libjingle_peerconnection_api",
Mirko Bonadeid9708072019-01-25 20:26:48 +0100490 "../api:scoped_refptr",
Florent Castelli8d4e9fb2022-04-04 17:18:21 +0200491 "../api:sequence_checker",
Anders Carlsson73119182018-03-15 09:41:03 +0100492 "../api/audio_codecs:builtin_audio_decoder_factory",
493 "../api/audio_codecs:builtin_audio_encoder_factory",
Danil Chapovalov4ba04b72019-06-26 15:49:47 +0200494 "../api/rtc_event_log:rtc_event_log_factory",
Danil Chapovalovaaa11432019-05-17 13:20:14 +0200495 "../api/task_queue:default_task_queue_factory",
Anders Carlsson73119182018-03-15 09:41:03 +0100496 "../media:rtc_audio_video",
Artem Titov94b57c02019-03-21 13:35:10 +0100497 "../modules/audio_processing",
Alessio Bazzicab768e882018-11-07 14:29:54 +0000498 "../modules/audio_processing:api",
Anders Carlsson73119182018-03-15 09:41:03 +0100499 "../pc:libjingle_peerconnection",
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",
Florent Castellia138c6c2023-01-04 12:01:09 +0100637 "../rtc_base:ssl",
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) {
Tom Anderson06e4fc52022-04-06 15:22:33 -0700663 if (is_linux || is_chromeos) {
664 pkg_config("gtk_config") {
665 packages = [
666 # Gtk requires gmodule, but it does not list it as a dependency in some
667 # misconfigured systems.
668 "gmodule-2.0",
669 "gthread-2.0",
670 "gtk+-3.0",
671 ]
672 }
673 }
674
ehmaldonado38a21322016-09-02 04:10:34 -0700675 rtc_executable("peerconnection_client") {
kjellander1993b1d2017-03-06 00:29:21 -0800676 testonly = true
kthelgason0727f152016-08-08 09:03:23 -0700677 sources = [
678 "peerconnection/client/conductor.cc",
679 "peerconnection/client/conductor.h",
680 "peerconnection/client/defaults.cc",
681 "peerconnection/client/defaults.h",
682 "peerconnection/client/peer_connection_client.cc",
683 "peerconnection/client/peer_connection_client.h",
684 ]
ehmaldonado7a2ce0b2016-09-05 01:35:44 -0700685
Patrik Höglundb5b5bce2017-11-13 10:19:58 +0100686 deps = [
Yves Gerey3e707812018-11-28 16:47:49 +0100687 "../api:audio_options_api",
Mirko Bonadei2ff3f492018-11-22 09:00:13 +0100688 "../api:create_peerconnection_factory",
Mirko Bonadei34814c72018-01-11 10:13:56 +0100689 "../api:libjingle_peerconnection_api",
Niels Möllere942b142019-09-17 14:30:41 +0200690 "../api:media_stream_interface",
Florent Castelliacabb362022-10-18 17:05:16 +0200691 "../api:rtp_sender_interface",
Mirko Bonadeid9708072019-01-25 20:26:48 +0100692 "../api:scoped_refptr",
Yves Gerey3e707812018-11-28 16:47:49 +0100693 "../api/audio:audio_mixer_api",
694 "../api/audio_codecs:audio_codecs_api",
Danil Chapovalovb9201b02022-08-17 17:12:29 +0200695 "../api/task_queue:pending_task_safety_flag",
696 "../api/units:time_delta",
Ilya Nikolaevskiy38e9b062020-10-08 14:36:33 +0000697 "../api/video:video_frame",
Chen Xing5d24b162019-06-10 12:59:38 +0200698 "../api/video:video_rtp_headers",
Yves Gerey3e707812018-11-28 16:47:49 +0100699 "../api/video_codecs:video_codecs_api",
Harald Alvestrand794d5992022-12-16 09:54:57 +0000700 "../media:media_channel",
Yves Gerey3e707812018-11-28 16:47:49 +0100701 "../media:rtc_media_base",
702 "../p2p:rtc_p2p",
Harald Alvestrand445e6b02020-09-29 14:21:47 +0000703 "../pc:video_track_source",
Patrik Höglunda8005cf2017-12-13 16:05:42 +0100704 "../rtc_base:checks",
Florent Castelli0af55ba2022-04-04 15:06:30 +0200705 "../rtc_base:logging",
Florent Castelli4467ad72022-04-04 15:18:46 +0200706 "../rtc_base:macromagic",
Mirko Bonadeie5f4c6b2021-01-15 10:41:01 +0100707 "../rtc_base:net_helpers",
Florent Castellif86f6f92022-04-05 02:54:12 +0200708 "../rtc_base:refcount",
Florent Castellia138c6c2023-01-04 12:01:09 +0100709 "../rtc_base:rtc_certificate_generator",
710 "../rtc_base:ssl",
Florent Castelli57aa81b2022-04-04 17:14:02 +0200711 "../rtc_base:stringutils",
Mirko Bonadeie5f4c6b2021-01-15 10:41:01 +0100712 "../rtc_base:threading",
Artem Titove41c4332018-07-25 15:04:28 +0200713 "../rtc_base/third_party/sigslot",
Bjorn Terelius3e676762018-10-29 15:26:27 +0100714 "../system_wrappers:field_trial",
715 "../test:field_trial",
Kári Tristan Helgasonede7cb22019-03-06 10:34:09 +0100716 "../test:platform_video_capturer",
Tommi25eb47c2019-08-29 16:39:05 +0200717 "../test:rtp_test_utils",
Niels Möllerb76be9a2018-12-20 16:28:23 +0100718 "//third_party/abseil-cpp/absl/memory",
Yves Gerey3e707812018-11-28 16:47:49 +0100719 "//third_party/abseil-cpp/absl/types:optional",
Patrik Höglundb5b5bce2017-11-13 10:19:58 +0100720 ]
kthelgason0727f152016-08-08 09:03:23 -0700721 if (is_win) {
722 sources += [
Steve Anton10542f22019-01-11 09:11:00 -0800723 "peerconnection/client/flag_defs.h",
kthelgason0727f152016-08-08 09:03:23 -0700724 "peerconnection/client/main.cc",
725 "peerconnection/client/main_wnd.cc",
726 "peerconnection/client/main_wnd.h",
727 ]
kthelgason0727f152016-08-08 09:03:23 -0700728 configs += [ "//build/config/win:windowed" ]
Tommi16db7ff2020-09-26 11:57:26 +0200729 deps += [
730 "../media:rtc_media_base",
731 "../rtc_base:win32",
Florent Castellia138c6c2023-01-04 12:01:09 +0100732 "../rtc_base:win32_socket_init",
Tommi16db7ff2020-09-26 11:57:26 +0200733 ]
kthelgason0727f152016-08-08 09:03:23 -0700734 }
Hidehiko Abef264e702020-09-10 18:10:11 +0900735 if (is_linux || is_chromeos) {
kthelgason0727f152016-08-08 09:03:23 -0700736 sources += [
737 "peerconnection/client/linux/main.cc",
738 "peerconnection/client/linux/main_wnd.cc",
739 "peerconnection/client/linux/main_wnd.h",
740 ]
Henrik Kjellanderefbde2c2017-03-27 08:28:27 +0200741 cflags = [ "-Wno-deprecated-declarations" ]
kthelgason0727f152016-08-08 09:03:23 -0700742 libs = [
743 "X11",
744 "Xcomposite",
745 "Xext",
746 "Xrender",
747 ]
Tom Anderson06e4fc52022-04-06 15:22:33 -0700748 configs += [ ":gtk_config" ]
kthelgason0727f152016-08-08 09:03:23 -0700749 }
kjellander1993b1d2017-03-06 00:29:21 -0800750
751 deps += [
Niels Möller8366e172018-02-14 12:20:13 +0100752 "../api:libjingle_peerconnection_api",
Karl Wiberg1b0eae32017-10-17 14:48:54 +0200753 "../api/audio_codecs:builtin_audio_decoder_factory",
754 "../api/audio_codecs:builtin_audio_encoder_factory",
Niels Möllerc6ce9c52018-05-11 11:15:30 +0200755 "../api/video:video_frame",
Chen Xing5d24b162019-06-10 12:59:38 +0200756 "../api/video:video_rtp_headers",
Anders Carlsson67537952018-05-03 11:28:29 +0200757 "../api/video_codecs:builtin_video_decoder_factory",
758 "../api/video_codecs:builtin_video_encoder_factory",
Mirko Bonadei75baa492018-01-11 17:07:30 +0100759 "../media:rtc_audio_video",
Artem Titov94b57c02019-03-21 13:35:10 +0100760 "../modules/audio_device",
761 "../modules/audio_processing",
Alessio Bazzicab768e882018-11-07 14:29:54 +0000762 "../modules/audio_processing:api",
jianjun.zhuc0247402017-07-11 06:20:45 -0700763 "../modules/video_capture:video_capture_module",
764 "../pc:libjingle_peerconnection",
ehmaldonadof6a861a2017-07-19 10:40:47 -0700765 "../rtc_base:rtc_json",
Niels Möllerb76be9a2018-12-20 16:28:23 +0100766 "../test:video_test_common",
Mirko Bonadei0be40bf2019-07-16 18:40:05 +0200767 "//third_party/abseil-cpp/absl/flags:flag",
768 "//third_party/abseil-cpp/absl/flags:parse",
kjellander1993b1d2017-03-06 00:29:21 -0800769 "//third_party/libyuv",
kjellander1993b1d2017-03-06 00:29:21 -0800770 ]
kthelgason0727f152016-08-08 09:03:23 -0700771 }
kjellanderd4626e52016-09-07 02:33:01 -0700772
ehmaldonado38a21322016-09-02 04:10:34 -0700773 rtc_executable("peerconnection_server") {
kjellander1993b1d2017-03-06 00:29:21 -0800774 testonly = true
kthelgason0727f152016-08-08 09:03:23 -0700775 sources = [
776 "peerconnection/server/data_socket.cc",
777 "peerconnection/server/data_socket.h",
778 "peerconnection/server/main.cc",
779 "peerconnection/server/peer_channel.cc",
780 "peerconnection/server/peer_channel.h",
781 "peerconnection/server/utils.cc",
782 "peerconnection/server/utils.h",
783 ]
784 deps = [
Mirko Bonadei25ab3222021-07-08 20:08:20 +0200785 "../rtc_base:checks",
Florent Castelli57aa81b2022-04-04 17:14:02 +0200786 "../rtc_base:stringutils",
Bjorn Terelius3e676762018-10-29 15:26:27 +0100787 "../system_wrappers:field_trial",
788 "../test:field_trial",
Mirko Bonadei04cffe32019-06-25 15:43:23 +0200789 "//third_party/abseil-cpp/absl/flags:flag",
790 "//third_party/abseil-cpp/absl/flags:parse",
Mirko Bonadei76c89da2019-07-19 12:12:14 +0200791 "//third_party/abseil-cpp/absl/flags:usage",
kthelgason0727f152016-08-08 09:03:23 -0700792 ]
kthelgason0727f152016-08-08 09:03:23 -0700793 }
ehmaldonado38a21322016-09-02 04:10:34 -0700794 rtc_executable("turnserver") {
kjellander1993b1d2017-03-06 00:29:21 -0800795 testonly = true
Mirko Bonadeiccbe95f2020-01-21 12:10:10 +0100796 sources = [ "turnserver/turnserver_main.cc" ]
kthelgason0727f152016-08-08 09:03:23 -0700797 deps = [
Niels Möller9862c2e2018-10-30 12:20:03 +0100798 ":read_auth_file",
Niels Möllera1342042018-11-08 16:47:14 +0100799 "../p2p:p2p_server_utils",
jianjun.zhuc0247402017-07-11 06:20:45 -0700800 "../p2p:rtc_p2p",
801 "../pc:rtc_pc",
Florent Castellia138c6c2023-01-04 12:01:09 +0100802 "../rtc_base:async_udp_socket",
Mirko Bonadeie5f4c6b2021-01-15 10:41:01 +0100803 "../rtc_base:ip_address",
Mirko Bonadeie5f4c6b2021-01-15 10:41:01 +0100804 "../rtc_base:socket_address",
805 "../rtc_base:socket_server",
806 "../rtc_base:threading",
Ali Tofighde2ac5a2022-06-30 11:58:26 +0200807 "//third_party/abseil-cpp/absl/strings:strings",
kthelgason0727f152016-08-08 09:03:23 -0700808 ]
kthelgason0727f152016-08-08 09:03:23 -0700809 }
ehmaldonado38a21322016-09-02 04:10:34 -0700810 rtc_executable("stunserver") {
kjellander1993b1d2017-03-06 00:29:21 -0800811 testonly = true
Mirko Bonadeiccbe95f2020-01-21 12:10:10 +0100812 sources = [ "stunserver/stunserver_main.cc" ]
kthelgason0727f152016-08-08 09:03:23 -0700813 deps = [
Niels Möllera1342042018-11-08 16:47:14 +0100814 "../p2p:p2p_server_utils",
jianjun.zhuc0247402017-07-11 06:20:45 -0700815 "../p2p:rtc_p2p",
816 "../pc:rtc_pc",
Florent Castellia138c6c2023-01-04 12:01:09 +0100817 "../rtc_base:async_udp_socket",
Mirko Bonadeie5f4c6b2021-01-15 10:41:01 +0100818 "../rtc_base:socket_address",
819 "../rtc_base:socket_server",
820 "../rtc_base:threading",
kthelgason0727f152016-08-08 09:03:23 -0700821 ]
kthelgason0727f152016-08-08 09:03:23 -0700822 }
823}
charujainaca3a242016-11-01 03:09:15 -0700824
qiangchen42f96d52017-08-08 17:08:03 -0700825if (is_win || is_android) {
gyzhouad7cad82017-05-11 16:10:03 -0700826 rtc_shared_library("webrtc_unity_plugin") {
827 testonly = true
828 sources = [
829 "unityplugin/simple_peer_connection.cc",
830 "unityplugin/simple_peer_connection.h",
831 "unityplugin/unity_plugin_apis.cc",
832 "unityplugin/unity_plugin_apis.h",
gyzhoub38f3862017-07-25 16:04:31 -0700833 "unityplugin/video_observer.cc",
834 "unityplugin/video_observer.h",
gyzhouad7cad82017-05-11 16:10:03 -0700835 ]
qiangchen42f96d52017-08-08 17:08:03 -0700836
837 if (is_android) {
838 sources += [
Steve Anton10542f22019-01-11 09:11:00 -0800839 "unityplugin/class_reference_holder.cc",
840 "unityplugin/class_reference_holder.h",
qiangchen42f96d52017-08-08 17:08:03 -0700841 "unityplugin/jni_onload.cc",
842 ]
Qiang Chen43fb9122017-12-20 10:47:36 -0800843 suppressed_configs += [ "//build/config/android:hide_all_but_jni_onload" ]
qiangchen42f96d52017-08-08 17:08:03 -0700844 }
845
qiangchen42f96d52017-08-08 17:08:03 -0700846 if (is_win) {
Mirko Bonadeif957dd92018-07-11 10:47:42 +0200847 configs += [ "//build/config/win:windowed" ]
qiangchen42f96d52017-08-08 17:08:03 -0700848 }
gyzhouad7cad82017-05-11 16:10:03 -0700849 deps = [
Mirko Bonadei2ff3f492018-11-22 09:00:13 +0100850 "../api:create_peerconnection_factory",
Mirko Bonadei34814c72018-01-11 10:13:56 +0100851 "../api:libjingle_peerconnection_api",
Niels Möllere942b142019-09-17 14:30:41 +0200852 "../api:media_stream_interface",
Qiang Chen51e20462017-12-05 11:11:21 -0800853 "../api/audio_codecs:builtin_audio_decoder_factory",
854 "../api/audio_codecs:builtin_audio_encoder_factory",
Niels Möllerc6ce9c52018-05-11 11:15:30 +0200855 "../api/video:video_frame",
Chen Xing5d24b162019-06-10 12:59:38 +0200856 "../api/video:video_rtp_headers",
Mirko Bonadei75baa492018-01-11 17:07:30 +0100857 "../media:rtc_audio_video",
Anders Carlssona114c882018-01-04 15:10:22 +0100858 "../media:rtc_internal_video_codecs",
jianjun.zhuc0247402017-07-11 06:20:45 -0700859 "../media:rtc_media",
860 "../media:rtc_media_base",
Artem Titov94b57c02019-03-21 13:35:10 +0100861 "../modules/audio_device",
862 "../modules/audio_processing",
Alessio Bazzicab768e882018-11-07 14:29:54 +0000863 "../modules/audio_processing:api",
jianjun.zhuc0247402017-07-11 06:20:45 -0700864 "../modules/video_capture:video_capture_module",
865 "../pc:libjingle_peerconnection",
Harald Alvestrand445e6b02020-09-29 14:21:47 +0000866 "../pc:video_track_source",
Florent Castellia138c6c2023-01-04 12:01:09 +0100867 "../rtc_base:ssl",
Kári Tristan Helgasonede7cb22019-03-06 10:34:09 +0100868 "../test:platform_video_capturer",
Niels Möller0a595352019-01-02 15:12:38 +0100869 "../test:video_test_common",
Karl Wiberg918f50c2018-07-05 11:40:33 +0200870 "//third_party/abseil-cpp/absl/memory",
gyzhouad7cad82017-05-11 16:10:03 -0700871 ]
qiangchen42f96d52017-08-08 17:08:03 -0700872 if (is_android) {
George Zhou2770c3d2018-03-07 09:58:54 -0800873 deps += [
Artem Titov94b57c02019-03-21 13:35:10 +0100874 "../modules/utility",
George Zhou2770c3d2018-03-07 09:58:54 -0800875 "../sdk/android:libjingle_peerconnection_jni",
Yaowen Guo82cbae42022-05-17 16:10:15 +0800876 "../sdk/android:native_api_jni",
George Zhou2770c3d2018-03-07 09:58:54 -0800877 ]
qiangchen42f96d52017-08-08 17:08:03 -0700878 }
879 }
880}
881
882if (is_android) {
Mirko Bonadeifbb3b7d2017-11-07 15:36:33 +0000883 rtc_android_library("webrtc_unity_java") {
Mirko Bonadeiccbe95f2020-01-21 12:10:10 +0100884 sources = [ "unityplugin/java/src/org/webrtc/UnityUtility.java" ]
qiangchen42f96d52017-08-08 17:08:03 -0700885 deps = [
886 "../rtc_base:base_java",
Artem Titarenko69540f42018-12-10 12:30:46 +0100887 "../sdk/android:camera_java",
qiangchen42f96d52017-08-08 17:08:03 -0700888 "../sdk/android:libjingle_peerconnection_java",
Artem Titarenko69540f42018-12-10 12:30:46 +0100889 "../sdk/android:peerconnection_java",
Mirko Bonadei5e987422020-07-10 10:36:04 +0200890 "../sdk/android:video_api_java",
Artem Titarenko69540f42018-12-10 12:30:46 +0100891 "../sdk/android:video_java",
Byoungchan Lee02334e02021-08-14 11:41:59 +0900892 "//third_party/androidx:androidx_annotation_annotation_java",
qiangchen42f96d52017-08-08 17:08:03 -0700893 ]
894 }
895
896 dist_jar("libwebrtc_unity") {
897 _target_dir_name = get_label_info(":$target_name", "dir")
898 output = "${root_out_dir}/lib.java${_target_dir_name}/${target_name}.jar"
George Zhou2770c3d2018-03-07 09:58:54 -0800899 direct_deps_only = false
qiangchen42f96d52017-08-08 17:08:03 -0700900 use_interface_jars = false
George Zhou2770c3d2018-03-07 09:58:54 -0800901 use_unprocessed_jars = false
Oleh Prypin86021d92017-09-24 22:29:06 +0200902 requires_android = true
qiangchen42f96d52017-08-08 17:08:03 -0700903 deps = [
904 ":webrtc_unity_java",
qiangchen42f96d52017-08-08 17:08:03 -0700905 "../rtc_base:base_java",
906 "../sdk/android:libjingle_peerconnection_java",
907 "../sdk/android:libjingle_peerconnection_metrics_default_java",
Byoungchan Lee02334e02021-08-14 11:41:59 +0900908 "//third_party/androidx:androidx_annotation_annotation_java",
qiangchen42f96d52017-08-08 17:08:03 -0700909 ]
gyzhouad7cad82017-05-11 16:10:03 -0700910 }
Mirko Bonadei73aa2de2020-01-20 15:28:57 +0100911
Mirko Bonadei9ea1ef62022-06-30 09:39:44 +0200912 robolectric_binary("android_examples_junit_tests") {
Mirko Bonadei73aa2de2020-01-20 15:28:57 +0100913 sources = [
914 "androidjunit/src/org/appspot/apprtc/BluetoothManagerTest.java",
915 "androidjunit/src/org/appspot/apprtc/DirectRTCClientTest.java",
916 "androidjunit/src/org/appspot/apprtc/TCPChannelClientTest.java",
917 ]
918
919 deps = [
920 ":AppRTCMobile_javalib",
Artem Titova4dfe242020-06-03 16:42:57 +0200921 "../sdk/android:peerconnection_java",
Artem Titovebc563e2021-02-17 11:56:28 +0100922 "//third_party/androidx:androidx_test_core_java",
Mirko Bonadei73aa2de2020-01-20 15:28:57 +0100923 "//third_party/google-truth:google_truth_java",
924 ]
925
926 additional_jar_files = [ [
927 "../sdk/android/tests/resources/robolectric.properties",
928 "robolectric.properties",
929 ] ]
930 }
gyzhouad7cad82017-05-11 16:10:03 -0700931}
932
charujainaca3a242016-11-01 03:09:15 -0700933if (!build_with_chromium) {
934 # Doesn't build within Chrome on Win.
935 rtc_executable("stun_prober") {
kjellander1993b1d2017-03-06 00:29:21 -0800936 testonly = true
Mirko Bonadeiccbe95f2020-01-21 12:10:10 +0100937 sources = [ "stunprober/main.cc" ]
charujainaca3a242016-11-01 03:09:15 -0700938 deps = [
939 "../p2p:libstunprober",
940 "../p2p:rtc_p2p",
Patrik Höglunda8005cf2017-12-13 16:05:42 +0100941 "../rtc_base:checks",
Florent Castelli0af55ba2022-04-04 15:06:30 +0200942 "../rtc_base:logging",
Florent Castellia138c6c2023-01-04 12:01:09 +0100943 "../rtc_base:network",
Mirko Bonadeie5f4c6b2021-01-15 10:41:01 +0100944 "../rtc_base:socket_address",
Florent Castellia138c6c2023-01-04 12:01:09 +0100945 "../rtc_base:ssl",
Mirko Bonadeie5f4c6b2021-01-15 10:41:01 +0100946 "../rtc_base:threading",
Florent Castellidd837e22022-04-04 17:16:15 +0200947 "../rtc_base:timeutils",
Jonas Orelandc06fe8b2022-03-28 14:58:26 +0200948 "../test:scoped_key_value_config",
Mirko Bonadei0be40bf2019-07-16 18:40:05 +0200949 "//third_party/abseil-cpp/absl/flags:flag",
950 "//third_party/abseil-cpp/absl/flags:parse",
charujainaca3a242016-11-01 03:09:15 -0700951 ]
952 }
953}