blob: 2acb0dd70fb116749f16d6603311516f96d9759f [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",
kjellander6ceab082016-10-28 05:44:03 -070030 ]
Sami Kalliomäki3e77afd2018-03-08 16:43:16 +010031
32 # TODO(sakal): We include some code from the tests. Remove this dependency
33 # and remove this if-clause.
34 if (rtc_include_tests) {
Artem Titov94b57c02019-03-21 13:35:10 +010035 deps += [ "androidnativeapi" ]
Sami Kalliomäki3e77afd2018-03-08 16:43:16 +010036 }
kjellander6ceab082016-10-28 05:44:03 -070037 }
38
charujainaca3a242016-11-01 03:09:15 -070039 if (!build_with_chromium) {
Mirko Bonadei1a339c32017-12-14 13:06:10 +010040 deps += [ ":stun_prober" ]
charujainaca3a242016-11-01 03:09:15 -070041 }
42
kjellander6ceab082016-10-28 05:44:03 -070043 if (is_ios || (is_mac && target_cpu != "x86")) {
Mirko Bonadei1a339c32017-12-14 13:06:10 +010044 deps += [ ":AppRTCMobile" ]
Sami Kalliomaki9c0c75b2016-06-29 14:55:00 +020045 }
kjellander6ceab082016-10-28 05:44:03 -070046
47 if (is_linux || is_win) {
Mirko Bonadei1a339c32017-12-14 13:06:10 +010048 deps += [
kthelgason0727f152016-08-08 09:03:23 -070049 ":peerconnection_server",
kthelgason0727f152016-08-08 09:03:23 -070050 ":stunserver",
51 ":turnserver",
52 ]
Robin Raymondce1b1402018-11-22 20:10:11 -050053 if (current_os != "winuwp") {
54 deps += [ ":peerconnection_client" ]
55 }
kthelgason0727f152016-08-08 09:03:23 -070056 }
George Zhou2770c3d2018-03-07 09:58:54 -080057
58 if (is_android || is_win) {
59 deps += [ ":webrtc_unity_plugin" ]
60 }
Sami Kalliomaki9c0c75b2016-06-29 14:55:00 +020061}
62
Mirko Bonadei86d053c2019-10-17 21:32:04 +020063rtc_library("read_auth_file") {
Niels Möller9862c2e2018-10-30 12:20:03 +010064 testonly = true
65 sources = [
66 "turnserver/read_auth_file.cc",
67 "turnserver/read_auth_file.h",
68 ]
Mirko Bonadeiccbe95f2020-01-21 12:10:10 +010069 deps = [ "../rtc_base" ]
Niels Möller9862c2e2018-10-30 12:20:03 +010070}
71
72if (rtc_include_tests) {
73 rtc_test("examples_unittests") {
74 testonly = true
Mirko Bonadeiccbe95f2020-01-21 12:10:10 +010075 sources = [ "turnserver/read_auth_file_unittest.cc" ]
Niels Möller9862c2e2018-10-30 12:20:03 +010076 deps = [
77 ":read_auth_file",
78 "../test:test_main",
79 "//test:test_support",
80 "//testing/gtest",
81 ]
82 }
83}
84
tkchin2ddfdba2016-08-07 21:37:45 -070085if (is_android) {
Mirko Bonadeifbb3b7d2017-11-07 15:36:33 +000086 rtc_android_apk("AppRTCMobile") {
kjellander1993b1d2017-03-06 00:29:21 -080087 testonly = true
Magnus Jedvertc1815cf2016-09-27 10:10:41 +020088 apk_name = "AppRTCMobile"
Sami Kalliomaki9c0c75b2016-06-29 14:55:00 +020089 android_manifest = "androidapp/AndroidManifest.xml"
Oleh Prypin4cbb4ef2019-06-18 17:09:51 +020090 min_sdk_version = 16
91 target_sdk_version = 29
Sami Kalliomaki9c0c75b2016-06-29 14:55:00 +020092
93 deps = [
Magnus Jedvertc1815cf2016-09-27 10:10:41 +020094 ":AppRTCMobile_javalib",
95 ":AppRTCMobile_resources",
jianjun.zhuc0247402017-07-11 06:20:45 -070096 "../rtc_base:base_java",
Sami Kalliomaki9c0c75b2016-06-29 14:55:00 +020097 ]
98
jianjun.zhuc0247402017-07-11 06:20:45 -070099 shared_libraries = [ "../sdk/android:libjingle_peerconnection_so" ]
Sami Kalliomaki9c0c75b2016-06-29 14:55:00 +0200100 }
101
Mirko Bonadeifbb3b7d2017-11-07 15:36:33 +0000102 rtc_android_library("AppRTCMobile_javalib") {
kjellander1993b1d2017-03-06 00:29:21 -0800103 testonly = true
Courtney Edwards35c87b62020-05-19 13:44:42 +0200104 android_manifest = "androidapp/AndroidManifest.xml"
sakal07a050f2017-02-13 05:58:27 -0800105
Natalie Chouinard65bbcab2019-12-23 14:02:25 -0800106 sources = [
Sami Kalliomaki9c0c75b2016-06-29 14:55:00 +0200107 "androidapp/src/org/appspot/apprtc/AppRTCAudioManager.java",
henrikac3c2f312016-12-14 07:36:56 -0800108 "androidapp/src/org/appspot/apprtc/AppRTCBluetoothManager.java",
Sami Kalliomaki9c0c75b2016-06-29 14:55:00 +0200109 "androidapp/src/org/appspot/apprtc/AppRTCClient.java",
110 "androidapp/src/org/appspot/apprtc/AppRTCProximitySensor.java",
111 "androidapp/src/org/appspot/apprtc/CallActivity.java",
112 "androidapp/src/org/appspot/apprtc/CallFragment.java",
113 "androidapp/src/org/appspot/apprtc/CaptureQualityController.java",
114 "androidapp/src/org/appspot/apprtc/ConnectActivity.java",
115 "androidapp/src/org/appspot/apprtc/CpuMonitor.java",
116 "androidapp/src/org/appspot/apprtc/DirectRTCClient.java",
117 "androidapp/src/org/appspot/apprtc/HudFragment.java",
118 "androidapp/src/org/appspot/apprtc/PeerConnectionClient.java",
Natalie Chouinard65bbcab2019-12-23 14:02:25 -0800119 "androidapp/src/org/appspot/apprtc/RecordedAudioToFileController.java",
Sami Kalliomaki9c0c75b2016-06-29 14:55:00 +0200120 "androidapp/src/org/appspot/apprtc/RoomParametersFetcher.java",
Qingsi Wanga4e72b72018-02-12 10:34:18 -0800121 "androidapp/src/org/appspot/apprtc/RtcEventLog.java",
Sami Kalliomaki9c0c75b2016-06-29 14:55:00 +0200122 "androidapp/src/org/appspot/apprtc/SettingsActivity.java",
123 "androidapp/src/org/appspot/apprtc/SettingsFragment.java",
124 "androidapp/src/org/appspot/apprtc/TCPChannelClient.java",
125 "androidapp/src/org/appspot/apprtc/UnhandledExceptionHandler.java",
126 "androidapp/src/org/appspot/apprtc/WebSocketChannelClient.java",
127 "androidapp/src/org/appspot/apprtc/WebSocketRTCClient.java",
128 "androidapp/src/org/appspot/apprtc/util/AppRTCUtils.java",
129 "androidapp/src/org/appspot/apprtc/util/AsyncHttpURLConnection.java",
Sami Kalliomaki9c0c75b2016-06-29 14:55:00 +0200130 ]
131
132 deps = [
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200133 ":AppRTCMobile_resources",
jianjun.zhuc0247402017-07-11 06:20:45 -0700134 "../rtc_base:base_java",
Sami Kalliomäki7d8f5942018-04-23 15:07:34 +0200135 "../sdk/android:audio_api_java",
Sami Kalliomäki725c1062018-03-28 10:49:18 +0200136 "../sdk/android:base_java",
Sami Kalliomäki1641ca32018-04-04 15:59:31 +0200137 "../sdk/android:camera_java",
Anders Carlsson1e06d882018-07-10 09:33:30 +0200138 "../sdk/android:default_video_codec_factory_java",
Sami Kalliomäki1641ca32018-04-04 15:59:31 +0200139 "../sdk/android:filevideo_java",
Sami Kalliomäki725c1062018-03-28 10:49:18 +0200140 "../sdk/android:hwcodecs_java",
Sami Kalliomäki7d8f5942018-04-23 15:07:34 +0200141 "../sdk/android:java_audio_device_module_java",
jianjun.zhuc0247402017-07-11 06:20:45 -0700142 "../sdk/android:libjingle_peerconnection_java",
143 "../sdk/android:libjingle_peerconnection_metrics_default_java",
Sami Kalliomäki1641ca32018-04-04 15:59:31 +0200144 "../sdk/android:peerconnection_java",
145 "../sdk/android:screencapturer_java",
146 "../sdk/android:surfaceviewrenderer_java",
Sami Kalliomäki725c1062018-03-28 10:49:18 +0200147 "../sdk/android:swcodecs_java",
Sami Kalliomäki1641ca32018-04-04 15:59:31 +0200148 "../sdk/android:video_api_java",
Sami Kalliomäki903bd412018-07-24 10:53:28 +0200149 "../sdk/android:video_java",
jianjun.zhuc0247402017-07-11 06:20:45 -0700150 "androidapp/third_party/autobanh:autobanh_java",
Peter Wen7bc331f2019-03-06 09:18:57 -0500151 "//third_party/android_deps:com_android_support_support_annotations_java",
Sami Kalliomaki9c0c75b2016-06-29 14:55:00 +0200152 ]
153 }
154
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200155 android_resources("AppRTCMobile_resources") {
kjellander1993b1d2017-03-06 00:29:21 -0800156 testonly = true
Andrew Grieved4262df2020-03-25 12:59:50 -0400157 sources = [
158 "androidapp/res/drawable-hdpi/disconnect.png",
159 "androidapp/res/drawable-hdpi/ic_action_full_screen.png",
160 "androidapp/res/drawable-hdpi/ic_action_return_from_full_screen.png",
161 "androidapp/res/drawable-hdpi/ic_launcher.png",
162 "androidapp/res/drawable-hdpi/ic_loopback_call.png",
163 "androidapp/res/drawable-ldpi/disconnect.png",
164 "androidapp/res/drawable-ldpi/ic_action_full_screen.png",
165 "androidapp/res/drawable-ldpi/ic_action_return_from_full_screen.png",
166 "androidapp/res/drawable-ldpi/ic_launcher.png",
167 "androidapp/res/drawable-ldpi/ic_loopback_call.png",
168 "androidapp/res/drawable-mdpi/disconnect.png",
169 "androidapp/res/drawable-mdpi/ic_action_full_screen.png",
170 "androidapp/res/drawable-mdpi/ic_action_return_from_full_screen.png",
171 "androidapp/res/drawable-mdpi/ic_launcher.png",
172 "androidapp/res/drawable-mdpi/ic_loopback_call.png",
173 "androidapp/res/drawable-xhdpi/disconnect.png",
174 "androidapp/res/drawable-xhdpi/ic_action_full_screen.png",
175 "androidapp/res/drawable-xhdpi/ic_action_return_from_full_screen.png",
176 "androidapp/res/drawable-xhdpi/ic_launcher.png",
177 "androidapp/res/drawable-xhdpi/ic_loopback_call.png",
178 "androidapp/res/layout/activity_call.xml",
179 "androidapp/res/layout/activity_connect.xml",
180 "androidapp/res/layout/fragment_call.xml",
181 "androidapp/res/layout/fragment_hud.xml",
182 "androidapp/res/menu/connect_menu.xml",
183 "androidapp/res/values/arrays.xml",
184 "androidapp/res/values/strings.xml",
185 "androidapp/res/values-v17/styles.xml",
186 "androidapp/res/values-v21/styles.xml",
187 "androidapp/res/xml/preferences.xml",
188 ]
Sami Kalliomaki9c0c75b2016-06-29 14:55:00 +0200189 custom_package = "org.appspot.apprtc"
Andrew Grieved4262df2020-03-25 12:59:50 -0400190
191 # Needed for Bazel converter.
192 resource_dirs = [ "androidapp/res" ]
193 assert(resource_dirs != []) # Mark as used.
Sami Kalliomaki9c0c75b2016-06-29 14:55:00 +0200194 }
195
Sami Kalliomäkid54f5f52018-08-03 13:23:05 +0200196 rtc_instrumentation_test_apk("AppRTCMobile_test_apk") {
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200197 apk_name = "AppRTCMobileTest"
Sami Kalliomaki9c0c75b2016-06-29 14:55:00 +0200198 android_manifest = "androidtests/AndroidManifest.xml"
Oleh Prypin4cbb4ef2019-06-18 17:09:51 +0200199 min_sdk_version = 16
200 target_sdk_version = 21
Sami Kalliomaki9c0c75b2016-06-29 14:55:00 +0200201
Natalie Chouinard65bbcab2019-12-23 14:02:25 -0800202 sources = [
Patrik Höglunda8005cf2017-12-13 16:05:42 +0100203 "androidtests/src/org/appspot/apprtc/test/PeerConnectionClientTest.java",
204 ]
Sami Kalliomaki9c0c75b2016-06-29 14:55:00 +0200205
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200206 apk_under_test = ":AppRTCMobile"
Sami Kalliomaki9c0c75b2016-06-29 14:55:00 +0200207
208 deps = [
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200209 ":AppRTCMobile_javalib",
jianjun.zhuc0247402017-07-11 06:20:45 -0700210 "../sdk/android:libjingle_peerconnection_java",
Sami Kalliomäki903bd412018-07-24 10:53:28 +0200211 "../sdk/android:video_java",
sakalcb79d512017-01-11 06:21:26 -0800212 "//third_party/android_support_test_runner:runner_java",
213 "//third_party/junit",
Sami Kalliomaki9c0c75b2016-06-29 14:55:00 +0200214 ]
215 }
Sami Kalliomaki9c0c75b2016-06-29 14:55:00 +0200216}
tkchin2ddfdba2016-08-07 21:37:45 -0700217
218if (is_ios || (is_mac && target_cpu != "x86")) {
tkchin2ddfdba2016-08-07 21:37:45 -0700219 config("apprtc_common_config") {
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200220 include_dirs = [ "objc/AppRTCMobile/common" ]
tkchin2ddfdba2016-08-07 21:37:45 -0700221 }
222
Mirko Bonadei86d053c2019-10-17 21:32:04 +0200223 rtc_library("apprtc_common") {
kjellander1993b1d2017-03-06 00:29:21 -0800224 testonly = true
tkchin2ddfdba2016-08-07 21:37:45 -0700225 sources = [
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200226 "objc/AppRTCMobile/common/ARDUtilities.h",
227 "objc/AppRTCMobile/common/ARDUtilities.m",
tkchin2ddfdba2016-08-07 21:37:45 -0700228 ]
ehmaldonadoe9cc6862016-09-05 06:10:18 -0700229 public_configs = [ ":apprtc_common_config" ]
tkchin2ddfdba2016-08-07 21:37:45 -0700230
Kári Tristan Helgason946923a2017-06-02 14:05:56 +0200231 if (is_ios) {
Mirko Bonadeicbaaaed2018-02-19 15:14:04 +0100232 # iOS must use WebRTC.framework which is dynamically linked.
Mirko Bonadeiccbe95f2020-01-21 12:10:10 +0100233 deps = [ "../sdk:framework_objc+link" ]
Kári Tristan Helgason946923a2017-06-02 14:05:56 +0200234 } else {
Mirko Bonadeiccbe95f2020-01-21 12:10:10 +0100235 deps = [ "../sdk:mac_framework_objc+link" ]
Kári Tristan Helgason946923a2017-06-02 14:05:56 +0200236 }
tkchin2ddfdba2016-08-07 21:37:45 -0700237 }
238
239 config("apprtc_signaling_config") {
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200240 include_dirs = [ "objc/AppRTCMobile" ]
Mirko Bonadei89327ff2019-07-30 11:38:08 +0200241 cflags_objc = [
242 # TODO(bugs.webrtc.org/10837): Remove this when usage of
243 # archivedDataWithRootObject will be removed.
244 "-Wno-unguarded-availability",
245 ]
tkchin2ddfdba2016-08-07 21:37:45 -0700246 }
247
Mirko Bonadei86d053c2019-10-17 21:32:04 +0200248 rtc_library("apprtc_signaling") {
kjellander1993b1d2017-03-06 00:29:21 -0800249 testonly = true
tkchin2ddfdba2016-08-07 21:37:45 -0700250 sources = [
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200251 "objc/AppRTCMobile/ARDAppClient+Internal.h",
252 "objc/AppRTCMobile/ARDAppClient.h",
253 "objc/AppRTCMobile/ARDAppClient.m",
254 "objc/AppRTCMobile/ARDAppEngineClient.h",
255 "objc/AppRTCMobile/ARDAppEngineClient.m",
256 "objc/AppRTCMobile/ARDBitrateTracker.h",
257 "objc/AppRTCMobile/ARDBitrateTracker.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",
295 ]
Kári Tristan Helgason8a1e35c2019-03-07 10:44:26 +0100296
Kári Tristan Helgason946923a2017-06-02 14:05:56 +0200297 if (is_ios) {
Mirko Bonadeicbaaaed2018-02-19 15:14:04 +0100298 # iOS must use WebRTC.framework which is dynamically linked.
Mirko Bonadei1a339c32017-12-14 13:06:10 +0100299 deps += [
Anders Carlsson7bca8ca2018-08-30 09:30:29 +0200300 "../sdk:framework_objc+link",
301 "../sdk:ios_framework_bundle",
Kári Tristan Helgason946923a2017-06-02 14:05:56 +0200302 ]
Mirko Bonadei1a339c32017-12-14 13:06:10 +0100303 } else {
Anders Carlsson7bca8ca2018-08-30 09:30:29 +0200304 deps += [ "../sdk:mac_framework_objc+link" ]
Kári Tristan Helgason946923a2017-06-02 14:05:56 +0200305 }
Kári Tristan Helgason8a1e35c2019-03-07 10:44:26 +0100306 libs = [
307 "CoreMedia.framework",
308 "QuartzCore.framework",
309 ]
tkchin2ddfdba2016-08-07 21:37:45 -0700310 }
311
312 if (is_ios) {
Mirko Bonadei86d053c2019-10-17 21:32:04 +0200313 rtc_library("AppRTCMobile_lib") {
Mirko Bonadeicbaaaed2018-02-19 15:14:04 +0100314 # iOS must use WebRTC.framework which is dynamically linked.
kjellander1993b1d2017-03-06 00:29:21 -0800315 testonly = true
tkchin2ddfdba2016-08-07 21:37:45 -0700316 sources = [
Patrik Höglund49acb1e2018-01-02 14:41:54 +0100317 "objc/AppRTCMobile/ios/ARDAppDelegate.h",
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200318 "objc/AppRTCMobile/ios/ARDAppDelegate.m",
Daniela012b56b2017-11-15 13:15:24 +0100319 "objc/AppRTCMobile/ios/ARDFileCaptureController.h",
320 "objc/AppRTCMobile/ios/ARDFileCaptureController.m",
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200321 "objc/AppRTCMobile/ios/ARDMainView.h",
322 "objc/AppRTCMobile/ios/ARDMainView.m",
323 "objc/AppRTCMobile/ios/ARDMainViewController.h",
324 "objc/AppRTCMobile/ios/ARDMainViewController.m",
denicijad17d5362016-11-02 02:56:09 -0700325 "objc/AppRTCMobile/ios/ARDSettingsViewController.h",
326 "objc/AppRTCMobile/ios/ARDSettingsViewController.m",
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200327 "objc/AppRTCMobile/ios/ARDStatsView.h",
328 "objc/AppRTCMobile/ios/ARDStatsView.m",
329 "objc/AppRTCMobile/ios/ARDVideoCallView.h",
330 "objc/AppRTCMobile/ios/ARDVideoCallView.m",
331 "objc/AppRTCMobile/ios/ARDVideoCallViewController.h",
332 "objc/AppRTCMobile/ios/ARDVideoCallViewController.m",
Anders Carlsson6bf43d22017-10-16 13:51:43 +0200333 "objc/AppRTCMobile/ios/RTCVideoCodecInfo+HumanReadable.h",
334 "objc/AppRTCMobile/ios/RTCVideoCodecInfo+HumanReadable.m",
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200335 "objc/AppRTCMobile/ios/UIImage+ARDUtilities.h",
336 "objc/AppRTCMobile/ios/UIImage+ARDUtilities.m",
denicija77bfd7c2016-11-15 00:41:26 -0800337 ]
denicija77bfd7c2016-11-15 00:41:26 -0800338
Anders Carlsson96fccfe2019-02-21 16:11:40 +0100339 configs += [ "..:common_objc" ]
340
denicija77bfd7c2016-11-15 00:41:26 -0800341 deps = [
342 ":apprtc_common",
343 ":apprtc_signaling",
Anders Carlsson7bca8ca2018-08-30 09:30:29 +0200344 "../sdk:framework_objc+link",
345 "../sdk:ios_framework_bundle",
denicija77bfd7c2016-11-15 00:41:26 -0800346 ]
Kári Tristan Helgason8a1e35c2019-03-07 10:44:26 +0100347
348 libs = [ "AVFoundation.framework" ]
denicija77bfd7c2016-11-15 00:41:26 -0800349 }
350
351 ios_app_bundle("AppRTCMobile") {
kjellander1993b1d2017-03-06 00:29:21 -0800352 testonly = true
Mirko Bonadeiccbe95f2020-01-21 12:10:10 +0100353 sources = [ "objc/AppRTCMobile/ios/main.m" ]
tkchin2ddfdba2016-08-07 21:37:45 -0700354
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200355 info_plist = "objc/AppRTCMobile/ios/Info.plist"
tkchin2ddfdba2016-08-07 21:37:45 -0700356
denicija77bfd7c2016-11-15 00:41:26 -0800357 configs += [ "..:common_config" ]
tkchin2ddfdba2016-08-07 21:37:45 -0700358 public_configs = [ "..:common_inherited_config" ]
359
360 deps = [
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200361 ":AppRTCMobile_ios_bundle_data",
denicija77bfd7c2016-11-15 00:41:26 -0800362 ":AppRTCMobile_lib",
Mirko Bonadei1a339c32017-12-14 13:06:10 +0100363 "../sdk:framework_objc",
Anders Carlsson7bca8ca2018-08-30 09:30:29 +0200364 "../sdk:ios_framework_bundle",
tkchin2ddfdba2016-08-07 21:37:45 -0700365 ]
366
Anders Carlsson358f2e02018-06-04 10:24:37 +0200367 if (rtc_apprtcmobile_broadcast_extension) {
368 deps += [
369 ":AppRTCMobileBroadcastSetupUI_extension_bundle",
370 ":AppRTCMobileBroadcastUpload_extension_bundle",
371 ]
372 }
373
tkchin2ddfdba2016-08-07 21:37:45 -0700374 if (target_cpu == "x86") {
Artem Titov94b57c02019-03-21 13:35:10 +0100375 deps += [ "//testing/iossim" ]
tkchin2ddfdba2016-08-07 21:37:45 -0700376 }
377 }
378
Anders Carlsson358f2e02018-06-04 10:24:37 +0200379 if (rtc_apprtcmobile_broadcast_extension) {
380 bundle_data("AppRTCMobileBroadcastUpload_extension_bundle") {
381 testonly = true
Mirko Bonadeiccbe95f2020-01-21 12:10:10 +0100382 public_deps = [ ":AppRTCMobileBroadcastUpload" ] # no-presubmit-check TODO(webrtc:8603)
383 sources = [ "$root_out_dir/AppRTCMobileBroadcastUpload.appex" ]
384 outputs = [ "{{bundle_contents_dir}}/Plugins/{{source_file_part}}" ]
Anders Carlsson358f2e02018-06-04 10:24:37 +0200385 }
386
387 bundle_data("AppRTCMobileBroadcastSetupUI_extension_bundle") {
388 testonly = true
Mirko Bonadeiccbe95f2020-01-21 12:10:10 +0100389 public_deps = [ ":AppRTCMobileBroadcastSetupUI" ] # no-presubmit-check TODO(webrtc:8603)
390 sources = [ "$root_out_dir/AppRTCMobileBroadcastSetupUI.appex" ]
391 outputs = [ "{{bundle_contents_dir}}/Plugins/{{source_file_part}}" ]
Anders Carlsson358f2e02018-06-04 10:24:37 +0200392 }
393
Mirko Bonadei86d053c2019-10-17 21:32:04 +0200394 rtc_library("AppRTCMobileBroadcastUpload_lib") {
Anders Carlsson358f2e02018-06-04 10:24:37 +0200395 testonly = true
396 sources = [
397 "objc/AppRTCMobile/ios/broadcast_extension/ARDBroadcastSampleHandler.h",
398 "objc/AppRTCMobile/ios/broadcast_extension/ARDBroadcastSampleHandler.m",
399 ]
400
401 deps = [
Anders Carlsson358f2e02018-06-04 10:24:37 +0200402 ":apprtc_signaling",
Anders Carlsson7bca8ca2018-08-30 09:30:29 +0200403 "../sdk:framework_objc+link",
404 "../sdk:ios_framework_bundle",
Anders Carlsson358f2e02018-06-04 10:24:37 +0200405 ]
406
407 libs = [ "ReplayKit.framework" ]
408 }
409
410 ios_appex_bundle("AppRTCMobileBroadcastUpload") {
411 testonly = true
412 configs += [ "..:common_config" ]
413 public_configs = [ "..:common_inherited_config" ]
414
415 info_plist = "objc/AppRTCMobile/ios/broadcast_extension/BroadcastUploadInfo.plist"
416
417 deps = [
418 ":AppRTCMobileBroadcastUpload_lib",
419 "../sdk:framework_objc",
420 ]
421 }
422
423 ios_appex_bundle("AppRTCMobileBroadcastSetupUI") {
424 sources = [
425 "objc/AppRTCMobile/ios/broadcast_extension/ARDBroadcastSetupViewController.h",
426 "objc/AppRTCMobile/ios/broadcast_extension/ARDBroadcastSetupViewController.m",
427 ]
428
429 info_plist = "objc/AppRTCMobile/ios/broadcast_extension/BroadcastSetupUIInfo.plist"
430
431 libs = [ "ReplayKit.framework" ]
432
Mirko Bonadeiccbe95f2020-01-21 12:10:10 +0100433 deps = [ ":AppRTCMobile_ios_bundle_data" ]
Anders Carlsson358f2e02018-06-04 10:24:37 +0200434 }
435 }
436
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200437 bundle_data("AppRTCMobile_ios_bundle_data") {
tkchin2ddfdba2016-08-07 21:37:45 -0700438 sources = [
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200439 "objc/AppRTCMobile/ios/resources/Roboto-Regular.ttf",
Daniela012b56b2017-11-15 13:15:24 +0100440
441 # Sample video taken from https://media.xiph.org/video/derf/
442 "objc/AppRTCMobile/ios/resources/foreman.mp4",
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200443 "objc/AppRTCMobile/ios/resources/iPhone5@2x.png",
444 "objc/AppRTCMobile/ios/resources/iPhone6@2x.png",
445 "objc/AppRTCMobile/ios/resources/iPhone6p@3x.png",
446 "objc/AppRTCMobile/ios/resources/ic_call_end_black_24dp.png",
447 "objc/AppRTCMobile/ios/resources/ic_call_end_black_24dp@2x.png",
448 "objc/AppRTCMobile/ios/resources/ic_clear_black_24dp.png",
449 "objc/AppRTCMobile/ios/resources/ic_clear_black_24dp@2x.png",
denicija6d6762c2016-10-28 04:53:16 -0700450 "objc/AppRTCMobile/ios/resources/ic_settings_black_24dp.png",
451 "objc/AppRTCMobile/ios/resources/ic_settings_black_24dp@2x.png",
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200452 "objc/AppRTCMobile/ios/resources/ic_surround_sound_black_24dp.png",
453 "objc/AppRTCMobile/ios/resources/ic_surround_sound_black_24dp@2x.png",
454 "objc/AppRTCMobile/ios/resources/ic_switch_video_black_24dp.png",
455 "objc/AppRTCMobile/ios/resources/ic_switch_video_black_24dp@2x.png",
456 "objc/AppRTCMobile/ios/resources/mozart.mp3",
anderscb5ed9052017-08-15 04:07:12 -0700457 "objc/Icon-120.png",
458 "objc/Icon-180.png",
tkchin2ddfdba2016-08-07 21:37:45 -0700459 "objc/Icon.png",
460 ]
Mirko Bonadeiccbe95f2020-01-21 12:10:10 +0100461 outputs = [ "{{bundle_resources_dir}}/{{source_file_part}}" ]
tkchin2ddfdba2016-08-07 21:37:45 -0700462 }
Anders Carlsson73119182018-03-15 09:41:03 +0100463
Mirko Bonadei86d053c2019-10-17 21:32:04 +0200464 rtc_library("ObjCNativeAPIDemo_lib") {
Anders Carlsson73119182018-03-15 09:41:03 +0100465 testonly = true
466 sources = [
467 "objcnativeapi/objc/NADAppDelegate.h",
468 "objcnativeapi/objc/NADAppDelegate.m",
469 "objcnativeapi/objc/NADViewController.h",
470 "objcnativeapi/objc/NADViewController.mm",
Steve Anton10542f22019-01-11 09:11:00 -0800471 "objcnativeapi/objc/objc_call_client.h",
472 "objcnativeapi/objc/objc_call_client.mm",
Anders Carlsson73119182018-03-15 09:41:03 +0100473 ]
474
Anders Carlsson73119182018-03-15 09:41:03 +0100475 deps = [
476 "../api:libjingle_peerconnection_api",
Mirko Bonadeid9708072019-01-25 20:26:48 +0100477 "../api:scoped_refptr",
Anders Carlsson73119182018-03-15 09:41:03 +0100478 "../api/audio_codecs:builtin_audio_decoder_factory",
479 "../api/audio_codecs:builtin_audio_encoder_factory",
Danil Chapovalov4ba04b72019-06-26 15:49:47 +0200480 "../api/rtc_event_log:rtc_event_log_factory",
Danil Chapovalovaaa11432019-05-17 13:20:14 +0200481 "../api/task_queue:default_task_queue_factory",
Anders Carlsson73119182018-03-15 09:41:03 +0100482 "../media:rtc_audio_video",
Artem Titov94b57c02019-03-21 13:35:10 +0100483 "../modules/audio_processing",
Alessio Bazzicab768e882018-11-07 14:29:54 +0000484 "../modules/audio_processing:api",
Anders Carlsson73119182018-03-15 09:41:03 +0100485 "../pc:libjingle_peerconnection",
Artem Titov94b57c02019-03-21 13:35:10 +0100486 "../rtc_base",
Anders Carlsson7bca8ca2018-08-30 09:30:29 +0200487 "../sdk:base_objc",
Anders Carlsson73119182018-03-15 09:41:03 +0100488 "../sdk:default_codec_factory_objc",
Anders Carlsson7bca8ca2018-08-30 09:30:29 +0200489 "../sdk:helpers_objc",
Anders Carlsson73119182018-03-15 09:41:03 +0100490 "../sdk:native_api",
491 "../sdk:ui_objc",
Anders Carlsson7bca8ca2018-08-30 09:30:29 +0200492 "../sdk:videocapture_objc",
Anders Carlsson73119182018-03-15 09:41:03 +0100493 "../sdk:videotoolbox_objc",
Anders Carlsson73119182018-03-15 09:41:03 +0100494 ]
495
496 if (current_cpu == "arm64") {
497 deps += [ "../sdk:metal_objc" ]
498 }
499 }
500
501 ios_app_bundle("ObjCNativeAPIDemo") {
502 testonly = true
Mirko Bonadeiccbe95f2020-01-21 12:10:10 +0100503 sources = [ "objcnativeapi/objc/main.m" ]
Anders Carlsson73119182018-03-15 09:41:03 +0100504
505 info_plist = "objcnativeapi/Info.plist"
506
507 configs += [ "..:common_config" ]
508 public_configs = [ "..:common_inherited_config" ]
509
Mirko Bonadeiccbe95f2020-01-21 12:10:10 +0100510 deps = [ ":ObjCNativeAPIDemo_lib" ]
Anders Carlsson73119182018-03-15 09:41:03 +0100511
512 if (target_cpu == "x86") {
Artem Titov94b57c02019-03-21 13:35:10 +0100513 deps += [ "//testing/iossim" ]
Anders Carlsson73119182018-03-15 09:41:03 +0100514 }
515 }
tkchin2ddfdba2016-08-07 21:37:45 -0700516 }
517
518 if (is_mac) {
Mirko Bonadei86d053c2019-10-17 21:32:04 +0200519 rtc_library("AppRTCMobile_lib") {
kjellander1993b1d2017-03-06 00:29:21 -0800520 testonly = true
tkchin2ddfdba2016-08-07 21:37:45 -0700521 sources = [
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200522 "objc/AppRTCMobile/mac/APPRTCAppDelegate.h",
523 "objc/AppRTCMobile/mac/APPRTCAppDelegate.m",
524 "objc/AppRTCMobile/mac/APPRTCViewController.h",
525 "objc/AppRTCMobile/mac/APPRTCViewController.m",
tkchin2ddfdba2016-08-07 21:37:45 -0700526 ]
jianjun.zhuc0247402017-07-11 06:20:45 -0700527 configs += [ "..:common_objc" ]
tkchin2ddfdba2016-08-07 21:37:45 -0700528 deps = [
529 ":apprtc_common",
530 ":apprtc_signaling",
Anders Carlsson7bca8ca2018-08-30 09:30:29 +0200531 "../sdk:mac_framework_objc+link",
tkchin2ddfdba2016-08-07 21:37:45 -0700532 ]
533 }
534
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200535 mac_app_bundle("AppRTCMobile") {
kjellander1993b1d2017-03-06 00:29:21 -0800536 testonly = true
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200537 output_name = "AppRTCMobile"
tkchin2ddfdba2016-08-07 21:37:45 -0700538
Mirko Bonadeiccbe95f2020-01-21 12:10:10 +0100539 sources = [ "objc/AppRTCMobile/mac/main.m" ]
tkchin2ddfdba2016-08-07 21:37:45 -0700540
541 public_configs = [ "..:common_inherited_config" ]
542
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200543 info_plist = "objc/AppRTCMobile/mac/Info.plist"
tkchin2ddfdba2016-08-07 21:37:45 -0700544
545 libs = [ "AppKit.framework" ]
546
Anders Carlsson24d8ec32018-12-10 14:04:12 +0100547 ldflags = [
548 "-rpath",
549 "@executable_path/../Frameworks",
550 ]
551
tkchin2ddfdba2016-08-07 21:37:45 -0700552 deps = [
denicija77bfd7c2016-11-15 00:41:26 -0800553 ":AppRTCMobile_lib",
Anders Carlsson7bca8ca2018-08-30 09:30:29 +0200554 "../sdk:mac_framework_bundle",
555 "../sdk:mac_framework_objc+link",
tkchin2ddfdba2016-08-07 21:37:45 -0700556 ]
557 }
558 }
559
560 config("socketrocket_include_config") {
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200561 include_dirs = [ "objc/AppRTCMobile/third_party/SocketRocket" ]
tkchin2ddfdba2016-08-07 21:37:45 -0700562 }
563
564 config("socketrocket_warning_config") {
565 # GN orders flags on a target before flags from configs. The default config
566 # adds these flags so to cancel them out they need to come from a config and
567 # cannot be on the target directly.
568 cflags = [
569 "-Wno-deprecated-declarations",
570 "-Wno-nonnull",
tkchin2ddfdba2016-08-07 21:37:45 -0700571 "-Wno-semicolon-before-method-body",
kthelgasone47de1a2017-02-24 01:56:01 -0800572 "-Wno-unused-variable",
tkchin2ddfdba2016-08-07 21:37:45 -0700573 ]
574
henrika27d8b612016-09-21 04:13:00 -0700575 cflags_objc = [
576 # Enabled for cflags_objc in build/config/compiler/BUILD.gn.
577 "-Wno-objc-missing-property-synthesis",
henrika27d8b612016-09-21 04:13:00 -0700578 ]
tkchin2ddfdba2016-08-07 21:37:45 -0700579 }
580
Mirko Bonadei86d053c2019-10-17 21:32:04 +0200581 rtc_library("socketrocket") {
kjellander1993b1d2017-03-06 00:29:21 -0800582 testonly = true
tkchin2ddfdba2016-08-07 21:37:45 -0700583 sources = [
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200584 "objc/AppRTCMobile/third_party/SocketRocket/SRWebSocket.h",
585 "objc/AppRTCMobile/third_party/SocketRocket/SRWebSocket.m",
tkchin2ddfdba2016-08-07 21:37:45 -0700586 ]
kthelgasonc0977102017-04-24 00:57:16 -0700587 configs += [ ":socketrocket_warning_config" ]
ehmaldonadoe9cc6862016-09-05 06:10:18 -0700588 public_configs = [ ":socketrocket_include_config" ]
tkchin2ddfdba2016-08-07 21:37:45 -0700589
590 libs = [
591 "CFNetwork.framework",
Oleh Prypinb3f78de2019-07-18 22:25:48 +0200592 "Security.framework",
tkchin2ddfdba2016-08-07 21:37:45 -0700593 "icucore",
594 ]
595 }
adam.fedorbcc5d872016-11-07 14:53:28 -0800596
597 if (rtc_include_tests) {
kthelgason4065a572017-02-14 04:58:56 -0800598 # TODO(kthelgason): compile xctests on mac when chromium supports it.
599 if (is_ios) {
Mirko Bonadei86d053c2019-10-17 21:32:04 +0200600 rtc_library("apprtcmobile_test_sources") {
Mirko Bonadeicbaaaed2018-02-19 15:14:04 +0100601 # iOS must use WebRTC.framework which is dynamically linked.
kjellander1993b1d2017-03-06 00:29:21 -0800602 testonly = true
kthelgason4065a572017-02-14 04:58:56 -0800603 include_dirs = [
604 "objc/AppRTCMobile",
605 "objc/AppRTCMobile/ios",
606 ]
kthelgason4065a572017-02-14 04:58:56 -0800607 sources = [
608 "objc/AppRTCMobile/tests/ARDAppClient_xctest.mm",
Daniela012b56b2017-11-15 13:15:24 +0100609 "objc/AppRTCMobile/tests/ARDFileCaptureController_xctest.mm",
kthelgason4065a572017-02-14 04:58:56 -0800610 "objc/AppRTCMobile/tests/ARDSettingsModel_xctest.mm",
611 ]
kjellander1993b1d2017-03-06 00:29:21 -0800612 deps = [
kthelgason4065a572017-02-14 04:58:56 -0800613 ":AppRTCMobile_lib",
Mirko Bonadeicbaaaed2018-02-19 15:14:04 +0100614 ":apprtc_signaling",
Artem Titov94b57c02019-03-21 13:35:10 +0100615 "../rtc_base",
Anders Carlsson7bca8ca2018-08-30 09:30:29 +0200616 "../sdk:framework_objc+link",
617 "../sdk:ios_framework_bundle",
kthelgason4065a572017-02-14 04:58:56 -0800618 "//build/config/ios:xctest",
619 "//third_party/ocmock",
620 ]
adam.fedorbcc5d872016-11-07 14:53:28 -0800621 }
622
kthelgason4065a572017-02-14 04:58:56 -0800623 rtc_ios_xctest_test("apprtcmobile_tests") {
624 info_plist = "objc/AppRTCMobile/ios/Info.plist"
Mirko Bonadeiccbe95f2020-01-21 12:10:10 +0100625 sources = [ "objc/AppRTCMobile/tests/main.mm" ]
kthelgason4065a572017-02-14 04:58:56 -0800626 deps = [
Mirko Bonadeicbaaaed2018-02-19 15:14:04 +0100627 ":AppRTCMobile_lib",
kthelgason4065a572017-02-14 04:58:56 -0800628 ":apprtcmobile_test_sources",
Mirko Bonadei1a339c32017-12-14 13:06:10 +0100629 "../sdk:framework_objc",
Artem Titarenko34fc3462018-11-06 12:29:29 +0100630 "//test:test_support",
kthelgason4065a572017-02-14 04:58:56 -0800631 ]
632 ldflags = [ "-all_load" ]
633 }
adam.fedorbcc5d872016-11-07 14:53:28 -0800634 }
635 }
tkchin2ddfdba2016-08-07 21:37:45 -0700636}
kthelgason0727f152016-08-08 09:03:23 -0700637
638if (is_linux || is_win) {
ehmaldonado38a21322016-09-02 04:10:34 -0700639 rtc_executable("peerconnection_client") {
kjellander1993b1d2017-03-06 00:29:21 -0800640 testonly = true
kthelgason0727f152016-08-08 09:03:23 -0700641 sources = [
642 "peerconnection/client/conductor.cc",
643 "peerconnection/client/conductor.h",
644 "peerconnection/client/defaults.cc",
645 "peerconnection/client/defaults.h",
646 "peerconnection/client/peer_connection_client.cc",
647 "peerconnection/client/peer_connection_client.h",
648 ]
ehmaldonado7a2ce0b2016-09-05 01:35:44 -0700649
Patrik Höglundb5b5bce2017-11-13 10:19:58 +0100650 deps = [
Yves Gerey3e707812018-11-28 16:47:49 +0100651 "../api:audio_options_api",
Mirko Bonadei2ff3f492018-11-22 09:00:13 +0100652 "../api:create_peerconnection_factory",
Mirko Bonadei34814c72018-01-11 10:13:56 +0100653 "../api:libjingle_peerconnection_api",
Niels Möllere942b142019-09-17 14:30:41 +0200654 "../api:media_stream_interface",
Mirko Bonadeid9708072019-01-25 20:26:48 +0100655 "../api:scoped_refptr",
Yves Gerey3e707812018-11-28 16:47:49 +0100656 "../api/audio:audio_mixer_api",
657 "../api/audio_codecs:audio_codecs_api",
Niels Möllerc6ce9c52018-05-11 11:15:30 +0200658 "../api/video:video_frame_i420",
Chen Xing5d24b162019-06-10 12:59:38 +0200659 "../api/video:video_rtp_headers",
Yves Gerey3e707812018-11-28 16:47:49 +0100660 "../api/video_codecs:video_codecs_api",
661 "../media:rtc_media_base",
662 "../p2p:rtc_p2p",
Patrik Höglunda8005cf2017-12-13 16:05:42 +0100663 "../rtc_base:checks",
Artem Titove41c4332018-07-25 15:04:28 +0200664 "../rtc_base/third_party/sigslot",
Bjorn Terelius3e676762018-10-29 15:26:27 +0100665 "../system_wrappers:field_trial",
666 "../test:field_trial",
Kári Tristan Helgasonede7cb22019-03-06 10:34:09 +0100667 "../test:platform_video_capturer",
Tommi25eb47c2019-08-29 16:39:05 +0200668 "../test:rtp_test_utils",
Niels Möllerb76be9a2018-12-20 16:28:23 +0100669 "//third_party/abseil-cpp/absl/memory",
Yves Gerey3e707812018-11-28 16:47:49 +0100670 "//third_party/abseil-cpp/absl/types:optional",
Patrik Höglundb5b5bce2017-11-13 10:19:58 +0100671 ]
kthelgason0727f152016-08-08 09:03:23 -0700672 if (is_win) {
673 sources += [
Steve Anton10542f22019-01-11 09:11:00 -0800674 "peerconnection/client/flag_defs.h",
kthelgason0727f152016-08-08 09:03:23 -0700675 "peerconnection/client/main.cc",
676 "peerconnection/client/main_wnd.cc",
677 "peerconnection/client/main_wnd.h",
678 ]
kthelgason0727f152016-08-08 09:03:23 -0700679 configs += [ "//build/config/win:windowed" ]
jianjun.zhuc0247402017-07-11 06:20:45 -0700680 deps += [ "../media:rtc_media_base" ]
kthelgason0727f152016-08-08 09:03:23 -0700681 }
682 if (is_linux) {
683 sources += [
684 "peerconnection/client/linux/main.cc",
685 "peerconnection/client/linux/main_wnd.cc",
686 "peerconnection/client/linux/main_wnd.h",
687 ]
Henrik Kjellanderefbde2c2017-03-27 08:28:27 +0200688 cflags = [ "-Wno-deprecated-declarations" ]
kthelgason0727f152016-08-08 09:03:23 -0700689 libs = [
690 "X11",
691 "Xcomposite",
692 "Xext",
693 "Xrender",
694 ]
thomasandersonef16e992016-12-13 02:57:43 -0800695 deps += [ "//build/config/linux/gtk" ]
kthelgason0727f152016-08-08 09:03:23 -0700696 }
kjellander1993b1d2017-03-06 00:29:21 -0800697
698 deps += [
Niels Möller8366e172018-02-14 12:20:13 +0100699 "../api:libjingle_peerconnection_api",
Karl Wiberg1b0eae32017-10-17 14:48:54 +0200700 "../api/audio_codecs:builtin_audio_decoder_factory",
701 "../api/audio_codecs:builtin_audio_encoder_factory",
Niels Möllerc6ce9c52018-05-11 11:15:30 +0200702 "../api/video:video_frame",
Chen Xing5d24b162019-06-10 12:59:38 +0200703 "../api/video:video_rtp_headers",
Anders Carlsson67537952018-05-03 11:28:29 +0200704 "../api/video_codecs:builtin_video_decoder_factory",
705 "../api/video_codecs:builtin_video_encoder_factory",
Mirko Bonadei75baa492018-01-11 17:07:30 +0100706 "../media:rtc_audio_video",
Artem Titov94b57c02019-03-21 13:35:10 +0100707 "../modules/audio_device",
708 "../modules/audio_processing",
Alessio Bazzicab768e882018-11-07 14:29:54 +0000709 "../modules/audio_processing:api",
jianjun.zhuc0247402017-07-11 06:20:45 -0700710 "../modules/video_capture:video_capture_module",
711 "../pc:libjingle_peerconnection",
Niels Möllerb76be9a2018-12-20 16:28:23 +0100712 "../pc:peerconnection",
Artem Titov94b57c02019-03-21 13:35:10 +0100713 "../rtc_base",
ehmaldonadof6a861a2017-07-19 10:40:47 -0700714 "../rtc_base:rtc_base_approved",
715 "../rtc_base:rtc_json",
Niels Möllerb76be9a2018-12-20 16:28:23 +0100716 "../test:video_test_common",
Mirko Bonadei0be40bf2019-07-16 18:40:05 +0200717 "//third_party/abseil-cpp/absl/flags:flag",
718 "//third_party/abseil-cpp/absl/flags:parse",
kjellander1993b1d2017-03-06 00:29:21 -0800719 "//third_party/libyuv",
kjellander1993b1d2017-03-06 00:29:21 -0800720 ]
kthelgason0727f152016-08-08 09:03:23 -0700721 }
kjellanderd4626e52016-09-07 02:33:01 -0700722
ehmaldonado38a21322016-09-02 04:10:34 -0700723 rtc_executable("peerconnection_server") {
kjellander1993b1d2017-03-06 00:29:21 -0800724 testonly = true
kthelgason0727f152016-08-08 09:03:23 -0700725 sources = [
726 "peerconnection/server/data_socket.cc",
727 "peerconnection/server/data_socket.h",
728 "peerconnection/server/main.cc",
729 "peerconnection/server/peer_channel.cc",
730 "peerconnection/server/peer_channel.h",
731 "peerconnection/server/utils.cc",
732 "peerconnection/server/utils.h",
733 ]
734 deps = [
ehmaldonadof6a861a2017-07-19 10:40:47 -0700735 "../rtc_base:rtc_base_approved",
Bjorn Terelius3e676762018-10-29 15:26:27 +0100736 "../system_wrappers:field_trial",
737 "../test:field_trial",
Mirko Bonadei04cffe32019-06-25 15:43:23 +0200738 "//third_party/abseil-cpp/absl/flags:flag",
739 "//third_party/abseil-cpp/absl/flags:parse",
Mirko Bonadei76c89da2019-07-19 12:12:14 +0200740 "//third_party/abseil-cpp/absl/flags:usage",
kthelgason0727f152016-08-08 09:03:23 -0700741 ]
kthelgason0727f152016-08-08 09:03:23 -0700742 }
ehmaldonado38a21322016-09-02 04:10:34 -0700743 rtc_executable("turnserver") {
kjellander1993b1d2017-03-06 00:29:21 -0800744 testonly = true
Mirko Bonadeiccbe95f2020-01-21 12:10:10 +0100745 sources = [ "turnserver/turnserver_main.cc" ]
kthelgason0727f152016-08-08 09:03:23 -0700746 deps = [
Niels Möller9862c2e2018-10-30 12:20:03 +0100747 ":read_auth_file",
Niels Möllera1342042018-11-08 16:47:14 +0100748 "../p2p:p2p_server_utils",
jianjun.zhuc0247402017-07-11 06:20:45 -0700749 "../p2p:rtc_p2p",
750 "../pc:rtc_pc",
Artem Titov94b57c02019-03-21 13:35:10 +0100751 "../rtc_base",
ehmaldonadof6a861a2017-07-19 10:40:47 -0700752 "../rtc_base:rtc_base_approved",
kthelgason0727f152016-08-08 09:03:23 -0700753 ]
kthelgason0727f152016-08-08 09:03:23 -0700754 }
ehmaldonado38a21322016-09-02 04:10:34 -0700755 rtc_executable("stunserver") {
kjellander1993b1d2017-03-06 00:29:21 -0800756 testonly = true
Mirko Bonadeiccbe95f2020-01-21 12:10:10 +0100757 sources = [ "stunserver/stunserver_main.cc" ]
kthelgason0727f152016-08-08 09:03:23 -0700758 deps = [
Niels Möllera1342042018-11-08 16:47:14 +0100759 "../p2p:p2p_server_utils",
jianjun.zhuc0247402017-07-11 06:20:45 -0700760 "../p2p:rtc_p2p",
761 "../pc:rtc_pc",
Artem Titov94b57c02019-03-21 13:35:10 +0100762 "../rtc_base",
ehmaldonadof6a861a2017-07-19 10:40:47 -0700763 "../rtc_base:rtc_base_approved",
kthelgason0727f152016-08-08 09:03:23 -0700764 ]
kthelgason0727f152016-08-08 09:03:23 -0700765 }
766}
charujainaca3a242016-11-01 03:09:15 -0700767
qiangchen42f96d52017-08-08 17:08:03 -0700768if (is_win || is_android) {
gyzhouad7cad82017-05-11 16:10:03 -0700769 rtc_shared_library("webrtc_unity_plugin") {
770 testonly = true
771 sources = [
772 "unityplugin/simple_peer_connection.cc",
773 "unityplugin/simple_peer_connection.h",
774 "unityplugin/unity_plugin_apis.cc",
775 "unityplugin/unity_plugin_apis.h",
gyzhoub38f3862017-07-25 16:04:31 -0700776 "unityplugin/video_observer.cc",
777 "unityplugin/video_observer.h",
gyzhouad7cad82017-05-11 16:10:03 -0700778 ]
qiangchen42f96d52017-08-08 17:08:03 -0700779
780 if (is_android) {
781 sources += [
Steve Anton10542f22019-01-11 09:11:00 -0800782 "unityplugin/class_reference_holder.cc",
783 "unityplugin/class_reference_holder.h",
qiangchen42f96d52017-08-08 17:08:03 -0700784 "unityplugin/jni_onload.cc",
785 ]
Qiang Chen43fb9122017-12-20 10:47:36 -0800786 suppressed_configs += [ "//build/config/android:hide_all_but_jni_onload" ]
qiangchen42f96d52017-08-08 17:08:03 -0700787 }
788
qiangchen42f96d52017-08-08 17:08:03 -0700789 if (is_win) {
Mirko Bonadeif957dd92018-07-11 10:47:42 +0200790 configs += [ "//build/config/win:windowed" ]
qiangchen42f96d52017-08-08 17:08:03 -0700791 }
gyzhouad7cad82017-05-11 16:10:03 -0700792 deps = [
Mirko Bonadei2ff3f492018-11-22 09:00:13 +0100793 "../api:create_peerconnection_factory",
Mirko Bonadei34814c72018-01-11 10:13:56 +0100794 "../api:libjingle_peerconnection_api",
Niels Möllere942b142019-09-17 14:30:41 +0200795 "../api:media_stream_interface",
Qiang Chen51e20462017-12-05 11:11:21 -0800796 "../api/audio_codecs:builtin_audio_decoder_factory",
797 "../api/audio_codecs:builtin_audio_encoder_factory",
Niels Möllerc6ce9c52018-05-11 11:15:30 +0200798 "../api/video:video_frame",
Chen Xing5d24b162019-06-10 12:59:38 +0200799 "../api/video:video_rtp_headers",
Mirko Bonadei75baa492018-01-11 17:07:30 +0100800 "../media:rtc_audio_video",
Anders Carlssona114c882018-01-04 15:10:22 +0100801 "../media:rtc_internal_video_codecs",
jianjun.zhuc0247402017-07-11 06:20:45 -0700802 "../media:rtc_media",
803 "../media:rtc_media_base",
Artem Titov94b57c02019-03-21 13:35:10 +0100804 "../modules/audio_device",
805 "../modules/audio_processing",
Alessio Bazzicab768e882018-11-07 14:29:54 +0000806 "../modules/audio_processing:api",
jianjun.zhuc0247402017-07-11 06:20:45 -0700807 "../modules/video_capture:video_capture_module",
808 "../pc:libjingle_peerconnection",
Niels Möller0a595352019-01-02 15:12:38 +0100809 "../pc:peerconnection",
Artem Titov94b57c02019-03-21 13:35:10 +0100810 "../rtc_base",
Kári Tristan Helgasonede7cb22019-03-06 10:34:09 +0100811 "../test:platform_video_capturer",
Niels Möller0a595352019-01-02 15:12:38 +0100812 "../test:video_test_common",
Karl Wiberg918f50c2018-07-05 11:40:33 +0200813 "//third_party/abseil-cpp/absl/memory",
gyzhouad7cad82017-05-11 16:10:03 -0700814 ]
qiangchen42f96d52017-08-08 17:08:03 -0700815 if (is_android) {
George Zhou2770c3d2018-03-07 09:58:54 -0800816 deps += [
Artem Titov94b57c02019-03-21 13:35:10 +0100817 "../modules/utility",
George Zhou2770c3d2018-03-07 09:58:54 -0800818 "../sdk/android:libjingle_peerconnection_jni",
819 ]
qiangchen42f96d52017-08-08 17:08:03 -0700820 }
821 }
822}
823
824if (is_android) {
Mirko Bonadeifbb3b7d2017-11-07 15:36:33 +0000825 rtc_android_library("webrtc_unity_java") {
Mirko Bonadeiccbe95f2020-01-21 12:10:10 +0100826 sources = [ "unityplugin/java/src/org/webrtc/UnityUtility.java" ]
qiangchen42f96d52017-08-08 17:08:03 -0700827 deps = [
828 "../rtc_base:base_java",
Artem Titarenko69540f42018-12-10 12:30:46 +0100829 "../sdk/android:camera_java",
qiangchen42f96d52017-08-08 17:08:03 -0700830 "../sdk/android:libjingle_peerconnection_java",
Artem Titarenko69540f42018-12-10 12:30:46 +0100831 "../sdk/android:peerconnection_java",
832 "../sdk/android:video_java",
Peter Wen7bc331f2019-03-06 09:18:57 -0500833 "//third_party/android_deps:com_android_support_support_annotations_java",
qiangchen42f96d52017-08-08 17:08:03 -0700834 ]
835 }
836
837 dist_jar("libwebrtc_unity") {
838 _target_dir_name = get_label_info(":$target_name", "dir")
839 output = "${root_out_dir}/lib.java${_target_dir_name}/${target_name}.jar"
George Zhou2770c3d2018-03-07 09:58:54 -0800840 direct_deps_only = false
qiangchen42f96d52017-08-08 17:08:03 -0700841 use_interface_jars = false
George Zhou2770c3d2018-03-07 09:58:54 -0800842 use_unprocessed_jars = false
Oleh Prypin86021d92017-09-24 22:29:06 +0200843 requires_android = true
qiangchen42f96d52017-08-08 17:08:03 -0700844 deps = [
845 ":webrtc_unity_java",
qiangchen42f96d52017-08-08 17:08:03 -0700846 "../rtc_base:base_java",
847 "../sdk/android:libjingle_peerconnection_java",
848 "../sdk/android:libjingle_peerconnection_metrics_default_java",
Peter Wen7bc331f2019-03-06 09:18:57 -0500849 "//third_party/android_deps:com_android_support_support_annotations_java",
qiangchen42f96d52017-08-08 17:08:03 -0700850 ]
gyzhouad7cad82017-05-11 16:10:03 -0700851 }
Mirko Bonadei73aa2de2020-01-20 15:28:57 +0100852
853 junit_binary("android_examples_junit_tests") {
854 sources = [
855 "androidjunit/src/org/appspot/apprtc/BluetoothManagerTest.java",
856 "androidjunit/src/org/appspot/apprtc/DirectRTCClientTest.java",
857 "androidjunit/src/org/appspot/apprtc/TCPChannelClientTest.java",
858 ]
859
860 deps = [
861 ":AppRTCMobile_javalib",
862 "//base:base_java_test_support",
863 "//third_party/google-truth:google_truth_java",
864 ]
865
866 additional_jar_files = [ [
867 "../sdk/android/tests/resources/robolectric.properties",
868 "robolectric.properties",
869 ] ]
870 }
gyzhouad7cad82017-05-11 16:10:03 -0700871}
872
charujainaca3a242016-11-01 03:09:15 -0700873if (!build_with_chromium) {
874 # Doesn't build within Chrome on Win.
875 rtc_executable("stun_prober") {
kjellander1993b1d2017-03-06 00:29:21 -0800876 testonly = true
Mirko Bonadeiccbe95f2020-01-21 12:10:10 +0100877 sources = [ "stunprober/main.cc" ]
charujainaca3a242016-11-01 03:09:15 -0700878 deps = [
879 "../p2p:libstunprober",
880 "../p2p:rtc_p2p",
Artem Titov94b57c02019-03-21 13:35:10 +0100881 "../rtc_base",
Patrik Höglunda8005cf2017-12-13 16:05:42 +0100882 "../rtc_base:checks",
ehmaldonadof6a861a2017-07-19 10:40:47 -0700883 "../rtc_base:rtc_base_approved",
Mirko Bonadei0be40bf2019-07-16 18:40:05 +0200884 "//third_party/abseil-cpp/absl/flags:flag",
885 "//third_party/abseil-cpp/absl/flags:parse",
charujainaca3a242016-11-01 03:09:15 -0700886 ]
887 }
888}