blob: f33ec4dad62bcc7bb8339839f5b5e5281b035edc [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",
50 ":relayserver",
51 ":stunserver",
52 ":turnserver",
53 ]
Robin Raymondce1b1402018-11-22 20:10:11 -050054 if (current_os != "winuwp") {
55 deps += [ ":peerconnection_client" ]
56 }
kthelgason0727f152016-08-08 09:03:23 -070057 }
George Zhou2770c3d2018-03-07 09:58:54 -080058
59 if (is_android || is_win) {
60 deps += [ ":webrtc_unity_plugin" ]
61 }
Sami Kalliomaki9c0c75b2016-06-29 14:55:00 +020062}
63
Niels Möller9862c2e2018-10-30 12:20:03 +010064rtc_source_set("read_auth_file") {
65 testonly = true
66 sources = [
67 "turnserver/read_auth_file.cc",
68 "turnserver/read_auth_file.h",
69 ]
70 deps = [
Artem Titov94b57c02019-03-21 13:35:10 +010071 "../rtc_base",
Niels Möller9862c2e2018-10-30 12:20:03 +010072 ]
73}
74
75if (rtc_include_tests) {
76 rtc_test("examples_unittests") {
77 testonly = true
78 sources = [
79 "turnserver/read_auth_file_unittest.cc",
80 ]
81 deps = [
82 ":read_auth_file",
83 "../test:test_main",
84 "//test:test_support",
85 "//testing/gtest",
86 ]
87 }
88}
89
tkchin2ddfdba2016-08-07 21:37:45 -070090if (is_android) {
Mirko Bonadeifbb3b7d2017-11-07 15:36:33 +000091 rtc_android_apk("AppRTCMobile") {
kjellander1993b1d2017-03-06 00:29:21 -080092 testonly = true
Magnus Jedvertc1815cf2016-09-27 10:10:41 +020093 apk_name = "AppRTCMobile"
Sami Kalliomaki9c0c75b2016-06-29 14:55:00 +020094 android_manifest = "androidapp/AndroidManifest.xml"
95
96 deps = [
Magnus Jedvertc1815cf2016-09-27 10:10:41 +020097 ":AppRTCMobile_javalib",
98 ":AppRTCMobile_resources",
jianjun.zhuc0247402017-07-11 06:20:45 -070099 "../rtc_base:base_java",
Sami Kalliomaki9c0c75b2016-06-29 14:55:00 +0200100 ]
101
jianjun.zhuc0247402017-07-11 06:20:45 -0700102 shared_libraries = [ "../sdk/android:libjingle_peerconnection_so" ]
Sami Kalliomaki9c0c75b2016-06-29 14:55:00 +0200103 }
104
Mirko Bonadeifbb3b7d2017-11-07 15:36:33 +0000105 rtc_android_library("AppRTCMobile_javalib") {
kjellander1993b1d2017-03-06 00:29:21 -0800106 testonly = true
Mirko Bonadei4f024ef2018-01-04 13:12:03 +0100107 android_manifest_for_lint = "androidapp/AndroidManifest.xml"
sakal07a050f2017-02-13 05:58:27 -0800108
Sami Kalliomaki9c0c75b2016-06-29 14:55:00 +0200109 java_files = [
110 "androidapp/src/org/appspot/apprtc/AppRTCAudioManager.java",
henrikac3c2f312016-12-14 07:36:56 -0800111 "androidapp/src/org/appspot/apprtc/AppRTCBluetoothManager.java",
Sami Kalliomaki9c0c75b2016-06-29 14:55:00 +0200112 "androidapp/src/org/appspot/apprtc/AppRTCClient.java",
113 "androidapp/src/org/appspot/apprtc/AppRTCProximitySensor.java",
114 "androidapp/src/org/appspot/apprtc/CallActivity.java",
115 "androidapp/src/org/appspot/apprtc/CallFragment.java",
116 "androidapp/src/org/appspot/apprtc/CaptureQualityController.java",
117 "androidapp/src/org/appspot/apprtc/ConnectActivity.java",
118 "androidapp/src/org/appspot/apprtc/CpuMonitor.java",
119 "androidapp/src/org/appspot/apprtc/DirectRTCClient.java",
120 "androidapp/src/org/appspot/apprtc/HudFragment.java",
121 "androidapp/src/org/appspot/apprtc/PeerConnectionClient.java",
Sami Kalliomaki9c0c75b2016-06-29 14:55:00 +0200122 "androidapp/src/org/appspot/apprtc/RoomParametersFetcher.java",
Qingsi Wanga4e72b72018-02-12 10:34:18 -0800123 "androidapp/src/org/appspot/apprtc/RtcEventLog.java",
henrika5641fbb2018-02-21 14:12:53 +0100124 "androidapp/src/org/appspot/apprtc/RecordedAudioToFileController.java",
Sami Kalliomaki9c0c75b2016-06-29 14:55:00 +0200125 "androidapp/src/org/appspot/apprtc/SettingsActivity.java",
126 "androidapp/src/org/appspot/apprtc/SettingsFragment.java",
127 "androidapp/src/org/appspot/apprtc/TCPChannelClient.java",
128 "androidapp/src/org/appspot/apprtc/UnhandledExceptionHandler.java",
129 "androidapp/src/org/appspot/apprtc/WebSocketChannelClient.java",
130 "androidapp/src/org/appspot/apprtc/WebSocketRTCClient.java",
131 "androidapp/src/org/appspot/apprtc/util/AppRTCUtils.java",
132 "androidapp/src/org/appspot/apprtc/util/AsyncHttpURLConnection.java",
Sami Kalliomaki9c0c75b2016-06-29 14:55:00 +0200133 ]
134
135 deps = [
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200136 ":AppRTCMobile_resources",
jianjun.zhuc0247402017-07-11 06:20:45 -0700137 "../rtc_base:base_java",
Sami Kalliomäki7d8f5942018-04-23 15:07:34 +0200138 "../sdk/android:audio_api_java",
Sami Kalliomäki725c1062018-03-28 10:49:18 +0200139 "../sdk/android:base_java",
Sami Kalliomäki1641ca32018-04-04 15:59:31 +0200140 "../sdk/android:camera_java",
Anders Carlsson1e06d882018-07-10 09:33:30 +0200141 "../sdk/android:default_video_codec_factory_java",
Sami Kalliomäki1641ca32018-04-04 15:59:31 +0200142 "../sdk/android:filevideo_java",
Sami Kalliomäki725c1062018-03-28 10:49:18 +0200143 "../sdk/android:hwcodecs_java",
Sami Kalliomäki7d8f5942018-04-23 15:07:34 +0200144 "../sdk/android:java_audio_device_module_java",
jianjun.zhuc0247402017-07-11 06:20:45 -0700145 "../sdk/android:libjingle_peerconnection_java",
146 "../sdk/android:libjingle_peerconnection_metrics_default_java",
Sami Kalliomäki1641ca32018-04-04 15:59:31 +0200147 "../sdk/android:peerconnection_java",
148 "../sdk/android:screencapturer_java",
149 "../sdk/android:surfaceviewrenderer_java",
Sami Kalliomäki725c1062018-03-28 10:49:18 +0200150 "../sdk/android:swcodecs_java",
Sami Kalliomäki1641ca32018-04-04 15:59:31 +0200151 "../sdk/android:video_api_java",
Sami Kalliomäki903bd412018-07-24 10:53:28 +0200152 "../sdk/android:video_java",
jianjun.zhuc0247402017-07-11 06:20:45 -0700153 "androidapp/third_party/autobanh:autobanh_java",
Peter Wen7bc331f2019-03-06 09:18:57 -0500154 "//third_party/android_deps:com_android_support_support_annotations_java",
Sami Kalliomaki9c0c75b2016-06-29 14:55:00 +0200155 ]
156 }
157
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200158 android_resources("AppRTCMobile_resources") {
kjellander1993b1d2017-03-06 00:29:21 -0800159 testonly = true
Sami Kalliomaki9c0c75b2016-06-29 14:55:00 +0200160 resource_dirs = [ "androidapp/res" ]
161 custom_package = "org.appspot.apprtc"
162 }
163
Sami Kalliomäkid54f5f52018-08-03 13:23:05 +0200164 rtc_instrumentation_test_apk("AppRTCMobile_test_apk") {
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200165 apk_name = "AppRTCMobileTest"
Sami Kalliomaki9c0c75b2016-06-29 14:55:00 +0200166 android_manifest = "androidtests/AndroidManifest.xml"
167
Patrik Höglunda8005cf2017-12-13 16:05:42 +0100168 java_files = [
169 "androidtests/src/org/appspot/apprtc/test/PeerConnectionClientTest.java",
170 ]
Sami Kalliomaki9c0c75b2016-06-29 14:55:00 +0200171
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200172 apk_under_test = ":AppRTCMobile"
Sami Kalliomaki9c0c75b2016-06-29 14:55:00 +0200173
174 deps = [
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200175 ":AppRTCMobile_javalib",
jianjun.zhuc0247402017-07-11 06:20:45 -0700176 "../sdk/android:libjingle_peerconnection_java",
Sami Kalliomäki903bd412018-07-24 10:53:28 +0200177 "../sdk/android:video_java",
sakalcb79d512017-01-11 06:21:26 -0800178 "//third_party/android_support_test_runner:runner_java",
179 "//third_party/junit",
Sami Kalliomaki9c0c75b2016-06-29 14:55:00 +0200180 ]
181 }
Sami Kalliomaki9c0c75b2016-06-29 14:55:00 +0200182}
tkchin2ddfdba2016-08-07 21:37:45 -0700183
184if (is_ios || (is_mac && target_cpu != "x86")) {
tkchin2ddfdba2016-08-07 21:37:45 -0700185 config("apprtc_common_config") {
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200186 include_dirs = [ "objc/AppRTCMobile/common" ]
tkchin2ddfdba2016-08-07 21:37:45 -0700187 }
188
kjellanderb62dbbe2016-09-23 00:38:52 -0700189 rtc_static_library("apprtc_common") {
kjellander1993b1d2017-03-06 00:29:21 -0800190 testonly = true
tkchin2ddfdba2016-08-07 21:37:45 -0700191 sources = [
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200192 "objc/AppRTCMobile/common/ARDUtilities.h",
193 "objc/AppRTCMobile/common/ARDUtilities.m",
tkchin2ddfdba2016-08-07 21:37:45 -0700194 ]
ehmaldonadoe9cc6862016-09-05 06:10:18 -0700195 public_configs = [ ":apprtc_common_config" ]
tkchin2ddfdba2016-08-07 21:37:45 -0700196
Kári Tristan Helgason946923a2017-06-02 14:05:56 +0200197 if (is_ios) {
Mirko Bonadeicbaaaed2018-02-19 15:14:04 +0100198 # iOS must use WebRTC.framework which is dynamically linked.
kthelgason5901d9d2017-08-16 07:28:03 -0700199 deps = [
Anders Carlsson7bca8ca2018-08-30 09:30:29 +0200200 "../sdk:framework_objc+link",
kthelgason5901d9d2017-08-16 07:28:03 -0700201 ]
Kári Tristan Helgason946923a2017-06-02 14:05:56 +0200202 } else {
kthelgason5901d9d2017-08-16 07:28:03 -0700203 deps = [
Anders Carlsson7bca8ca2018-08-30 09:30:29 +0200204 "../sdk:mac_framework_objc+link",
kthelgason5901d9d2017-08-16 07:28:03 -0700205 ]
Kári Tristan Helgason946923a2017-06-02 14:05:56 +0200206 }
tkchin2ddfdba2016-08-07 21:37:45 -0700207 }
208
209 config("apprtc_signaling_config") {
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200210 include_dirs = [ "objc/AppRTCMobile" ]
tkchin2ddfdba2016-08-07 21:37:45 -0700211 }
212
kjellanderb62dbbe2016-09-23 00:38:52 -0700213 rtc_static_library("apprtc_signaling") {
kjellander1993b1d2017-03-06 00:29:21 -0800214 testonly = true
tkchin2ddfdba2016-08-07 21:37:45 -0700215 sources = [
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200216 "objc/AppRTCMobile/ARDAppClient+Internal.h",
217 "objc/AppRTCMobile/ARDAppClient.h",
218 "objc/AppRTCMobile/ARDAppClient.m",
219 "objc/AppRTCMobile/ARDAppEngineClient.h",
220 "objc/AppRTCMobile/ARDAppEngineClient.m",
221 "objc/AppRTCMobile/ARDBitrateTracker.h",
222 "objc/AppRTCMobile/ARDBitrateTracker.m",
sakalc522e752017-04-05 12:17:48 -0700223 "objc/AppRTCMobile/ARDCaptureController.h",
224 "objc/AppRTCMobile/ARDCaptureController.m",
Anders Carlsson358f2e02018-06-04 10:24:37 +0200225 "objc/AppRTCMobile/ARDExternalSampleCapturer.h",
226 "objc/AppRTCMobile/ARDExternalSampleCapturer.m",
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200227 "objc/AppRTCMobile/ARDJoinResponse+Internal.h",
228 "objc/AppRTCMobile/ARDJoinResponse.h",
229 "objc/AppRTCMobile/ARDJoinResponse.m",
230 "objc/AppRTCMobile/ARDMessageResponse+Internal.h",
231 "objc/AppRTCMobile/ARDMessageResponse.h",
232 "objc/AppRTCMobile/ARDMessageResponse.m",
233 "objc/AppRTCMobile/ARDRoomServerClient.h",
sakalc4adacf2017-03-28 01:22:48 -0700234 "objc/AppRTCMobile/ARDSettingsModel+Private.h",
235 "objc/AppRTCMobile/ARDSettingsModel.h",
236 "objc/AppRTCMobile/ARDSettingsModel.m",
237 "objc/AppRTCMobile/ARDSettingsStore.h",
238 "objc/AppRTCMobile/ARDSettingsStore.m",
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200239 "objc/AppRTCMobile/ARDSignalingChannel.h",
240 "objc/AppRTCMobile/ARDSignalingMessage.h",
241 "objc/AppRTCMobile/ARDSignalingMessage.m",
242 "objc/AppRTCMobile/ARDStatsBuilder.h",
243 "objc/AppRTCMobile/ARDStatsBuilder.m",
kthelgasoncc882af2017-01-13 05:59:46 -0800244 "objc/AppRTCMobile/ARDTURNClient+Internal.h",
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200245 "objc/AppRTCMobile/ARDTURNClient.h",
kthelgasoncc882af2017-01-13 05:59:46 -0800246 "objc/AppRTCMobile/ARDTURNClient.m",
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200247 "objc/AppRTCMobile/ARDWebSocketChannel.h",
248 "objc/AppRTCMobile/ARDWebSocketChannel.m",
249 "objc/AppRTCMobile/RTCIceCandidate+JSON.h",
250 "objc/AppRTCMobile/RTCIceCandidate+JSON.m",
251 "objc/AppRTCMobile/RTCIceServer+JSON.h",
252 "objc/AppRTCMobile/RTCIceServer+JSON.m",
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200253 "objc/AppRTCMobile/RTCSessionDescription+JSON.h",
254 "objc/AppRTCMobile/RTCSessionDescription+JSON.m",
tkchin2ddfdba2016-08-07 21:37:45 -0700255 ]
ehmaldonadoe9cc6862016-09-05 06:10:18 -0700256 public_configs = [ ":apprtc_signaling_config" ]
tkchin2ddfdba2016-08-07 21:37:45 -0700257 deps = [
258 ":apprtc_common",
259 ":socketrocket",
260 ]
Kári Tristan Helgason8a1e35c2019-03-07 10:44:26 +0100261
Kári Tristan Helgason946923a2017-06-02 14:05:56 +0200262 if (is_ios) {
Mirko Bonadeicbaaaed2018-02-19 15:14:04 +0100263 # iOS must use WebRTC.framework which is dynamically linked.
Mirko Bonadei1a339c32017-12-14 13:06:10 +0100264 deps += [
Anders Carlsson7bca8ca2018-08-30 09:30:29 +0200265 "../sdk:framework_objc+link",
266 "../sdk:ios_framework_bundle",
Kári Tristan Helgason946923a2017-06-02 14:05:56 +0200267 ]
Mirko Bonadei1a339c32017-12-14 13:06:10 +0100268 } else {
Anders Carlsson7bca8ca2018-08-30 09:30:29 +0200269 deps += [ "../sdk:mac_framework_objc+link" ]
Kári Tristan Helgason946923a2017-06-02 14:05:56 +0200270 }
Kári Tristan Helgason8a1e35c2019-03-07 10:44:26 +0100271 libs = [
272 "CoreMedia.framework",
273 "QuartzCore.framework",
274 ]
tkchin2ddfdba2016-08-07 21:37:45 -0700275 }
276
277 if (is_ios) {
denicija77bfd7c2016-11-15 00:41:26 -0800278 rtc_static_library("AppRTCMobile_lib") {
Mirko Bonadeicbaaaed2018-02-19 15:14:04 +0100279 # iOS must use WebRTC.framework which is dynamically linked.
kjellander1993b1d2017-03-06 00:29:21 -0800280 testonly = true
tkchin2ddfdba2016-08-07 21:37:45 -0700281 sources = [
Patrik Höglund49acb1e2018-01-02 14:41:54 +0100282 "objc/AppRTCMobile/ios/ARDAppDelegate.h",
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200283 "objc/AppRTCMobile/ios/ARDAppDelegate.m",
Daniela012b56b2017-11-15 13:15:24 +0100284 "objc/AppRTCMobile/ios/ARDFileCaptureController.h",
285 "objc/AppRTCMobile/ios/ARDFileCaptureController.m",
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200286 "objc/AppRTCMobile/ios/ARDMainView.h",
287 "objc/AppRTCMobile/ios/ARDMainView.m",
288 "objc/AppRTCMobile/ios/ARDMainViewController.h",
289 "objc/AppRTCMobile/ios/ARDMainViewController.m",
denicijad17d5362016-11-02 02:56:09 -0700290 "objc/AppRTCMobile/ios/ARDSettingsViewController.h",
291 "objc/AppRTCMobile/ios/ARDSettingsViewController.m",
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200292 "objc/AppRTCMobile/ios/ARDStatsView.h",
293 "objc/AppRTCMobile/ios/ARDStatsView.m",
294 "objc/AppRTCMobile/ios/ARDVideoCallView.h",
295 "objc/AppRTCMobile/ios/ARDVideoCallView.m",
296 "objc/AppRTCMobile/ios/ARDVideoCallViewController.h",
297 "objc/AppRTCMobile/ios/ARDVideoCallViewController.m",
Anders Carlsson6bf43d22017-10-16 13:51:43 +0200298 "objc/AppRTCMobile/ios/RTCVideoCodecInfo+HumanReadable.h",
299 "objc/AppRTCMobile/ios/RTCVideoCodecInfo+HumanReadable.m",
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200300 "objc/AppRTCMobile/ios/UIImage+ARDUtilities.h",
301 "objc/AppRTCMobile/ios/UIImage+ARDUtilities.m",
denicija77bfd7c2016-11-15 00:41:26 -0800302 ]
denicija77bfd7c2016-11-15 00:41:26 -0800303
Anders Carlsson96fccfe2019-02-21 16:11:40 +0100304 configs += [ "..:common_objc" ]
305
denicija77bfd7c2016-11-15 00:41:26 -0800306 deps = [
307 ":apprtc_common",
308 ":apprtc_signaling",
Anders Carlsson7bca8ca2018-08-30 09:30:29 +0200309 "../sdk:framework_objc+link",
310 "../sdk:ios_framework_bundle",
denicija77bfd7c2016-11-15 00:41:26 -0800311 ]
Kári Tristan Helgason8a1e35c2019-03-07 10:44:26 +0100312
313 libs = [ "AVFoundation.framework" ]
denicija77bfd7c2016-11-15 00:41:26 -0800314 }
315
316 ios_app_bundle("AppRTCMobile") {
kjellander1993b1d2017-03-06 00:29:21 -0800317 testonly = true
denicija77bfd7c2016-11-15 00:41:26 -0800318 sources = [
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200319 "objc/AppRTCMobile/ios/main.m",
tkchin2ddfdba2016-08-07 21:37:45 -0700320 ]
321
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200322 info_plist = "objc/AppRTCMobile/ios/Info.plist"
tkchin2ddfdba2016-08-07 21:37:45 -0700323
denicija77bfd7c2016-11-15 00:41:26 -0800324 configs += [ "..:common_config" ]
tkchin2ddfdba2016-08-07 21:37:45 -0700325 public_configs = [ "..:common_inherited_config" ]
326
327 deps = [
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200328 ":AppRTCMobile_ios_bundle_data",
denicija77bfd7c2016-11-15 00:41:26 -0800329 ":AppRTCMobile_lib",
Mirko Bonadei1a339c32017-12-14 13:06:10 +0100330 "../sdk:framework_objc",
Anders Carlsson7bca8ca2018-08-30 09:30:29 +0200331 "../sdk:ios_framework_bundle",
tkchin2ddfdba2016-08-07 21:37:45 -0700332 ]
333
Anders Carlsson358f2e02018-06-04 10:24:37 +0200334 if (rtc_apprtcmobile_broadcast_extension) {
335 deps += [
336 ":AppRTCMobileBroadcastSetupUI_extension_bundle",
337 ":AppRTCMobileBroadcastUpload_extension_bundle",
338 ]
339 }
340
tkchin2ddfdba2016-08-07 21:37:45 -0700341 if (target_cpu == "x86") {
Artem Titov94b57c02019-03-21 13:35:10 +0100342 deps += [ "//testing/iossim" ]
tkchin2ddfdba2016-08-07 21:37:45 -0700343 }
344 }
345
Anders Carlsson358f2e02018-06-04 10:24:37 +0200346 if (rtc_apprtcmobile_broadcast_extension) {
347 bundle_data("AppRTCMobileBroadcastUpload_extension_bundle") {
348 testonly = true
349 public_deps = [
350 ":AppRTCMobileBroadcastUpload",
351 ]
352 sources = [
353 "$root_out_dir/AppRTCMobileBroadcastUpload.appex",
354 ]
355 outputs = [
Kári Tristan Helgason5d54f1f2019-04-23 14:24:01 +0200356 "{{bundle_contents_dir}}/Plugins/{{source_file_part}}",
Anders Carlsson358f2e02018-06-04 10:24:37 +0200357 ]
358 }
359
360 bundle_data("AppRTCMobileBroadcastSetupUI_extension_bundle") {
361 testonly = true
362 public_deps = [
363 ":AppRTCMobileBroadcastSetupUI",
364 ]
365 sources = [
366 "$root_out_dir/AppRTCMobileBroadcastSetupUI.appex",
367 ]
368 outputs = [
Kári Tristan Helgason5d54f1f2019-04-23 14:24:01 +0200369 "{{bundle_contents_dir}}/Plugins/{{source_file_part}}",
Anders Carlsson358f2e02018-06-04 10:24:37 +0200370 ]
371 }
372
373 rtc_static_library("AppRTCMobileBroadcastUpload_lib") {
Anders Carlsson358f2e02018-06-04 10:24:37 +0200374 testonly = true
375 sources = [
376 "objc/AppRTCMobile/ios/broadcast_extension/ARDBroadcastSampleHandler.h",
377 "objc/AppRTCMobile/ios/broadcast_extension/ARDBroadcastSampleHandler.m",
378 ]
379
380 deps = [
Anders Carlsson358f2e02018-06-04 10:24:37 +0200381 ":apprtc_signaling",
Anders Carlsson7bca8ca2018-08-30 09:30:29 +0200382 "../sdk:framework_objc+link",
383 "../sdk:ios_framework_bundle",
Anders Carlsson358f2e02018-06-04 10:24:37 +0200384 ]
385
386 libs = [ "ReplayKit.framework" ]
387 }
388
389 ios_appex_bundle("AppRTCMobileBroadcastUpload") {
390 testonly = true
391 configs += [ "..:common_config" ]
392 public_configs = [ "..:common_inherited_config" ]
393
394 info_plist = "objc/AppRTCMobile/ios/broadcast_extension/BroadcastUploadInfo.plist"
395
396 deps = [
397 ":AppRTCMobileBroadcastUpload_lib",
398 "../sdk:framework_objc",
399 ]
400 }
401
402 ios_appex_bundle("AppRTCMobileBroadcastSetupUI") {
403 sources = [
404 "objc/AppRTCMobile/ios/broadcast_extension/ARDBroadcastSetupViewController.h",
405 "objc/AppRTCMobile/ios/broadcast_extension/ARDBroadcastSetupViewController.m",
406 ]
407
408 info_plist = "objc/AppRTCMobile/ios/broadcast_extension/BroadcastSetupUIInfo.plist"
409
410 libs = [ "ReplayKit.framework" ]
411
412 deps = [
413 ":AppRTCMobile_ios_bundle_data",
414 ]
415 }
416 }
417
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200418 bundle_data("AppRTCMobile_ios_bundle_data") {
tkchin2ddfdba2016-08-07 21:37:45 -0700419 sources = [
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200420 "objc/AppRTCMobile/ios/resources/Roboto-Regular.ttf",
Daniela012b56b2017-11-15 13:15:24 +0100421
422 # Sample video taken from https://media.xiph.org/video/derf/
423 "objc/AppRTCMobile/ios/resources/foreman.mp4",
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200424 "objc/AppRTCMobile/ios/resources/iPhone5@2x.png",
425 "objc/AppRTCMobile/ios/resources/iPhone6@2x.png",
426 "objc/AppRTCMobile/ios/resources/iPhone6p@3x.png",
427 "objc/AppRTCMobile/ios/resources/ic_call_end_black_24dp.png",
428 "objc/AppRTCMobile/ios/resources/ic_call_end_black_24dp@2x.png",
429 "objc/AppRTCMobile/ios/resources/ic_clear_black_24dp.png",
430 "objc/AppRTCMobile/ios/resources/ic_clear_black_24dp@2x.png",
denicija6d6762c2016-10-28 04:53:16 -0700431 "objc/AppRTCMobile/ios/resources/ic_settings_black_24dp.png",
432 "objc/AppRTCMobile/ios/resources/ic_settings_black_24dp@2x.png",
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200433 "objc/AppRTCMobile/ios/resources/ic_surround_sound_black_24dp.png",
434 "objc/AppRTCMobile/ios/resources/ic_surround_sound_black_24dp@2x.png",
435 "objc/AppRTCMobile/ios/resources/ic_switch_video_black_24dp.png",
436 "objc/AppRTCMobile/ios/resources/ic_switch_video_black_24dp@2x.png",
437 "objc/AppRTCMobile/ios/resources/mozart.mp3",
anderscb5ed9052017-08-15 04:07:12 -0700438 "objc/Icon-120.png",
439 "objc/Icon-180.png",
tkchin2ddfdba2016-08-07 21:37:45 -0700440 "objc/Icon.png",
441 ]
442 outputs = [
443 "{{bundle_resources_dir}}/{{source_file_part}}",
444 ]
445 }
Anders Carlsson73119182018-03-15 09:41:03 +0100446
447 rtc_static_library("ObjCNativeAPIDemo_lib") {
448 testonly = true
449 sources = [
450 "objcnativeapi/objc/NADAppDelegate.h",
451 "objcnativeapi/objc/NADAppDelegate.m",
452 "objcnativeapi/objc/NADViewController.h",
453 "objcnativeapi/objc/NADViewController.mm",
Steve Anton10542f22019-01-11 09:11:00 -0800454 "objcnativeapi/objc/objc_call_client.h",
455 "objcnativeapi/objc/objc_call_client.mm",
Anders Carlsson73119182018-03-15 09:41:03 +0100456 ]
457
Anders Carlsson73119182018-03-15 09:41:03 +0100458 deps = [
459 "../api:libjingle_peerconnection_api",
Mirko Bonadeid9708072019-01-25 20:26:48 +0100460 "../api:scoped_refptr",
Anders Carlsson73119182018-03-15 09:41:03 +0100461 "../api/audio_codecs:builtin_audio_decoder_factory",
462 "../api/audio_codecs:builtin_audio_encoder_factory",
Danil Chapovalovaaa11432019-05-17 13:20:14 +0200463 "../api/task_queue:default_task_queue_factory",
Anders Carlsson73119182018-03-15 09:41:03 +0100464 "../logging:rtc_event_log_impl_base",
465 "../media:rtc_audio_video",
Artem Titov94b57c02019-03-21 13:35:10 +0100466 "../modules/audio_processing",
Alessio Bazzicab768e882018-11-07 14:29:54 +0000467 "../modules/audio_processing:api",
Anders Carlsson73119182018-03-15 09:41:03 +0100468 "../pc:libjingle_peerconnection",
Artem Titov94b57c02019-03-21 13:35:10 +0100469 "../rtc_base",
Anders Carlsson7bca8ca2018-08-30 09:30:29 +0200470 "../sdk:base_objc",
Anders Carlsson73119182018-03-15 09:41:03 +0100471 "../sdk:default_codec_factory_objc",
Anders Carlsson7bca8ca2018-08-30 09:30:29 +0200472 "../sdk:helpers_objc",
Anders Carlsson73119182018-03-15 09:41:03 +0100473 "../sdk:native_api",
474 "../sdk:ui_objc",
Anders Carlsson7bca8ca2018-08-30 09:30:29 +0200475 "../sdk:videocapture_objc",
Anders Carlsson73119182018-03-15 09:41:03 +0100476 "../sdk:videotoolbox_objc",
Mirko Bonadei879f7882018-07-11 09:18:37 +0200477 "//third_party/abseil-cpp/absl/memory",
Anders Carlsson73119182018-03-15 09:41:03 +0100478 ]
479
480 if (current_cpu == "arm64") {
481 deps += [ "../sdk:metal_objc" ]
482 }
483 }
484
485 ios_app_bundle("ObjCNativeAPIDemo") {
486 testonly = true
487 sources = [
488 "objcnativeapi/objc/main.m",
489 ]
490
491 info_plist = "objcnativeapi/Info.plist"
492
493 configs += [ "..:common_config" ]
494 public_configs = [ "..:common_inherited_config" ]
495
496 deps = [
497 ":ObjCNativeAPIDemo_lib",
498 ]
499
500 if (target_cpu == "x86") {
Artem Titov94b57c02019-03-21 13:35:10 +0100501 deps += [ "//testing/iossim" ]
Anders Carlsson73119182018-03-15 09:41:03 +0100502 }
503 }
tkchin2ddfdba2016-08-07 21:37:45 -0700504 }
505
506 if (is_mac) {
denicija77bfd7c2016-11-15 00:41:26 -0800507 rtc_static_library("AppRTCMobile_lib") {
kjellander1993b1d2017-03-06 00:29:21 -0800508 testonly = true
tkchin2ddfdba2016-08-07 21:37:45 -0700509 sources = [
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200510 "objc/AppRTCMobile/mac/APPRTCAppDelegate.h",
511 "objc/AppRTCMobile/mac/APPRTCAppDelegate.m",
512 "objc/AppRTCMobile/mac/APPRTCViewController.h",
513 "objc/AppRTCMobile/mac/APPRTCViewController.m",
tkchin2ddfdba2016-08-07 21:37:45 -0700514 ]
jianjun.zhuc0247402017-07-11 06:20:45 -0700515 configs += [ "..:common_objc" ]
tkchin2ddfdba2016-08-07 21:37:45 -0700516 deps = [
517 ":apprtc_common",
518 ":apprtc_signaling",
Anders Carlsson7bca8ca2018-08-30 09:30:29 +0200519 "../sdk:mac_framework_objc+link",
tkchin2ddfdba2016-08-07 21:37:45 -0700520 ]
521 }
522
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200523 mac_app_bundle("AppRTCMobile") {
kjellander1993b1d2017-03-06 00:29:21 -0800524 testonly = true
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200525 output_name = "AppRTCMobile"
tkchin2ddfdba2016-08-07 21:37:45 -0700526
tkchin2ddfdba2016-08-07 21:37:45 -0700527 sources = [
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200528 "objc/AppRTCMobile/mac/main.m",
tkchin2ddfdba2016-08-07 21:37:45 -0700529 ]
530
531 public_configs = [ "..:common_inherited_config" ]
532
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200533 info_plist = "objc/AppRTCMobile/mac/Info.plist"
tkchin2ddfdba2016-08-07 21:37:45 -0700534
535 libs = [ "AppKit.framework" ]
536
Anders Carlsson24d8ec32018-12-10 14:04:12 +0100537 ldflags = [
538 "-rpath",
539 "@executable_path/../Frameworks",
540 ]
541
tkchin2ddfdba2016-08-07 21:37:45 -0700542 deps = [
denicija77bfd7c2016-11-15 00:41:26 -0800543 ":AppRTCMobile_lib",
Anders Carlsson7bca8ca2018-08-30 09:30:29 +0200544 "../sdk:mac_framework_bundle",
545 "../sdk:mac_framework_objc+link",
tkchin2ddfdba2016-08-07 21:37:45 -0700546 ]
547 }
548 }
549
550 config("socketrocket_include_config") {
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200551 include_dirs = [ "objc/AppRTCMobile/third_party/SocketRocket" ]
tkchin2ddfdba2016-08-07 21:37:45 -0700552 }
553
554 config("socketrocket_warning_config") {
555 # GN orders flags on a target before flags from configs. The default config
556 # adds these flags so to cancel them out they need to come from a config and
557 # cannot be on the target directly.
558 cflags = [
559 "-Wno-deprecated-declarations",
560 "-Wno-nonnull",
tkchin2ddfdba2016-08-07 21:37:45 -0700561 "-Wno-semicolon-before-method-body",
kthelgasone47de1a2017-02-24 01:56:01 -0800562 "-Wno-unused-variable",
tkchin2ddfdba2016-08-07 21:37:45 -0700563 ]
564
henrika27d8b612016-09-21 04:13:00 -0700565 cflags_objc = [
566 # Enabled for cflags_objc in build/config/compiler/BUILD.gn.
567 "-Wno-objc-missing-property-synthesis",
henrika27d8b612016-09-21 04:13:00 -0700568 ]
tkchin2ddfdba2016-08-07 21:37:45 -0700569 }
570
kjellanderb62dbbe2016-09-23 00:38:52 -0700571 rtc_static_library("socketrocket") {
kjellander1993b1d2017-03-06 00:29:21 -0800572 testonly = true
tkchin2ddfdba2016-08-07 21:37:45 -0700573 sources = [
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200574 "objc/AppRTCMobile/third_party/SocketRocket/SRWebSocket.h",
575 "objc/AppRTCMobile/third_party/SocketRocket/SRWebSocket.m",
tkchin2ddfdba2016-08-07 21:37:45 -0700576 ]
kthelgasonc0977102017-04-24 00:57:16 -0700577 configs += [ ":socketrocket_warning_config" ]
ehmaldonadoe9cc6862016-09-05 06:10:18 -0700578 public_configs = [ ":socketrocket_include_config" ]
tkchin2ddfdba2016-08-07 21:37:45 -0700579
580 libs = [
581 "CFNetwork.framework",
582 "icucore",
583 ]
584 }
adam.fedorbcc5d872016-11-07 14:53:28 -0800585
586 if (rtc_include_tests) {
kthelgason4065a572017-02-14 04:58:56 -0800587 # TODO(kthelgason): compile xctests on mac when chromium supports it.
588 if (is_ios) {
589 rtc_source_set("apprtcmobile_test_sources") {
Mirko Bonadeicbaaaed2018-02-19 15:14:04 +0100590 # iOS must use WebRTC.framework which is dynamically linked.
kjellander1993b1d2017-03-06 00:29:21 -0800591 testonly = true
kthelgason4065a572017-02-14 04:58:56 -0800592 include_dirs = [
593 "objc/AppRTCMobile",
594 "objc/AppRTCMobile/ios",
595 ]
kthelgason4065a572017-02-14 04:58:56 -0800596 sources = [
597 "objc/AppRTCMobile/tests/ARDAppClient_xctest.mm",
Daniela012b56b2017-11-15 13:15:24 +0100598 "objc/AppRTCMobile/tests/ARDFileCaptureController_xctest.mm",
kthelgason4065a572017-02-14 04:58:56 -0800599 "objc/AppRTCMobile/tests/ARDSettingsModel_xctest.mm",
600 ]
kjellander1993b1d2017-03-06 00:29:21 -0800601 deps = [
kthelgason4065a572017-02-14 04:58:56 -0800602 ":AppRTCMobile_lib",
Mirko Bonadeicbaaaed2018-02-19 15:14:04 +0100603 ":apprtc_signaling",
Artem Titov94b57c02019-03-21 13:35:10 +0100604 "../rtc_base",
Anders Carlsson7bca8ca2018-08-30 09:30:29 +0200605 "../sdk:framework_objc+link",
606 "../sdk:ios_framework_bundle",
kthelgason4065a572017-02-14 04:58:56 -0800607 "//build/config/ios:xctest",
608 "//third_party/ocmock",
609 ]
adam.fedorbcc5d872016-11-07 14:53:28 -0800610 }
611
kthelgason4065a572017-02-14 04:58:56 -0800612 rtc_ios_xctest_test("apprtcmobile_tests") {
613 info_plist = "objc/AppRTCMobile/ios/Info.plist"
614 sources = [
Artem Titarenko34fc3462018-11-06 12:29:29 +0100615 "objc/AppRTCMobile/tests/main.mm",
kthelgason4065a572017-02-14 04:58:56 -0800616 ]
617 deps = [
Mirko Bonadeicbaaaed2018-02-19 15:14:04 +0100618 ":AppRTCMobile_lib",
kthelgason4065a572017-02-14 04:58:56 -0800619 ":apprtcmobile_test_sources",
Mirko Bonadei1a339c32017-12-14 13:06:10 +0100620 "../sdk:framework_objc",
Artem Titarenko34fc3462018-11-06 12:29:29 +0100621 "//test:test_support",
kthelgason4065a572017-02-14 04:58:56 -0800622 ]
623 ldflags = [ "-all_load" ]
624 }
adam.fedorbcc5d872016-11-07 14:53:28 -0800625 }
626 }
tkchin2ddfdba2016-08-07 21:37:45 -0700627}
kthelgason0727f152016-08-08 09:03:23 -0700628
629if (is_linux || is_win) {
ehmaldonado38a21322016-09-02 04:10:34 -0700630 rtc_executable("peerconnection_client") {
kjellander1993b1d2017-03-06 00:29:21 -0800631 testonly = true
kthelgason0727f152016-08-08 09:03:23 -0700632 sources = [
633 "peerconnection/client/conductor.cc",
634 "peerconnection/client/conductor.h",
635 "peerconnection/client/defaults.cc",
636 "peerconnection/client/defaults.h",
637 "peerconnection/client/peer_connection_client.cc",
638 "peerconnection/client/peer_connection_client.h",
639 ]
ehmaldonado7a2ce0b2016-09-05 01:35:44 -0700640
Patrik Höglundb5b5bce2017-11-13 10:19:58 +0100641 deps = [
Yves Gerey3e707812018-11-28 16:47:49 +0100642 "../api:audio_options_api",
Mirko Bonadei2ff3f492018-11-22 09:00:13 +0100643 "../api:create_peerconnection_factory",
Mirko Bonadei34814c72018-01-11 10:13:56 +0100644 "../api:libjingle_peerconnection_api",
Mirko Bonadeid9708072019-01-25 20:26:48 +0100645 "../api:scoped_refptr",
Yves Gerey3e707812018-11-28 16:47:49 +0100646 "../api/audio:audio_mixer_api",
647 "../api/audio_codecs:audio_codecs_api",
Niels Möllerc6ce9c52018-05-11 11:15:30 +0200648 "../api/video:video_frame_i420",
Chen Xing5d24b162019-06-10 12:59:38 +0200649 "../api/video:video_rtp_headers",
Yves Gerey3e707812018-11-28 16:47:49 +0100650 "../api/video_codecs:video_codecs_api",
651 "../media:rtc_media_base",
652 "../p2p:rtc_p2p",
Patrik Höglunda8005cf2017-12-13 16:05:42 +0100653 "../rtc_base:checks",
Artem Titove41c4332018-07-25 15:04:28 +0200654 "../rtc_base/third_party/sigslot",
Bjorn Terelius3e676762018-10-29 15:26:27 +0100655 "../system_wrappers:field_trial",
656 "../test:field_trial",
Kári Tristan Helgasonede7cb22019-03-06 10:34:09 +0100657 "../test:platform_video_capturer",
Niels Möllerb76be9a2018-12-20 16:28:23 +0100658 "//third_party/abseil-cpp/absl/memory",
Yves Gerey3e707812018-11-28 16:47:49 +0100659 "//third_party/abseil-cpp/absl/types:optional",
Patrik Höglundb5b5bce2017-11-13 10:19:58 +0100660 ]
kthelgason0727f152016-08-08 09:03:23 -0700661 if (is_win) {
662 sources += [
Steve Anton10542f22019-01-11 09:11:00 -0800663 "peerconnection/client/flag_defs.h",
kthelgason0727f152016-08-08 09:03:23 -0700664 "peerconnection/client/main.cc",
665 "peerconnection/client/main_wnd.cc",
666 "peerconnection/client/main_wnd.h",
667 ]
kthelgason0727f152016-08-08 09:03:23 -0700668 configs += [ "//build/config/win:windowed" ]
jianjun.zhuc0247402017-07-11 06:20:45 -0700669 deps += [ "../media:rtc_media_base" ]
kthelgason0727f152016-08-08 09:03:23 -0700670 }
671 if (is_linux) {
672 sources += [
673 "peerconnection/client/linux/main.cc",
674 "peerconnection/client/linux/main_wnd.cc",
675 "peerconnection/client/linux/main_wnd.h",
676 ]
Henrik Kjellanderefbde2c2017-03-27 08:28:27 +0200677 cflags = [ "-Wno-deprecated-declarations" ]
kthelgason0727f152016-08-08 09:03:23 -0700678 libs = [
679 "X11",
680 "Xcomposite",
681 "Xext",
682 "Xrender",
683 ]
thomasandersonef16e992016-12-13 02:57:43 -0800684 deps += [ "//build/config/linux/gtk" ]
kthelgason0727f152016-08-08 09:03:23 -0700685 }
kjellander1993b1d2017-03-06 00:29:21 -0800686
687 deps += [
Niels Möller8366e172018-02-14 12:20:13 +0100688 "../api:libjingle_peerconnection_api",
Karl Wiberg1b0eae32017-10-17 14:48:54 +0200689 "../api/audio_codecs:builtin_audio_decoder_factory",
690 "../api/audio_codecs:builtin_audio_encoder_factory",
Niels Möllerc6ce9c52018-05-11 11:15:30 +0200691 "../api/video:video_frame",
Chen Xing5d24b162019-06-10 12:59:38 +0200692 "../api/video:video_rtp_headers",
Anders Carlsson67537952018-05-03 11:28:29 +0200693 "../api/video_codecs:builtin_video_decoder_factory",
694 "../api/video_codecs:builtin_video_encoder_factory",
Mirko Bonadei75baa492018-01-11 17:07:30 +0100695 "../media:rtc_audio_video",
Artem Titov94b57c02019-03-21 13:35:10 +0100696 "../modules/audio_device",
697 "../modules/audio_processing",
Alessio Bazzicab768e882018-11-07 14:29:54 +0000698 "../modules/audio_processing:api",
jianjun.zhuc0247402017-07-11 06:20:45 -0700699 "../modules/video_capture:video_capture_module",
700 "../pc:libjingle_peerconnection",
Niels Möllerb76be9a2018-12-20 16:28:23 +0100701 "../pc:peerconnection",
Artem Titov94b57c02019-03-21 13:35:10 +0100702 "../rtc_base",
ehmaldonadof6a861a2017-07-19 10:40:47 -0700703 "../rtc_base:rtc_base_approved",
704 "../rtc_base:rtc_json",
Niels Möllerb76be9a2018-12-20 16:28:23 +0100705 "../test:video_test_common",
kjellander1993b1d2017-03-06 00:29:21 -0800706 "//third_party/libyuv",
kjellander1993b1d2017-03-06 00:29:21 -0800707 ]
kthelgason0727f152016-08-08 09:03:23 -0700708 }
kjellanderd4626e52016-09-07 02:33:01 -0700709
ehmaldonado38a21322016-09-02 04:10:34 -0700710 rtc_executable("peerconnection_server") {
kjellander1993b1d2017-03-06 00:29:21 -0800711 testonly = true
kthelgason0727f152016-08-08 09:03:23 -0700712 sources = [
713 "peerconnection/server/data_socket.cc",
714 "peerconnection/server/data_socket.h",
715 "peerconnection/server/main.cc",
716 "peerconnection/server/peer_channel.cc",
717 "peerconnection/server/peer_channel.h",
718 "peerconnection/server/utils.cc",
719 "peerconnection/server/utils.h",
720 ]
721 deps = [
ehmaldonadof6a861a2017-07-19 10:40:47 -0700722 "../rtc_base:rtc_base_approved",
jianjun.zhuc0247402017-07-11 06:20:45 -0700723 "../rtc_tools:command_line_parser",
Bjorn Terelius3e676762018-10-29 15:26:27 +0100724 "../system_wrappers:field_trial",
725 "../test:field_trial",
kthelgason0727f152016-08-08 09:03:23 -0700726 ]
kthelgason0727f152016-08-08 09:03:23 -0700727 }
ehmaldonado38a21322016-09-02 04:10:34 -0700728 rtc_executable("relayserver") {
kjellander1993b1d2017-03-06 00:29:21 -0800729 testonly = true
kthelgason0727f152016-08-08 09:03:23 -0700730 sources = [
731 "relayserver/relayserver_main.cc",
732 ]
733 deps = [
Niels Möllera1342042018-11-08 16:47:14 +0100734 "../p2p:p2p_server_utils",
jianjun.zhuc0247402017-07-11 06:20:45 -0700735 "../p2p:rtc_p2p",
736 "../pc:rtc_pc",
Artem Titov94b57c02019-03-21 13:35:10 +0100737 "../rtc_base",
ehmaldonadof6a861a2017-07-19 10:40:47 -0700738 "../rtc_base:rtc_base_approved",
kthelgason0727f152016-08-08 09:03:23 -0700739 ]
kthelgason0727f152016-08-08 09:03:23 -0700740 }
ehmaldonado38a21322016-09-02 04:10:34 -0700741 rtc_executable("turnserver") {
kjellander1993b1d2017-03-06 00:29:21 -0800742 testonly = true
kthelgason0727f152016-08-08 09:03:23 -0700743 sources = [
744 "turnserver/turnserver_main.cc",
745 ]
746 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
kthelgason0727f152016-08-08 09:03:23 -0700757 sources = [
758 "stunserver/stunserver_main.cc",
759 ]
760 deps = [
Niels Möllera1342042018-11-08 16:47:14 +0100761 "../p2p:p2p_server_utils",
jianjun.zhuc0247402017-07-11 06:20:45 -0700762 "../p2p:rtc_p2p",
763 "../pc:rtc_pc",
Artem Titov94b57c02019-03-21 13:35:10 +0100764 "../rtc_base",
ehmaldonadof6a861a2017-07-19 10:40:47 -0700765 "../rtc_base:rtc_base_approved",
kthelgason0727f152016-08-08 09:03:23 -0700766 ]
kthelgason0727f152016-08-08 09:03:23 -0700767 }
768}
charujainaca3a242016-11-01 03:09:15 -0700769
qiangchen42f96d52017-08-08 17:08:03 -0700770if (is_win || is_android) {
gyzhouad7cad82017-05-11 16:10:03 -0700771 rtc_shared_library("webrtc_unity_plugin") {
772 testonly = true
773 sources = [
774 "unityplugin/simple_peer_connection.cc",
775 "unityplugin/simple_peer_connection.h",
776 "unityplugin/unity_plugin_apis.cc",
777 "unityplugin/unity_plugin_apis.h",
gyzhoub38f3862017-07-25 16:04:31 -0700778 "unityplugin/video_observer.cc",
779 "unityplugin/video_observer.h",
gyzhouad7cad82017-05-11 16:10:03 -0700780 ]
qiangchen42f96d52017-08-08 17:08:03 -0700781
782 if (is_android) {
783 sources += [
Steve Anton10542f22019-01-11 09:11:00 -0800784 "unityplugin/class_reference_holder.cc",
785 "unityplugin/class_reference_holder.h",
qiangchen42f96d52017-08-08 17:08:03 -0700786 "unityplugin/jni_onload.cc",
787 ]
Qiang Chen43fb9122017-12-20 10:47:36 -0800788 suppressed_configs += [ "//build/config/android:hide_all_but_jni_onload" ]
qiangchen42f96d52017-08-08 17:08:03 -0700789 }
790
qiangchen42f96d52017-08-08 17:08:03 -0700791 if (is_win) {
Mirko Bonadeif957dd92018-07-11 10:47:42 +0200792 configs += [ "//build/config/win:windowed" ]
qiangchen42f96d52017-08-08 17:08:03 -0700793 }
gyzhouad7cad82017-05-11 16:10:03 -0700794 deps = [
Mirko Bonadei2ff3f492018-11-22 09:00:13 +0100795 "../api:create_peerconnection_factory",
Mirko Bonadei34814c72018-01-11 10:13:56 +0100796 "../api:libjingle_peerconnection_api",
Qiang Chen51e20462017-12-05 11:11:21 -0800797 "../api/audio_codecs:builtin_audio_decoder_factory",
798 "../api/audio_codecs:builtin_audio_encoder_factory",
Niels Möllerc6ce9c52018-05-11 11:15:30 +0200799 "../api/video:video_frame",
Chen Xing5d24b162019-06-10 12:59:38 +0200800 "../api/video:video_rtp_headers",
Mirko Bonadei75baa492018-01-11 17:07:30 +0100801 "../media:rtc_audio_video",
Anders Carlssona114c882018-01-04 15:10:22 +0100802 "../media:rtc_internal_video_codecs",
jianjun.zhuc0247402017-07-11 06:20:45 -0700803 "../media:rtc_media",
804 "../media:rtc_media_base",
Artem Titov94b57c02019-03-21 13:35:10 +0100805 "../modules/audio_device",
806 "../modules/audio_processing",
Alessio Bazzicab768e882018-11-07 14:29:54 +0000807 "../modules/audio_processing:api",
jianjun.zhuc0247402017-07-11 06:20:45 -0700808 "../modules/video_capture:video_capture_module",
809 "../pc:libjingle_peerconnection",
Niels Möller0a595352019-01-02 15:12:38 +0100810 "../pc:peerconnection",
Artem Titov94b57c02019-03-21 13:35:10 +0100811 "../rtc_base",
Kári Tristan Helgasonede7cb22019-03-06 10:34:09 +0100812 "../test:platform_video_capturer",
Niels Möller0a595352019-01-02 15:12:38 +0100813 "../test:video_test_common",
Karl Wiberg918f50c2018-07-05 11:40:33 +0200814 "//third_party/abseil-cpp/absl/memory",
gyzhouad7cad82017-05-11 16:10:03 -0700815 ]
qiangchen42f96d52017-08-08 17:08:03 -0700816 if (is_android) {
George Zhou2770c3d2018-03-07 09:58:54 -0800817 deps += [
Artem Titov94b57c02019-03-21 13:35:10 +0100818 "../modules/utility",
George Zhou2770c3d2018-03-07 09:58:54 -0800819 "../sdk/android:libjingle_peerconnection_jni",
820 ]
qiangchen42f96d52017-08-08 17:08:03 -0700821 }
822 }
823}
824
825if (is_android) {
Mirko Bonadeifbb3b7d2017-11-07 15:36:33 +0000826 rtc_android_library("webrtc_unity_java") {
qiangchen42f96d52017-08-08 17:08:03 -0700827 java_files = [ "unityplugin/java/src/org/webrtc/UnityUtility.java" ]
828 deps = [
829 "../rtc_base:base_java",
Artem Titarenko69540f42018-12-10 12:30:46 +0100830 "../sdk/android:camera_java",
qiangchen42f96d52017-08-08 17:08:03 -0700831 "../sdk/android:libjingle_peerconnection_java",
Artem Titarenko69540f42018-12-10 12:30:46 +0100832 "../sdk/android:peerconnection_java",
833 "../sdk/android:video_java",
Peter Wen7bc331f2019-03-06 09:18:57 -0500834 "//third_party/android_deps:com_android_support_support_annotations_java",
qiangchen42f96d52017-08-08 17:08:03 -0700835 ]
836 }
837
838 dist_jar("libwebrtc_unity") {
839 _target_dir_name = get_label_info(":$target_name", "dir")
840 output = "${root_out_dir}/lib.java${_target_dir_name}/${target_name}.jar"
George Zhou2770c3d2018-03-07 09:58:54 -0800841 direct_deps_only = false
qiangchen42f96d52017-08-08 17:08:03 -0700842 use_interface_jars = false
George Zhou2770c3d2018-03-07 09:58:54 -0800843 use_unprocessed_jars = false
Oleh Prypin86021d92017-09-24 22:29:06 +0200844 requires_android = true
qiangchen42f96d52017-08-08 17:08:03 -0700845 deps = [
846 ":webrtc_unity_java",
qiangchen42f96d52017-08-08 17:08:03 -0700847 "../rtc_base:base_java",
848 "../sdk/android:libjingle_peerconnection_java",
849 "../sdk/android:libjingle_peerconnection_metrics_default_java",
Peter Wen7bc331f2019-03-06 09:18:57 -0500850 "//third_party/android_deps:com_android_support_support_annotations_java",
qiangchen42f96d52017-08-08 17:08:03 -0700851 ]
gyzhouad7cad82017-05-11 16:10:03 -0700852 }
853}
854
charujainaca3a242016-11-01 03:09:15 -0700855if (!build_with_chromium) {
856 # Doesn't build within Chrome on Win.
857 rtc_executable("stun_prober") {
kjellander1993b1d2017-03-06 00:29:21 -0800858 testonly = true
charujainaca3a242016-11-01 03:09:15 -0700859 sources = [
860 "stunprober/main.cc",
861 ]
charujainaca3a242016-11-01 03:09:15 -0700862 deps = [
863 "../p2p:libstunprober",
864 "../p2p:rtc_p2p",
Artem Titov94b57c02019-03-21 13:35:10 +0100865 "../rtc_base",
Patrik Höglunda8005cf2017-12-13 16:05:42 +0100866 "../rtc_base:checks",
ehmaldonadof6a861a2017-07-19 10:40:47 -0700867 "../rtc_base:rtc_base_approved",
charujainaca3a242016-11-01 03:09:15 -0700868 ]
869 }
870}