blob: c94e346821947f03062e8d2563a0bc774ca87315 [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_stubbed_video_io_test_apk",
29 ":AppRTCMobile_test_apk",
George Zhou2770c3d2018-03-07 09:58:54 -080030 ":libwebrtc_unity",
kjellander6ceab082016-10-28 05:44:03 -070031 ]
Sami Kalliomäki3e77afd2018-03-08 16:43:16 +010032
33 # TODO(sakal): We include some code from the tests. Remove this dependency
34 # and remove this if-clause.
35 if (rtc_include_tests) {
36 deps += [ "androidnativeapi:androidnativeapi" ]
37 }
kjellander6ceab082016-10-28 05:44:03 -070038 }
39
charujainaca3a242016-11-01 03:09:15 -070040 if (!build_with_chromium) {
Mirko Bonadei1a339c32017-12-14 13:06:10 +010041 deps += [ ":stun_prober" ]
charujainaca3a242016-11-01 03:09:15 -070042 }
43
kjellander6ceab082016-10-28 05:44:03 -070044 if (is_ios || (is_mac && target_cpu != "x86")) {
Mirko Bonadei1a339c32017-12-14 13:06:10 +010045 deps += [ ":AppRTCMobile" ]
Sami Kalliomaki9c0c75b2016-06-29 14:55:00 +020046 }
kjellander6ceab082016-10-28 05:44:03 -070047
48 if (is_linux || is_win) {
Mirko Bonadei1a339c32017-12-14 13:06:10 +010049 deps += [
kthelgason0727f152016-08-08 09:03:23 -070050 ":peerconnection_client",
51 ":peerconnection_server",
52 ":relayserver",
53 ":stunserver",
54 ":turnserver",
55 ]
56 }
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
tkchin2ddfdba2016-08-07 21:37:45 -070063if (is_android) {
Mirko Bonadeifbb3b7d2017-11-07 15:36:33 +000064 rtc_android_apk("AppRTCMobile") {
kjellander1993b1d2017-03-06 00:29:21 -080065 testonly = true
Magnus Jedvertc1815cf2016-09-27 10:10:41 +020066 apk_name = "AppRTCMobile"
Sami Kalliomaki9c0c75b2016-06-29 14:55:00 +020067 android_manifest = "androidapp/AndroidManifest.xml"
68
69 deps = [
Magnus Jedvertc1815cf2016-09-27 10:10:41 +020070 ":AppRTCMobile_javalib",
71 ":AppRTCMobile_resources",
jianjun.zhuc0247402017-07-11 06:20:45 -070072 "../rtc_base:base_java",
Sami Kalliomaki9c0c75b2016-06-29 14:55:00 +020073 ]
74
jianjun.zhuc0247402017-07-11 06:20:45 -070075 shared_libraries = [ "../sdk/android:libjingle_peerconnection_so" ]
Sami Kalliomaki9c0c75b2016-06-29 14:55:00 +020076 }
77
Mirko Bonadeifbb3b7d2017-11-07 15:36:33 +000078 rtc_android_library("AppRTCMobile_javalib") {
kjellander1993b1d2017-03-06 00:29:21 -080079 testonly = true
Mirko Bonadei4f024ef2018-01-04 13:12:03 +010080 android_manifest_for_lint = "androidapp/AndroidManifest.xml"
sakal07a050f2017-02-13 05:58:27 -080081
Sami Kalliomaki9c0c75b2016-06-29 14:55:00 +020082 java_files = [
83 "androidapp/src/org/appspot/apprtc/AppRTCAudioManager.java",
henrikac3c2f312016-12-14 07:36:56 -080084 "androidapp/src/org/appspot/apprtc/AppRTCBluetoothManager.java",
Sami Kalliomaki9c0c75b2016-06-29 14:55:00 +020085 "androidapp/src/org/appspot/apprtc/AppRTCClient.java",
86 "androidapp/src/org/appspot/apprtc/AppRTCProximitySensor.java",
87 "androidapp/src/org/appspot/apprtc/CallActivity.java",
88 "androidapp/src/org/appspot/apprtc/CallFragment.java",
89 "androidapp/src/org/appspot/apprtc/CaptureQualityController.java",
90 "androidapp/src/org/appspot/apprtc/ConnectActivity.java",
91 "androidapp/src/org/appspot/apprtc/CpuMonitor.java",
92 "androidapp/src/org/appspot/apprtc/DirectRTCClient.java",
93 "androidapp/src/org/appspot/apprtc/HudFragment.java",
94 "androidapp/src/org/appspot/apprtc/PeerConnectionClient.java",
Sami Kalliomaki9c0c75b2016-06-29 14:55:00 +020095 "androidapp/src/org/appspot/apprtc/RoomParametersFetcher.java",
Qingsi Wanga4e72b72018-02-12 10:34:18 -080096 "androidapp/src/org/appspot/apprtc/RtcEventLog.java",
henrika5641fbb2018-02-21 14:12:53 +010097 "androidapp/src/org/appspot/apprtc/RecordedAudioToFileController.java",
Sami Kalliomaki9c0c75b2016-06-29 14:55:00 +020098 "androidapp/src/org/appspot/apprtc/SettingsActivity.java",
99 "androidapp/src/org/appspot/apprtc/SettingsFragment.java",
100 "androidapp/src/org/appspot/apprtc/TCPChannelClient.java",
101 "androidapp/src/org/appspot/apprtc/UnhandledExceptionHandler.java",
102 "androidapp/src/org/appspot/apprtc/WebSocketChannelClient.java",
103 "androidapp/src/org/appspot/apprtc/WebSocketRTCClient.java",
104 "androidapp/src/org/appspot/apprtc/util/AppRTCUtils.java",
105 "androidapp/src/org/appspot/apprtc/util/AsyncHttpURLConnection.java",
Sami Kalliomaki9c0c75b2016-06-29 14:55:00 +0200106 ]
107
108 deps = [
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200109 ":AppRTCMobile_resources",
Paulina Hensman17071682018-03-26 16:10:29 +0200110 "../modules/audio_device:audio_device_java",
jianjun.zhuc0247402017-07-11 06:20:45 -0700111 "../rtc_base:base_java",
Sami Kalliomäki7d8f5942018-04-23 15:07:34 +0200112 "../sdk/android:audio_api_java",
Sami Kalliomäki725c1062018-03-28 10:49:18 +0200113 "../sdk/android:base_java",
Sami Kalliomäki1641ca32018-04-04 15:59:31 +0200114 "../sdk/android:camera_java",
Anders Carlsson1e06d882018-07-10 09:33:30 +0200115 "../sdk/android:default_video_codec_factory_java",
Sami Kalliomäki1641ca32018-04-04 15:59:31 +0200116 "../sdk/android:filevideo_java",
Sami Kalliomäki725c1062018-03-28 10:49:18 +0200117 "../sdk/android:hwcodecs_java",
Sami Kalliomäki7d8f5942018-04-23 15:07:34 +0200118 "../sdk/android:java_audio_device_module_java",
jianjun.zhuc0247402017-07-11 06:20:45 -0700119 "../sdk/android:libjingle_peerconnection_java",
120 "../sdk/android:libjingle_peerconnection_metrics_default_java",
Sami Kalliomäki1641ca32018-04-04 15:59:31 +0200121 "../sdk/android:peerconnection_java",
122 "../sdk/android:screencapturer_java",
123 "../sdk/android:surfaceviewrenderer_java",
Sami Kalliomäki725c1062018-03-28 10:49:18 +0200124 "../sdk/android:swcodecs_java",
Sami Kalliomäki1641ca32018-04-04 15:59:31 +0200125 "../sdk/android:video_api_java",
Sami Kalliomäki903bd412018-07-24 10:53:28 +0200126 "../sdk/android:video_java",
jianjun.zhuc0247402017-07-11 06:20:45 -0700127 "androidapp/third_party/autobanh:autobanh_java",
Sami Kalliomäki06e363a2018-03-22 13:42:50 +0100128 "//third_party/jsr-305:jsr_305_javalib",
Sami Kalliomaki9c0c75b2016-06-29 14:55:00 +0200129 ]
130 }
131
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200132 android_resources("AppRTCMobile_resources") {
kjellander1993b1d2017-03-06 00:29:21 -0800133 testonly = true
Sami Kalliomaki9c0c75b2016-06-29 14:55:00 +0200134 resource_dirs = [ "androidapp/res" ]
135 custom_package = "org.appspot.apprtc"
136 }
137
Sami Kalliomäkid54f5f52018-08-03 13:23:05 +0200138 rtc_instrumentation_test_apk("AppRTCMobile_test_apk") {
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200139 apk_name = "AppRTCMobileTest"
Sami Kalliomaki9c0c75b2016-06-29 14:55:00 +0200140 android_manifest = "androidtests/AndroidManifest.xml"
141
Patrik Höglunda8005cf2017-12-13 16:05:42 +0100142 java_files = [
143 "androidtests/src/org/appspot/apprtc/test/PeerConnectionClientTest.java",
144 ]
Sami Kalliomaki9c0c75b2016-06-29 14:55:00 +0200145
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200146 apk_under_test = ":AppRTCMobile"
Sami Kalliomaki9c0c75b2016-06-29 14:55:00 +0200147
148 deps = [
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200149 ":AppRTCMobile_javalib",
jianjun.zhuc0247402017-07-11 06:20:45 -0700150 "../sdk/android:libjingle_peerconnection_java",
Sami Kalliomäki903bd412018-07-24 10:53:28 +0200151 "../sdk/android:video_java",
sakalcb79d512017-01-11 06:21:26 -0800152 "//third_party/android_support_test_runner:runner_java",
153 "//third_party/junit",
Sami Kalliomaki9c0c75b2016-06-29 14:55:00 +0200154 ]
155 }
mandermoa6069e82017-01-16 02:23:09 -0800156
Sami Kalliomäkid54f5f52018-08-03 13:23:05 +0200157 rtc_instrumentation_test_apk("AppRTCMobile_stubbed_video_io_test_apk") {
mandermoa6069e82017-01-16 02:23:09 -0800158 apk_name = "AppRTCMobileTestStubbedVideoIO"
159 android_manifest = "androidtests/AndroidManifest.xml"
160
oprypin30cda5e2017-04-24 04:15:13 -0700161 java_files = [ "androidtests/src/org/appspot/apprtc/test/CallActivityStubbedInputOutputTest.java" ]
mandermoa6069e82017-01-16 02:23:09 -0800162
163 apk_under_test = ":AppRTCMobile"
164
165 deps = [
166 ":AppRTCMobile_javalib",
jianjun.zhuc0247402017-07-11 06:20:45 -0700167 "../sdk/android:libjingle_peerconnection_java",
mandermoa6069e82017-01-16 02:23:09 -0800168 "//third_party/android_support_test_runner:rules_java",
169 "//third_party/android_support_test_runner:runner_java",
170 "//third_party/espresso:espresso_all_java",
171 "//third_party/hamcrest:hamcrest_java",
172 "//third_party/junit",
mandermoa6069e82017-01-16 02:23:09 -0800173 ]
174
175 data = [
Edward Lemur70ba9b42018-01-22 13:46:58 +0100176 "../build/android/adb_reverse_forwarder.py",
177 "../examples/androidtests/video_quality_loopback_test.py",
Mirko Bonadei92ea95e2017-09-15 06:47:31 +0200178 "../resources/reference_video_640x360_30fps.y4m",
Edward Lemur70ba9b42018-01-22 13:46:58 +0100179 "../rtc_tools/compare_videos.py",
180 "../rtc_tools/testing/prebuilt_apprtc.zip",
181 "../rtc_tools/testing/golang/linux/go.tar.gz",
182 "../rtc_tools/testing/build_apprtc.py",
183 "../rtc_tools/testing/utils.py",
184 "../tools_webrtc/video_quality_toolchain/linux/ffmpeg",
185 "../tools_webrtc/video_quality_toolchain/linux/frame_analyzer",
186 "../tools_webrtc/video_quality_toolchain/linux/zxing",
mandermoa6069e82017-01-16 02:23:09 -0800187 ]
188 }
Sami Kalliomaki9c0c75b2016-06-29 14:55:00 +0200189}
tkchin2ddfdba2016-08-07 21:37:45 -0700190
191if (is_ios || (is_mac && target_cpu != "x86")) {
tkchin2ddfdba2016-08-07 21:37:45 -0700192 config("apprtc_common_config") {
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200193 include_dirs = [ "objc/AppRTCMobile/common" ]
tkchin2ddfdba2016-08-07 21:37:45 -0700194 }
195
kjellanderb62dbbe2016-09-23 00:38:52 -0700196 rtc_static_library("apprtc_common") {
kjellander1993b1d2017-03-06 00:29:21 -0800197 testonly = true
tkchin2ddfdba2016-08-07 21:37:45 -0700198 sources = [
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200199 "objc/AppRTCMobile/common/ARDUtilities.h",
200 "objc/AppRTCMobile/common/ARDUtilities.m",
tkchin2ddfdba2016-08-07 21:37:45 -0700201 ]
ehmaldonadoe9cc6862016-09-05 06:10:18 -0700202 public_configs = [ ":apprtc_common_config" ]
tkchin2ddfdba2016-08-07 21:37:45 -0700203
Kári Tristan Helgason946923a2017-06-02 14:05:56 +0200204 if (is_ios) {
Mirko Bonadeicbaaaed2018-02-19 15:14:04 +0100205 # iOS must use WebRTC.framework which is dynamically linked.
206 # 'gn check' is disabled in order to avoid confusion and
207 # errors caused by multiple implementations.
208 check_includes = false
kthelgason5901d9d2017-08-16 07:28:03 -0700209 deps = [
Kári Tristan Helgason99bf77c2018-02-16 10:49:22 +0100210 "../sdk:framework_objc",
Mirko Bonadei1a339c32017-12-14 13:06:10 +0100211 "../system_wrappers:field_trial_default",
Ilya Nikolaevskiy2ffe3e82018-01-17 19:57:24 +0000212 "../system_wrappers:runtime_enabled_features_default",
kthelgason5901d9d2017-08-16 07:28:03 -0700213 ]
Kári Tristan Helgason946923a2017-06-02 14:05:56 +0200214 } else {
kthelgason5901d9d2017-08-16 07:28:03 -0700215 deps = [
kthelgason36d658d2017-08-24 05:43:45 -0700216 "../sdk:common_objc",
kthelgason5901d9d2017-08-16 07:28:03 -0700217 "../system_wrappers:field_trial_default",
218 "../system_wrappers:metrics_default",
Ilya Nikolaevskiy2ffe3e82018-01-17 19:57:24 +0000219 "../system_wrappers:runtime_enabled_features_default",
kthelgason5901d9d2017-08-16 07:28:03 -0700220 ]
Kári Tristan Helgason946923a2017-06-02 14:05:56 +0200221 }
tkchin2ddfdba2016-08-07 21:37:45 -0700222 }
223
224 config("apprtc_signaling_config") {
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200225 include_dirs = [ "objc/AppRTCMobile" ]
tkchin2ddfdba2016-08-07 21:37:45 -0700226 }
227
kjellanderb62dbbe2016-09-23 00:38:52 -0700228 rtc_static_library("apprtc_signaling") {
kjellander1993b1d2017-03-06 00:29:21 -0800229 testonly = true
tkchin2ddfdba2016-08-07 21:37:45 -0700230 sources = [
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200231 "objc/AppRTCMobile/ARDAppClient+Internal.h",
232 "objc/AppRTCMobile/ARDAppClient.h",
233 "objc/AppRTCMobile/ARDAppClient.m",
234 "objc/AppRTCMobile/ARDAppEngineClient.h",
235 "objc/AppRTCMobile/ARDAppEngineClient.m",
236 "objc/AppRTCMobile/ARDBitrateTracker.h",
237 "objc/AppRTCMobile/ARDBitrateTracker.m",
sakalc522e752017-04-05 12:17:48 -0700238 "objc/AppRTCMobile/ARDCaptureController.h",
239 "objc/AppRTCMobile/ARDCaptureController.m",
Anders Carlsson358f2e02018-06-04 10:24:37 +0200240 "objc/AppRTCMobile/ARDExternalSampleCapturer.h",
241 "objc/AppRTCMobile/ARDExternalSampleCapturer.m",
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200242 "objc/AppRTCMobile/ARDJoinResponse+Internal.h",
243 "objc/AppRTCMobile/ARDJoinResponse.h",
244 "objc/AppRTCMobile/ARDJoinResponse.m",
245 "objc/AppRTCMobile/ARDMessageResponse+Internal.h",
246 "objc/AppRTCMobile/ARDMessageResponse.h",
247 "objc/AppRTCMobile/ARDMessageResponse.m",
248 "objc/AppRTCMobile/ARDRoomServerClient.h",
sakalc4adacf2017-03-28 01:22:48 -0700249 "objc/AppRTCMobile/ARDSettingsModel+Private.h",
250 "objc/AppRTCMobile/ARDSettingsModel.h",
251 "objc/AppRTCMobile/ARDSettingsModel.m",
252 "objc/AppRTCMobile/ARDSettingsStore.h",
253 "objc/AppRTCMobile/ARDSettingsStore.m",
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200254 "objc/AppRTCMobile/ARDSignalingChannel.h",
255 "objc/AppRTCMobile/ARDSignalingMessage.h",
256 "objc/AppRTCMobile/ARDSignalingMessage.m",
257 "objc/AppRTCMobile/ARDStatsBuilder.h",
258 "objc/AppRTCMobile/ARDStatsBuilder.m",
kthelgasoncc882af2017-01-13 05:59:46 -0800259 "objc/AppRTCMobile/ARDTURNClient+Internal.h",
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200260 "objc/AppRTCMobile/ARDTURNClient.h",
kthelgasoncc882af2017-01-13 05:59:46 -0800261 "objc/AppRTCMobile/ARDTURNClient.m",
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200262 "objc/AppRTCMobile/ARDWebSocketChannel.h",
263 "objc/AppRTCMobile/ARDWebSocketChannel.m",
264 "objc/AppRTCMobile/RTCIceCandidate+JSON.h",
265 "objc/AppRTCMobile/RTCIceCandidate+JSON.m",
266 "objc/AppRTCMobile/RTCIceServer+JSON.h",
267 "objc/AppRTCMobile/RTCIceServer+JSON.m",
268 "objc/AppRTCMobile/RTCMediaConstraints+JSON.h",
269 "objc/AppRTCMobile/RTCMediaConstraints+JSON.m",
270 "objc/AppRTCMobile/RTCSessionDescription+JSON.h",
271 "objc/AppRTCMobile/RTCSessionDescription+JSON.m",
tkchin2ddfdba2016-08-07 21:37:45 -0700272 ]
ehmaldonadoe9cc6862016-09-05 06:10:18 -0700273 public_configs = [ ":apprtc_signaling_config" ]
tkchin2ddfdba2016-08-07 21:37:45 -0700274 deps = [
275 ":apprtc_common",
276 ":socketrocket",
277 ]
Kári Tristan Helgason946923a2017-06-02 14:05:56 +0200278 if (is_ios) {
Mirko Bonadeicbaaaed2018-02-19 15:14:04 +0100279 # iOS must use WebRTC.framework which is dynamically linked.
280 # 'gn check' is disabled in order to avoid confusion and
281 # errors caused by multiple implementations.
282 check_includes = false
Mirko Bonadei1a339c32017-12-14 13:06:10 +0100283 deps += [
284 ":AppRTCMobile_ios_frameworks",
285 "../sdk:framework_objc",
Kári Tristan Helgason946923a2017-06-02 14:05:56 +0200286 ]
Mirko Bonadei1a339c32017-12-14 13:06:10 +0100287 } else {
Mirko Bonadeicbaaaed2018-02-19 15:14:04 +0100288 deps += [
289 "../sdk:common_objc",
290 "../sdk:mediaconstraints_objc",
291 "../sdk:peerconnectionfactory_base_objc",
292 "../sdk:videocapture_objc",
293 "../sdk:videocodec_objc",
Anders Carlsson358f2e02018-06-04 10:24:37 +0200294 "../sdk:videoframebuffer_objc",
Anders Carlsson9823ee42018-03-07 10:32:03 +0100295 "../sdk:videosource_objc",
Mirko Bonadeicbaaaed2018-02-19 15:14:04 +0100296 ]
Kári Tristan Helgason946923a2017-06-02 14:05:56 +0200297 }
Kári Helgasonaaa483b2018-06-20 11:52:03 +0000298 libs = [ "QuartzCore.framework" ]
tkchin2ddfdba2016-08-07 21:37:45 -0700299 }
300
301 if (is_ios) {
denicija77bfd7c2016-11-15 00:41:26 -0800302 rtc_static_library("AppRTCMobile_lib") {
Mirko Bonadeicbaaaed2018-02-19 15:14:04 +0100303 # iOS must use WebRTC.framework which is dynamically linked.
304 # 'gn check' is disabled in order to avoid confusion and
305 # errors caused by multiple implementations.
306 check_includes = false
kjellander1993b1d2017-03-06 00:29:21 -0800307 testonly = true
tkchin2ddfdba2016-08-07 21:37:45 -0700308 sources = [
Patrik Höglund49acb1e2018-01-02 14:41:54 +0100309 "objc/AppRTCMobile/ios/ARDAppDelegate.h",
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200310 "objc/AppRTCMobile/ios/ARDAppDelegate.m",
Daniela012b56b2017-11-15 13:15:24 +0100311 "objc/AppRTCMobile/ios/ARDFileCaptureController.h",
312 "objc/AppRTCMobile/ios/ARDFileCaptureController.m",
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200313 "objc/AppRTCMobile/ios/ARDMainView.h",
314 "objc/AppRTCMobile/ios/ARDMainView.m",
315 "objc/AppRTCMobile/ios/ARDMainViewController.h",
316 "objc/AppRTCMobile/ios/ARDMainViewController.m",
denicijad17d5362016-11-02 02:56:09 -0700317 "objc/AppRTCMobile/ios/ARDSettingsViewController.h",
318 "objc/AppRTCMobile/ios/ARDSettingsViewController.m",
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200319 "objc/AppRTCMobile/ios/ARDStatsView.h",
320 "objc/AppRTCMobile/ios/ARDStatsView.m",
321 "objc/AppRTCMobile/ios/ARDVideoCallView.h",
322 "objc/AppRTCMobile/ios/ARDVideoCallView.m",
323 "objc/AppRTCMobile/ios/ARDVideoCallViewController.h",
324 "objc/AppRTCMobile/ios/ARDVideoCallViewController.m",
Anders Carlsson6bf43d22017-10-16 13:51:43 +0200325 "objc/AppRTCMobile/ios/RTCVideoCodecInfo+HumanReadable.h",
326 "objc/AppRTCMobile/ios/RTCVideoCodecInfo+HumanReadable.m",
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200327 "objc/AppRTCMobile/ios/UIImage+ARDUtilities.h",
328 "objc/AppRTCMobile/ios/UIImage+ARDUtilities.m",
denicija77bfd7c2016-11-15 00:41:26 -0800329 ]
denicija77bfd7c2016-11-15 00:41:26 -0800330
331 deps = [
Kári Tristan Helgason946923a2017-06-02 14:05:56 +0200332 ":AppRTCMobile_ios_frameworks",
denicija77bfd7c2016-11-15 00:41:26 -0800333 ":apprtc_common",
334 ":apprtc_signaling",
Mirko Bonadei1a339c32017-12-14 13:06:10 +0100335 "../sdk:framework_objc",
denicija77bfd7c2016-11-15 00:41:26 -0800336 ]
337 }
338
339 ios_app_bundle("AppRTCMobile") {
kjellander1993b1d2017-03-06 00:29:21 -0800340 testonly = true
denicija77bfd7c2016-11-15 00:41:26 -0800341 sources = [
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200342 "objc/AppRTCMobile/ios/main.m",
tkchin2ddfdba2016-08-07 21:37:45 -0700343 ]
344
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200345 info_plist = "objc/AppRTCMobile/ios/Info.plist"
tkchin2ddfdba2016-08-07 21:37:45 -0700346
denicija77bfd7c2016-11-15 00:41:26 -0800347 configs += [ "..:common_config" ]
tkchin2ddfdba2016-08-07 21:37:45 -0700348 public_configs = [ "..:common_inherited_config" ]
349
350 deps = [
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200351 ":AppRTCMobile_ios_bundle_data",
kthelgasond3adbfb2017-01-26 01:14:04 -0800352 ":AppRTCMobile_ios_frameworks",
denicija77bfd7c2016-11-15 00:41:26 -0800353 ":AppRTCMobile_lib",
Mirko Bonadei1a339c32017-12-14 13:06:10 +0100354 "../sdk:framework_objc",
tkchin2ddfdba2016-08-07 21:37:45 -0700355 ]
356
Anders Carlsson358f2e02018-06-04 10:24:37 +0200357 if (rtc_apprtcmobile_broadcast_extension) {
358 deps += [
359 ":AppRTCMobileBroadcastSetupUI_extension_bundle",
360 ":AppRTCMobileBroadcastUpload_extension_bundle",
361 ]
362 }
363
tkchin2ddfdba2016-08-07 21:37:45 -0700364 if (target_cpu == "x86") {
365 deps += [ "//testing/iossim:iossim" ]
366 }
367 }
368
Anders Carlsson358f2e02018-06-04 10:24:37 +0200369 if (rtc_apprtcmobile_broadcast_extension) {
370 bundle_data("AppRTCMobileBroadcastUpload_extension_bundle") {
371 testonly = true
372 public_deps = [
373 ":AppRTCMobileBroadcastUpload",
374 ]
375 sources = [
376 "$root_out_dir/AppRTCMobileBroadcastUpload.appex",
377 ]
378 outputs = [
379 "{{bundle_plugins_dir}}/{{source_file_part}}",
380 ]
381 }
382
383 bundle_data("AppRTCMobileBroadcastSetupUI_extension_bundle") {
384 testonly = true
385 public_deps = [
386 ":AppRTCMobileBroadcastSetupUI",
387 ]
388 sources = [
389 "$root_out_dir/AppRTCMobileBroadcastSetupUI.appex",
390 ]
391 outputs = [
392 "{{bundle_plugins_dir}}/{{source_file_part}}",
393 ]
394 }
395
396 rtc_static_library("AppRTCMobileBroadcastUpload_lib") {
397 check_includes = false
398 testonly = true
399 sources = [
400 "objc/AppRTCMobile/ios/broadcast_extension/ARDBroadcastSampleHandler.h",
401 "objc/AppRTCMobile/ios/broadcast_extension/ARDBroadcastSampleHandler.m",
402 ]
403
404 deps = [
405 ":AppRTCMobile_ios_frameworks",
406 ":apprtc_signaling",
407 "../sdk:framework_objc",
408 ]
409
410 libs = [ "ReplayKit.framework" ]
411 }
412
413 ios_appex_bundle("AppRTCMobileBroadcastUpload") {
414 testonly = true
415 configs += [ "..:common_config" ]
416 public_configs = [ "..:common_inherited_config" ]
417
418 info_plist = "objc/AppRTCMobile/ios/broadcast_extension/BroadcastUploadInfo.plist"
419
420 deps = [
421 ":AppRTCMobileBroadcastUpload_lib",
422 "../sdk:framework_objc",
423 ]
424 }
425
426 ios_appex_bundle("AppRTCMobileBroadcastSetupUI") {
427 sources = [
428 "objc/AppRTCMobile/ios/broadcast_extension/ARDBroadcastSetupViewController.h",
429 "objc/AppRTCMobile/ios/broadcast_extension/ARDBroadcastSetupViewController.m",
430 ]
431
432 info_plist = "objc/AppRTCMobile/ios/broadcast_extension/BroadcastSetupUIInfo.plist"
433
434 libs = [ "ReplayKit.framework" ]
435
436 deps = [
437 ":AppRTCMobile_ios_bundle_data",
438 ]
439 }
440 }
441
kthelgasond3adbfb2017-01-26 01:14:04 -0800442 bundle_data("AppRTCMobile_ios_frameworks") {
Mirko Bonadei1a339c32017-12-14 13:06:10 +0100443 deps = [
kthelgason36d658d2017-08-24 05:43:45 -0700444 "../sdk:framework_objc+link",
kthelgasond3adbfb2017-01-26 01:14:04 -0800445 ]
446 sources = [
wjywbsbef8a5d2017-10-09 02:32:28 -0400447 "$root_build_dir/WebRTC.framework",
kthelgasond3adbfb2017-01-26 01:14:04 -0800448 ]
449 outputs = [
450 "{{bundle_resources_dir}}/Frameworks/{{source_file_part}}",
451 ]
452 }
453
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200454 bundle_data("AppRTCMobile_ios_bundle_data") {
tkchin2ddfdba2016-08-07 21:37:45 -0700455 sources = [
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200456 "objc/AppRTCMobile/ios/resources/Roboto-Regular.ttf",
Daniela012b56b2017-11-15 13:15:24 +0100457
458 # Sample video taken from https://media.xiph.org/video/derf/
459 "objc/AppRTCMobile/ios/resources/foreman.mp4",
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200460 "objc/AppRTCMobile/ios/resources/iPhone5@2x.png",
461 "objc/AppRTCMobile/ios/resources/iPhone6@2x.png",
462 "objc/AppRTCMobile/ios/resources/iPhone6p@3x.png",
463 "objc/AppRTCMobile/ios/resources/ic_call_end_black_24dp.png",
464 "objc/AppRTCMobile/ios/resources/ic_call_end_black_24dp@2x.png",
465 "objc/AppRTCMobile/ios/resources/ic_clear_black_24dp.png",
466 "objc/AppRTCMobile/ios/resources/ic_clear_black_24dp@2x.png",
denicija6d6762c2016-10-28 04:53:16 -0700467 "objc/AppRTCMobile/ios/resources/ic_settings_black_24dp.png",
468 "objc/AppRTCMobile/ios/resources/ic_settings_black_24dp@2x.png",
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200469 "objc/AppRTCMobile/ios/resources/ic_surround_sound_black_24dp.png",
470 "objc/AppRTCMobile/ios/resources/ic_surround_sound_black_24dp@2x.png",
471 "objc/AppRTCMobile/ios/resources/ic_switch_video_black_24dp.png",
472 "objc/AppRTCMobile/ios/resources/ic_switch_video_black_24dp@2x.png",
473 "objc/AppRTCMobile/ios/resources/mozart.mp3",
anderscb5ed9052017-08-15 04:07:12 -0700474 "objc/Icon-120.png",
475 "objc/Icon-180.png",
tkchin2ddfdba2016-08-07 21:37:45 -0700476 "objc/Icon.png",
477 ]
478 outputs = [
479 "{{bundle_resources_dir}}/{{source_file_part}}",
480 ]
481 }
Anders Carlsson73119182018-03-15 09:41:03 +0100482
483 rtc_static_library("ObjCNativeAPIDemo_lib") {
484 testonly = true
485 sources = [
486 "objcnativeapi/objc/NADAppDelegate.h",
487 "objcnativeapi/objc/NADAppDelegate.m",
488 "objcnativeapi/objc/NADViewController.h",
489 "objcnativeapi/objc/NADViewController.mm",
490 "objcnativeapi/objc/objccallclient.h",
491 "objcnativeapi/objc/objccallclient.mm",
492 ]
493
494 if (!build_with_chromium && is_clang) {
495 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
496 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
497 }
498
499 deps = [
500 "../api:libjingle_peerconnection_api",
501 "../api/audio_codecs:builtin_audio_decoder_factory",
502 "../api/audio_codecs:builtin_audio_encoder_factory",
503 "../logging:rtc_event_log_impl_base",
504 "../media:rtc_audio_video",
505 "../modules/audio_processing:audio_processing",
506 "../pc:libjingle_peerconnection",
507 "../rtc_base:rtc_base",
508 "../sdk:default_codec_factory_objc",
509 "../sdk:framework_objc",
510 "../sdk:native_api",
511 "../sdk:ui_objc",
512 "../sdk:videotoolbox_objc",
513 "../system_wrappers:field_trial_default",
514 "../system_wrappers:metrics_default",
515 "../system_wrappers:runtime_enabled_features_default",
Mirko Bonadei879f7882018-07-11 09:18:37 +0200516 "//third_party/abseil-cpp/absl/memory",
Anders Carlsson73119182018-03-15 09:41:03 +0100517 ]
518
519 if (current_cpu == "arm64") {
520 deps += [ "../sdk:metal_objc" ]
521 }
522 }
523
524 ios_app_bundle("ObjCNativeAPIDemo") {
525 testonly = true
526 sources = [
527 "objcnativeapi/objc/main.m",
528 ]
529
530 info_plist = "objcnativeapi/Info.plist"
531
532 configs += [ "..:common_config" ]
533 public_configs = [ "..:common_inherited_config" ]
534
535 deps = [
536 ":ObjCNativeAPIDemo_lib",
537 ]
538
539 if (target_cpu == "x86") {
540 deps += [ "//testing/iossim:iossim" ]
541 }
542 }
tkchin2ddfdba2016-08-07 21:37:45 -0700543 }
544
545 if (is_mac) {
denicija77bfd7c2016-11-15 00:41:26 -0800546 rtc_static_library("AppRTCMobile_lib") {
kjellander1993b1d2017-03-06 00:29:21 -0800547 testonly = true
tkchin2ddfdba2016-08-07 21:37:45 -0700548 sources = [
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200549 "objc/AppRTCMobile/mac/APPRTCAppDelegate.h",
550 "objc/AppRTCMobile/mac/APPRTCAppDelegate.m",
551 "objc/AppRTCMobile/mac/APPRTCViewController.h",
552 "objc/AppRTCMobile/mac/APPRTCViewController.m",
tkchin2ddfdba2016-08-07 21:37:45 -0700553 ]
jianjun.zhuc0247402017-07-11 06:20:45 -0700554 configs += [ "..:common_objc" ]
tkchin2ddfdba2016-08-07 21:37:45 -0700555 deps = [
556 ":apprtc_common",
557 ":apprtc_signaling",
Kári Tristan Helgason99bf77c2018-02-16 10:49:22 +0100558 "../sdk:default_codec_factory_objc",
Mirko Bonadei1a339c32017-12-14 13:06:10 +0100559 "../sdk:metal_objc",
Mirko Bonadeicbaaaed2018-02-19 15:14:04 +0100560 "../sdk:peerconnectionfactory_base_objc",
kthelgason36d658d2017-08-24 05:43:45 -0700561 "../sdk:ui_objc",
Mirko Bonadeicbaaaed2018-02-19 15:14:04 +0100562 "../sdk:videocapture_objc",
563 "../sdk:videocodec_objc",
Kári Tristan Helgason99bf77c2018-02-16 10:49:22 +0100564 "../sdk:videocodec_objc",
565 "../sdk:videotoolbox_objc",
tkchin2ddfdba2016-08-07 21:37:45 -0700566 ]
567 }
568
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200569 mac_app_bundle("AppRTCMobile") {
kjellander1993b1d2017-03-06 00:29:21 -0800570 testonly = true
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200571 output_name = "AppRTCMobile"
tkchin2ddfdba2016-08-07 21:37:45 -0700572
tkchin2ddfdba2016-08-07 21:37:45 -0700573 sources = [
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200574 "objc/AppRTCMobile/mac/main.m",
tkchin2ddfdba2016-08-07 21:37:45 -0700575 ]
576
577 public_configs = [ "..:common_inherited_config" ]
578
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200579 info_plist = "objc/AppRTCMobile/mac/Info.plist"
tkchin2ddfdba2016-08-07 21:37:45 -0700580
581 libs = [ "AppKit.framework" ]
582
583 deps = [
denicija77bfd7c2016-11-15 00:41:26 -0800584 ":AppRTCMobile_lib",
tkchin2ddfdba2016-08-07 21:37:45 -0700585 ]
586 }
587 }
588
589 config("socketrocket_include_config") {
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200590 include_dirs = [ "objc/AppRTCMobile/third_party/SocketRocket" ]
tkchin2ddfdba2016-08-07 21:37:45 -0700591 }
592
593 config("socketrocket_warning_config") {
594 # GN orders flags on a target before flags from configs. The default config
595 # adds these flags so to cancel them out they need to come from a config and
596 # cannot be on the target directly.
597 cflags = [
598 "-Wno-deprecated-declarations",
599 "-Wno-nonnull",
tkchin2ddfdba2016-08-07 21:37:45 -0700600 "-Wno-semicolon-before-method-body",
kthelgasone47de1a2017-02-24 01:56:01 -0800601 "-Wno-unused-variable",
tkchin2ddfdba2016-08-07 21:37:45 -0700602 ]
603
henrika27d8b612016-09-21 04:13:00 -0700604 cflags_objc = [
605 # Enabled for cflags_objc in build/config/compiler/BUILD.gn.
606 "-Wno-objc-missing-property-synthesis",
henrika27d8b612016-09-21 04:13:00 -0700607 ]
tkchin2ddfdba2016-08-07 21:37:45 -0700608 }
609
kjellanderb62dbbe2016-09-23 00:38:52 -0700610 rtc_static_library("socketrocket") {
kjellander1993b1d2017-03-06 00:29:21 -0800611 testonly = true
tkchin2ddfdba2016-08-07 21:37:45 -0700612 sources = [
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200613 "objc/AppRTCMobile/third_party/SocketRocket/SRWebSocket.h",
614 "objc/AppRTCMobile/third_party/SocketRocket/SRWebSocket.m",
tkchin2ddfdba2016-08-07 21:37:45 -0700615 ]
kthelgasonc0977102017-04-24 00:57:16 -0700616 configs += [ ":socketrocket_warning_config" ]
ehmaldonadoe9cc6862016-09-05 06:10:18 -0700617 public_configs = [ ":socketrocket_include_config" ]
tkchin2ddfdba2016-08-07 21:37:45 -0700618
619 libs = [
620 "CFNetwork.framework",
621 "icucore",
622 ]
623 }
adam.fedorbcc5d872016-11-07 14:53:28 -0800624
625 if (rtc_include_tests) {
kthelgason4065a572017-02-14 04:58:56 -0800626 # TODO(kthelgason): compile xctests on mac when chromium supports it.
627 if (is_ios) {
628 rtc_source_set("apprtcmobile_test_sources") {
Mirko Bonadeicbaaaed2018-02-19 15:14:04 +0100629 # iOS must use WebRTC.framework which is dynamically linked.
630 # 'gn check' is disabled in order to avoid confusion and
631 # errors caused by multiple implementations.
632 check_includes = false
kjellander1993b1d2017-03-06 00:29:21 -0800633 testonly = true
kthelgason4065a572017-02-14 04:58:56 -0800634 include_dirs = [
635 "objc/AppRTCMobile",
636 "objc/AppRTCMobile/ios",
637 ]
638 testonly = true
639 sources = [
640 "objc/AppRTCMobile/tests/ARDAppClient_xctest.mm",
Daniela012b56b2017-11-15 13:15:24 +0100641 "objc/AppRTCMobile/tests/ARDFileCaptureController_xctest.mm",
kthelgason4065a572017-02-14 04:58:56 -0800642 "objc/AppRTCMobile/tests/ARDSettingsModel_xctest.mm",
643 ]
kjellander1993b1d2017-03-06 00:29:21 -0800644 deps = [
kthelgason4065a572017-02-14 04:58:56 -0800645 ":AppRTCMobile_ios_frameworks",
646 ":AppRTCMobile_lib",
Mirko Bonadeicbaaaed2018-02-19 15:14:04 +0100647 ":apprtc_signaling",
Mirko Bonadei1a339c32017-12-14 13:06:10 +0100648 "../rtc_base:rtc_base",
649 "../sdk:framework_objc",
kthelgason4065a572017-02-14 04:58:56 -0800650 "//build/config/ios:xctest",
651 "//third_party/ocmock",
652 ]
adam.fedorbcc5d872016-11-07 14:53:28 -0800653 }
654
kthelgason4065a572017-02-14 04:58:56 -0800655 rtc_ios_xctest_test("apprtcmobile_tests") {
656 info_plist = "objc/AppRTCMobile/ios/Info.plist"
657 sources = [
658 "objc/AppRTCMobile/ios/main.m",
659 ]
660 deps = [
Mirko Bonadeicbaaaed2018-02-19 15:14:04 +0100661 ":AppRTCMobile_lib",
kthelgason4065a572017-02-14 04:58:56 -0800662 ":apprtcmobile_test_sources",
Mirko Bonadei1a339c32017-12-14 13:06:10 +0100663 "../sdk:framework_objc",
kthelgason4065a572017-02-14 04:58:56 -0800664 ]
665 ldflags = [ "-all_load" ]
666 }
adam.fedorbcc5d872016-11-07 14:53:28 -0800667 }
668 }
tkchin2ddfdba2016-08-07 21:37:45 -0700669}
kthelgason0727f152016-08-08 09:03:23 -0700670
671if (is_linux || is_win) {
ehmaldonado38a21322016-09-02 04:10:34 -0700672 rtc_executable("peerconnection_client") {
kjellander1993b1d2017-03-06 00:29:21 -0800673 testonly = true
kthelgason0727f152016-08-08 09:03:23 -0700674 sources = [
675 "peerconnection/client/conductor.cc",
676 "peerconnection/client/conductor.h",
677 "peerconnection/client/defaults.cc",
678 "peerconnection/client/defaults.h",
679 "peerconnection/client/peer_connection_client.cc",
680 "peerconnection/client/peer_connection_client.h",
681 ]
ehmaldonado7a2ce0b2016-09-05 01:35:44 -0700682
kjellandere40a7ee2016-10-16 23:56:12 -0700683 if (!build_with_chromium && is_clang) {
684 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
ehmaldonado38a21322016-09-02 04:10:34 -0700685 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
kthelgason0727f152016-08-08 09:03:23 -0700686 }
Patrik Höglundb5b5bce2017-11-13 10:19:58 +0100687 deps = [
Mirko Bonadei34814c72018-01-11 10:13:56 +0100688 "../api:libjingle_peerconnection_api",
Niels Möllerc6ce9c52018-05-11 11:15:30 +0200689 "../api/video:video_frame_i420",
Patrik Höglunda8005cf2017-12-13 16:05:42 +0100690 "../rtc_base:checks",
Patrik Höglund3e113432017-12-15 14:40:10 +0100691 "../rtc_base:stringutils",
Artem Titove41c4332018-07-25 15:04:28 +0200692 "../rtc_base/third_party/sigslot",
Patrik Höglundb5b5bce2017-11-13 10:19:58 +0100693 ]
kthelgason0727f152016-08-08 09:03:23 -0700694 if (is_win) {
695 sources += [
696 "peerconnection/client/flagdefs.h",
697 "peerconnection/client/main.cc",
698 "peerconnection/client/main_wnd.cc",
699 "peerconnection/client/main_wnd.h",
700 ]
kthelgason0727f152016-08-08 09:03:23 -0700701 configs += [ "//build/config/win:windowed" ]
jianjun.zhuc0247402017-07-11 06:20:45 -0700702 deps += [ "../media:rtc_media_base" ]
kthelgason0727f152016-08-08 09:03:23 -0700703 }
704 if (is_linux) {
705 sources += [
706 "peerconnection/client/linux/main.cc",
707 "peerconnection/client/linux/main_wnd.cc",
708 "peerconnection/client/linux/main_wnd.h",
709 ]
Henrik Kjellanderefbde2c2017-03-27 08:28:27 +0200710 cflags = [ "-Wno-deprecated-declarations" ]
kthelgason0727f152016-08-08 09:03:23 -0700711 libs = [
712 "X11",
713 "Xcomposite",
714 "Xext",
715 "Xrender",
716 ]
thomasandersonef16e992016-12-13 02:57:43 -0800717 deps += [ "//build/config/linux/gtk" ]
kthelgason0727f152016-08-08 09:03:23 -0700718 }
kjellander1993b1d2017-03-06 00:29:21 -0800719
720 deps += [
Niels Möller8366e172018-02-14 12:20:13 +0100721 "../api:libjingle_peerconnection_api",
Karl Wiberg1b0eae32017-10-17 14:48:54 +0200722 "../api/audio_codecs:builtin_audio_decoder_factory",
723 "../api/audio_codecs:builtin_audio_encoder_factory",
Niels Möllerc6ce9c52018-05-11 11:15:30 +0200724 "../api/video:video_frame",
Anders Carlsson67537952018-05-03 11:28:29 +0200725 "../api/video_codecs:builtin_video_decoder_factory",
726 "../api/video_codecs:builtin_video_encoder_factory",
Mirko Bonadei75baa492018-01-11 17:07:30 +0100727 "../media:rtc_audio_video",
Anders Carlsson67537952018-05-03 11:28:29 +0200728 "../modules/audio_device:audio_device",
729 "../modules/audio_processing:audio_processing",
jianjun.zhuc0247402017-07-11 06:20:45 -0700730 "../modules/video_capture:video_capture_module",
731 "../pc:libjingle_peerconnection",
ehmaldonadof6a861a2017-07-19 10:40:47 -0700732 "../rtc_base:rtc_base",
733 "../rtc_base:rtc_base_approved",
734 "../rtc_base:rtc_json",
jianjun.zhuc0247402017-07-11 06:20:45 -0700735 "../system_wrappers:field_trial_default",
736 "../system_wrappers:metrics_default",
Ilya Nikolaevskiy2ffe3e82018-01-17 19:57:24 +0000737 "../system_wrappers:runtime_enabled_features_default",
kjellander1993b1d2017-03-06 00:29:21 -0800738 "//third_party/libyuv",
kjellander1993b1d2017-03-06 00:29:21 -0800739 ]
kthelgason0727f152016-08-08 09:03:23 -0700740 }
kjellanderd4626e52016-09-07 02:33:01 -0700741
ehmaldonado38a21322016-09-02 04:10:34 -0700742 rtc_executable("peerconnection_server") {
kjellander1993b1d2017-03-06 00:29:21 -0800743 testonly = true
kthelgason0727f152016-08-08 09:03:23 -0700744 sources = [
745 "peerconnection/server/data_socket.cc",
746 "peerconnection/server/data_socket.h",
747 "peerconnection/server/main.cc",
748 "peerconnection/server/peer_channel.cc",
749 "peerconnection/server/peer_channel.h",
750 "peerconnection/server/utils.cc",
751 "peerconnection/server/utils.h",
752 ]
753 deps = [
jianjun.zhuc0247402017-07-11 06:20:45 -0700754 "..:webrtc_common",
ehmaldonadof6a861a2017-07-19 10:40:47 -0700755 "../rtc_base:rtc_base_approved",
Patrik Höglund3e113432017-12-15 14:40:10 +0100756 "../rtc_base:stringutils",
jianjun.zhuc0247402017-07-11 06:20:45 -0700757 "../rtc_tools:command_line_parser",
kthelgason0727f152016-08-08 09:03:23 -0700758 ]
kjellandere40a7ee2016-10-16 23:56:12 -0700759 if (!build_with_chromium && is_clang) {
760 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
ehmaldonado38a21322016-09-02 04:10:34 -0700761 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
kthelgason0727f152016-08-08 09:03:23 -0700762 }
763 }
ehmaldonado38a21322016-09-02 04:10:34 -0700764 rtc_executable("relayserver") {
kjellander1993b1d2017-03-06 00:29:21 -0800765 testonly = true
kthelgason0727f152016-08-08 09:03:23 -0700766 sources = [
767 "relayserver/relayserver_main.cc",
768 ]
769 deps = [
jianjun.zhuc0247402017-07-11 06:20:45 -0700770 "../p2p:rtc_p2p",
771 "../pc:rtc_pc",
ehmaldonadof6a861a2017-07-19 10:40:47 -0700772 "../rtc_base:rtc_base",
773 "../rtc_base:rtc_base_approved",
jianjun.zhuc0247402017-07-11 06:20:45 -0700774 "../system_wrappers:field_trial_default",
775 "../system_wrappers:metrics_default",
Ilya Nikolaevskiy2ffe3e82018-01-17 19:57:24 +0000776 "../system_wrappers:runtime_enabled_features_default",
kthelgason0727f152016-08-08 09:03:23 -0700777 ]
kjellandere40a7ee2016-10-16 23:56:12 -0700778 if (!build_with_chromium && is_clang) {
779 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
ehmaldonado38a21322016-09-02 04:10:34 -0700780 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
kthelgason0727f152016-08-08 09:03:23 -0700781 }
782 }
ehmaldonado38a21322016-09-02 04:10:34 -0700783 rtc_executable("turnserver") {
kjellander1993b1d2017-03-06 00:29:21 -0800784 testonly = true
kthelgason0727f152016-08-08 09:03:23 -0700785 sources = [
786 "turnserver/turnserver_main.cc",
787 ]
788 deps = [
jianjun.zhuc0247402017-07-11 06:20:45 -0700789 "../p2p:rtc_p2p",
790 "../pc:rtc_pc",
ehmaldonadof6a861a2017-07-19 10:40:47 -0700791 "../rtc_base:rtc_base",
792 "../rtc_base:rtc_base_approved",
jianjun.zhuc0247402017-07-11 06:20:45 -0700793 "../system_wrappers:field_trial_default",
794 "../system_wrappers:metrics_default",
Ilya Nikolaevskiy2ffe3e82018-01-17 19:57:24 +0000795 "../system_wrappers:runtime_enabled_features_default",
kthelgason0727f152016-08-08 09:03:23 -0700796 ]
kjellandere40a7ee2016-10-16 23:56:12 -0700797 if (!build_with_chromium && is_clang) {
798 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
ehmaldonado38a21322016-09-02 04:10:34 -0700799 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
kthelgason0727f152016-08-08 09:03:23 -0700800 }
801 }
ehmaldonado38a21322016-09-02 04:10:34 -0700802 rtc_executable("stunserver") {
kjellander1993b1d2017-03-06 00:29:21 -0800803 testonly = true
kthelgason0727f152016-08-08 09:03:23 -0700804 sources = [
805 "stunserver/stunserver_main.cc",
806 ]
807 deps = [
jianjun.zhuc0247402017-07-11 06:20:45 -0700808 "../p2p:rtc_p2p",
809 "../pc:rtc_pc",
ehmaldonadof6a861a2017-07-19 10:40:47 -0700810 "../rtc_base:rtc_base",
811 "../rtc_base:rtc_base_approved",
jianjun.zhuc0247402017-07-11 06:20:45 -0700812 "../system_wrappers:field_trial_default",
813 "../system_wrappers:metrics_default",
Ilya Nikolaevskiy2ffe3e82018-01-17 19:57:24 +0000814 "../system_wrappers:runtime_enabled_features_default",
kthelgason0727f152016-08-08 09:03:23 -0700815 ]
kjellandere40a7ee2016-10-16 23:56:12 -0700816 if (!build_with_chromium && is_clang) {
817 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
ehmaldonado38a21322016-09-02 04:10:34 -0700818 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
kthelgason0727f152016-08-08 09:03:23 -0700819 }
820 }
821}
charujainaca3a242016-11-01 03:09:15 -0700822
qiangchen42f96d52017-08-08 17:08:03 -0700823if (is_win || is_android) {
gyzhouad7cad82017-05-11 16:10:03 -0700824 rtc_shared_library("webrtc_unity_plugin") {
825 testonly = true
826 sources = [
827 "unityplugin/simple_peer_connection.cc",
828 "unityplugin/simple_peer_connection.h",
829 "unityplugin/unity_plugin_apis.cc",
830 "unityplugin/unity_plugin_apis.h",
gyzhoub38f3862017-07-25 16:04:31 -0700831 "unityplugin/video_observer.cc",
832 "unityplugin/video_observer.h",
gyzhouad7cad82017-05-11 16:10:03 -0700833 ]
qiangchen42f96d52017-08-08 17:08:03 -0700834
835 if (is_android) {
836 sources += [
837 "unityplugin/classreferenceholder.cc",
838 "unityplugin/classreferenceholder.h",
839 "unityplugin/jni_onload.cc",
840 ]
Qiang Chen43fb9122017-12-20 10:47:36 -0800841 suppressed_configs += [ "//build/config/android:hide_all_but_jni_onload" ]
qiangchen42f96d52017-08-08 17:08:03 -0700842 }
843
gyzhouad7cad82017-05-11 16:10:03 -0700844 if (!build_with_chromium && is_clang) {
845 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
846 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
847 }
qiangchen42f96d52017-08-08 17:08:03 -0700848 if (is_win) {
Mirko Bonadeif957dd92018-07-11 10:47:42 +0200849 configs += [ "//build/config/win:windowed" ]
qiangchen42f96d52017-08-08 17:08:03 -0700850 }
gyzhouad7cad82017-05-11 16:10:03 -0700851 deps = [
Mirko Bonadei34814c72018-01-11 10:13:56 +0100852 "../api:libjingle_peerconnection_api",
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",
Mirko Bonadei75baa492018-01-11 17:07:30 +0100856 "../media:rtc_audio_video",
Anders Carlssona114c882018-01-04 15:10:22 +0100857 "../media:rtc_internal_video_codecs",
jianjun.zhuc0247402017-07-11 06:20:45 -0700858 "../media:rtc_media",
859 "../media:rtc_media_base",
Qiang Chen43fb9122017-12-20 10:47:36 -0800860 "../modules/audio_device:audio_device",
861 "../modules/audio_processing:audio_processing",
jianjun.zhuc0247402017-07-11 06:20:45 -0700862 "../modules/video_capture:video_capture_module",
863 "../pc:libjingle_peerconnection",
qiangchen42f96d52017-08-08 17:08:03 -0700864 "../rtc_base:rtc_base",
jianjun.zhuc0247402017-07-11 06:20:45 -0700865 "../system_wrappers:field_trial_default",
866 "../system_wrappers:metrics_default",
Ilya Nikolaevskiy2ffe3e82018-01-17 19:57:24 +0000867 "../system_wrappers:runtime_enabled_features_default",
Karl Wiberg918f50c2018-07-05 11:40:33 +0200868 "//third_party/abseil-cpp/absl/memory",
gyzhouad7cad82017-05-11 16:10:03 -0700869 ]
qiangchen42f96d52017-08-08 17:08:03 -0700870 if (is_android) {
George Zhou2770c3d2018-03-07 09:58:54 -0800871 deps += [
872 "../modules/utility:utility",
873 "../sdk/android:libjingle_peerconnection_jni",
874 ]
qiangchen42f96d52017-08-08 17:08:03 -0700875 }
876 }
877}
878
879if (is_android) {
Mirko Bonadeifbb3b7d2017-11-07 15:36:33 +0000880 rtc_android_library("webrtc_unity_java") {
qiangchen42f96d52017-08-08 17:08:03 -0700881 java_files = [ "unityplugin/java/src/org/webrtc/UnityUtility.java" ]
882 deps = [
883 "../rtc_base:base_java",
884 "../sdk/android:libjingle_peerconnection_java",
885 ]
886 }
887
888 dist_jar("libwebrtc_unity") {
889 _target_dir_name = get_label_info(":$target_name", "dir")
890 output = "${root_out_dir}/lib.java${_target_dir_name}/${target_name}.jar"
George Zhou2770c3d2018-03-07 09:58:54 -0800891 direct_deps_only = false
qiangchen42f96d52017-08-08 17:08:03 -0700892 use_interface_jars = false
George Zhou2770c3d2018-03-07 09:58:54 -0800893 use_unprocessed_jars = false
Oleh Prypin86021d92017-09-24 22:29:06 +0200894 requires_android = true
qiangchen42f96d52017-08-08 17:08:03 -0700895 deps = [
896 ":webrtc_unity_java",
Paulina Hensman17071682018-03-26 16:10:29 +0200897 "../modules/audio_device:audio_device_java",
qiangchen42f96d52017-08-08 17:08:03 -0700898 "../rtc_base:base_java",
899 "../sdk/android:libjingle_peerconnection_java",
900 "../sdk/android:libjingle_peerconnection_metrics_default_java",
901 ]
gyzhouad7cad82017-05-11 16:10:03 -0700902 }
903}
904
charujainaca3a242016-11-01 03:09:15 -0700905if (!build_with_chromium) {
906 # Doesn't build within Chrome on Win.
907 rtc_executable("stun_prober") {
kjellander1993b1d2017-03-06 00:29:21 -0800908 testonly = true
charujainaca3a242016-11-01 03:09:15 -0700909 sources = [
910 "stunprober/main.cc",
911 ]
912
913 if (!build_with_chromium && is_clang) {
914 # Suppress warnings from Chrome's Clang plugins.
915 # See http://code.google.com/p/webrtc/issues/detail?id=163 for details.
916 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
917 }
918
919 deps = [
920 "../p2p:libstunprober",
921 "../p2p:rtc_p2p",
Patrik Höglunda8005cf2017-12-13 16:05:42 +0100922 "../rtc_base:checks",
ehmaldonadof6a861a2017-07-19 10:40:47 -0700923 "../rtc_base:rtc_base",
924 "../rtc_base:rtc_base_approved",
Patrik Höglund3e113432017-12-15 14:40:10 +0100925 "../rtc_base:stringutils",
charujainaca3a242016-11-01 03:09:15 -0700926 "../system_wrappers:field_trial_default",
927 ]
928 }
929}