blob: 269e48bab9c0c8f7920699f3674b66ba41e4f533 [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",
28 ":AppRTCMobileTest",
mandermoa6069e82017-01-16 02:23:09 -080029 ":AppRTCMobileTestStubbedVideoIO",
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 "//base:base_java",
Sami Kalliomaki9c0c75b2016-06-29 14:55:00 +020074 ]
75
jianjun.zhuc0247402017-07-11 06:20:45 -070076 shared_libraries = [ "../sdk/android:libjingle_peerconnection_so" ]
Sami Kalliomaki9c0c75b2016-06-29 14:55:00 +020077 }
78
Mirko Bonadeifbb3b7d2017-11-07 15:36:33 +000079 rtc_android_library("AppRTCMobile_javalib") {
kjellander1993b1d2017-03-06 00:29:21 -080080 testonly = true
Mirko Bonadei4f024ef2018-01-04 13:12:03 +010081 android_manifest_for_lint = "androidapp/AndroidManifest.xml"
sakal07a050f2017-02-13 05:58:27 -080082
Sami Kalliomaki9c0c75b2016-06-29 14:55:00 +020083 java_files = [
84 "androidapp/src/org/appspot/apprtc/AppRTCAudioManager.java",
henrikac3c2f312016-12-14 07:36:56 -080085 "androidapp/src/org/appspot/apprtc/AppRTCBluetoothManager.java",
Sami Kalliomaki9c0c75b2016-06-29 14:55:00 +020086 "androidapp/src/org/appspot/apprtc/AppRTCClient.java",
87 "androidapp/src/org/appspot/apprtc/AppRTCProximitySensor.java",
88 "androidapp/src/org/appspot/apprtc/CallActivity.java",
89 "androidapp/src/org/appspot/apprtc/CallFragment.java",
90 "androidapp/src/org/appspot/apprtc/CaptureQualityController.java",
91 "androidapp/src/org/appspot/apprtc/ConnectActivity.java",
92 "androidapp/src/org/appspot/apprtc/CpuMonitor.java",
93 "androidapp/src/org/appspot/apprtc/DirectRTCClient.java",
94 "androidapp/src/org/appspot/apprtc/HudFragment.java",
95 "androidapp/src/org/appspot/apprtc/PeerConnectionClient.java",
Sami Kalliomaki9c0c75b2016-06-29 14:55:00 +020096 "androidapp/src/org/appspot/apprtc/RoomParametersFetcher.java",
Qingsi Wanga4e72b72018-02-12 10:34:18 -080097 "androidapp/src/org/appspot/apprtc/RtcEventLog.java",
henrika5641fbb2018-02-21 14:12:53 +010098 "androidapp/src/org/appspot/apprtc/RecordedAudioToFileController.java",
Sami Kalliomaki9c0c75b2016-06-29 14:55:00 +020099 "androidapp/src/org/appspot/apprtc/SettingsActivity.java",
100 "androidapp/src/org/appspot/apprtc/SettingsFragment.java",
101 "androidapp/src/org/appspot/apprtc/TCPChannelClient.java",
102 "androidapp/src/org/appspot/apprtc/UnhandledExceptionHandler.java",
103 "androidapp/src/org/appspot/apprtc/WebSocketChannelClient.java",
104 "androidapp/src/org/appspot/apprtc/WebSocketRTCClient.java",
105 "androidapp/src/org/appspot/apprtc/util/AppRTCUtils.java",
106 "androidapp/src/org/appspot/apprtc/util/AsyncHttpURLConnection.java",
Sami Kalliomaki9c0c75b2016-06-29 14:55:00 +0200107 ]
108
109 deps = [
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200110 ":AppRTCMobile_resources",
Paulina Hensman17071682018-03-26 16:10:29 +0200111 "../modules/audio_device:audio_device_java",
jianjun.zhuc0247402017-07-11 06:20:45 -0700112 "../rtc_base:base_java",
Sami Kalliomäki7d8f5942018-04-23 15:07:34 +0200113 "../sdk/android:audio_api_java",
Sami Kalliomäki725c1062018-03-28 10:49:18 +0200114 "../sdk/android:base_java",
Sami Kalliomäki1641ca32018-04-04 15:59:31 +0200115 "../sdk/android:camera_java",
116 "../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",
jianjun.zhuc0247402017-07-11 06:20:45 -0700126 "androidapp/third_party/autobanh:autobanh_java",
Sami Kalliomäki06e363a2018-03-22 13:42:50 +0100127 "//third_party/jsr-305:jsr_305_javalib",
Sami Kalliomaki9c0c75b2016-06-29 14:55:00 +0200128 ]
129 }
130
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200131 android_resources("AppRTCMobile_resources") {
kjellander1993b1d2017-03-06 00:29:21 -0800132 testonly = true
Sami Kalliomaki9c0c75b2016-06-29 14:55:00 +0200133 resource_dirs = [ "androidapp/res" ]
134 custom_package = "org.appspot.apprtc"
135 }
136
Mirko Bonadeifbb3b7d2017-11-07 15:36:33 +0000137 rtc_instrumentation_test_apk("AppRTCMobileTest") {
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200138 apk_name = "AppRTCMobileTest"
Sami Kalliomaki9c0c75b2016-06-29 14:55:00 +0200139 android_manifest = "androidtests/AndroidManifest.xml"
140
Patrik Höglunda8005cf2017-12-13 16:05:42 +0100141 java_files = [
142 "androidtests/src/org/appspot/apprtc/test/PeerConnectionClientTest.java",
143 ]
Sami Kalliomaki9c0c75b2016-06-29 14:55:00 +0200144
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200145 apk_under_test = ":AppRTCMobile"
Sami Kalliomaki9c0c75b2016-06-29 14:55:00 +0200146
147 deps = [
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200148 ":AppRTCMobile_javalib",
jianjun.zhuc0247402017-07-11 06:20:45 -0700149 "../sdk/android:libjingle_peerconnection_java",
sakalcb79d512017-01-11 06:21:26 -0800150 "//third_party/android_support_test_runner:runner_java",
151 "//third_party/junit",
Sami Kalliomaki9c0c75b2016-06-29 14:55:00 +0200152 ]
153 }
mandermoa6069e82017-01-16 02:23:09 -0800154
Mirko Bonadeifbb3b7d2017-11-07 15:36:33 +0000155 rtc_instrumentation_test_apk("AppRTCMobileTestStubbedVideoIO") {
mandermoa6069e82017-01-16 02:23:09 -0800156 apk_name = "AppRTCMobileTestStubbedVideoIO"
157 android_manifest = "androidtests/AndroidManifest.xml"
158
oprypin30cda5e2017-04-24 04:15:13 -0700159 java_files = [ "androidtests/src/org/appspot/apprtc/test/CallActivityStubbedInputOutputTest.java" ]
mandermoa6069e82017-01-16 02:23:09 -0800160
161 apk_under_test = ":AppRTCMobile"
162
163 deps = [
164 ":AppRTCMobile_javalib",
jianjun.zhuc0247402017-07-11 06:20:45 -0700165 "../sdk/android:libjingle_peerconnection_java",
mandermoa6069e82017-01-16 02:23:09 -0800166 "//third_party/android_support_test_runner:rules_java",
167 "//third_party/android_support_test_runner:runner_java",
168 "//third_party/espresso:espresso_all_java",
169 "//third_party/hamcrest:hamcrest_java",
170 "//third_party/junit",
mandermoa6069e82017-01-16 02:23:09 -0800171 ]
172
173 data = [
Edward Lemur70ba9b42018-01-22 13:46:58 +0100174 "../build/android/adb_reverse_forwarder.py",
175 "../examples/androidtests/video_quality_loopback_test.py",
Mirko Bonadei92ea95e2017-09-15 06:47:31 +0200176 "../resources/reference_video_640x360_30fps.y4m",
Edward Lemur70ba9b42018-01-22 13:46:58 +0100177 "../rtc_tools/barcode_tools/barcode_decoder.py",
178 "../rtc_tools/barcode_tools/helper_functions.py",
179 "../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 # GN orders flags on a target before flags from configs. The default config
228 # adds these flags so to cancel them out they need to come from a config and
229 # cannot be on the target directly.
230 cflags = [
231 "-Wno-sign-compare",
232 "-Wno-unused-variable",
233 ]
tkchin2ddfdba2016-08-07 21:37:45 -0700234 }
235
kjellanderb62dbbe2016-09-23 00:38:52 -0700236 rtc_static_library("apprtc_signaling") {
kjellander1993b1d2017-03-06 00:29:21 -0800237 testonly = true
tkchin2ddfdba2016-08-07 21:37:45 -0700238 sources = [
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200239 "objc/AppRTCMobile/ARDAppClient+Internal.h",
240 "objc/AppRTCMobile/ARDAppClient.h",
241 "objc/AppRTCMobile/ARDAppClient.m",
242 "objc/AppRTCMobile/ARDAppEngineClient.h",
243 "objc/AppRTCMobile/ARDAppEngineClient.m",
244 "objc/AppRTCMobile/ARDBitrateTracker.h",
245 "objc/AppRTCMobile/ARDBitrateTracker.m",
sakalc522e752017-04-05 12:17:48 -0700246 "objc/AppRTCMobile/ARDCaptureController.h",
247 "objc/AppRTCMobile/ARDCaptureController.m",
Anders Carlsson358f2e02018-06-04 10:24:37 +0200248 "objc/AppRTCMobile/ARDExternalSampleCapturer.h",
249 "objc/AppRTCMobile/ARDExternalSampleCapturer.m",
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200250 "objc/AppRTCMobile/ARDJoinResponse+Internal.h",
251 "objc/AppRTCMobile/ARDJoinResponse.h",
252 "objc/AppRTCMobile/ARDJoinResponse.m",
253 "objc/AppRTCMobile/ARDMessageResponse+Internal.h",
254 "objc/AppRTCMobile/ARDMessageResponse.h",
255 "objc/AppRTCMobile/ARDMessageResponse.m",
256 "objc/AppRTCMobile/ARDRoomServerClient.h",
sakalc4adacf2017-03-28 01:22:48 -0700257 "objc/AppRTCMobile/ARDSettingsModel+Private.h",
258 "objc/AppRTCMobile/ARDSettingsModel.h",
259 "objc/AppRTCMobile/ARDSettingsModel.m",
260 "objc/AppRTCMobile/ARDSettingsStore.h",
261 "objc/AppRTCMobile/ARDSettingsStore.m",
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200262 "objc/AppRTCMobile/ARDSignalingChannel.h",
263 "objc/AppRTCMobile/ARDSignalingMessage.h",
264 "objc/AppRTCMobile/ARDSignalingMessage.m",
265 "objc/AppRTCMobile/ARDStatsBuilder.h",
266 "objc/AppRTCMobile/ARDStatsBuilder.m",
kthelgasoncc882af2017-01-13 05:59:46 -0800267 "objc/AppRTCMobile/ARDTURNClient+Internal.h",
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200268 "objc/AppRTCMobile/ARDTURNClient.h",
kthelgasoncc882af2017-01-13 05:59:46 -0800269 "objc/AppRTCMobile/ARDTURNClient.m",
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200270 "objc/AppRTCMobile/ARDWebSocketChannel.h",
271 "objc/AppRTCMobile/ARDWebSocketChannel.m",
272 "objc/AppRTCMobile/RTCIceCandidate+JSON.h",
273 "objc/AppRTCMobile/RTCIceCandidate+JSON.m",
274 "objc/AppRTCMobile/RTCIceServer+JSON.h",
275 "objc/AppRTCMobile/RTCIceServer+JSON.m",
276 "objc/AppRTCMobile/RTCMediaConstraints+JSON.h",
277 "objc/AppRTCMobile/RTCMediaConstraints+JSON.m",
278 "objc/AppRTCMobile/RTCSessionDescription+JSON.h",
279 "objc/AppRTCMobile/RTCSessionDescription+JSON.m",
tkchin2ddfdba2016-08-07 21:37:45 -0700280 ]
ehmaldonadoe9cc6862016-09-05 06:10:18 -0700281 public_configs = [ ":apprtc_signaling_config" ]
tkchin2ddfdba2016-08-07 21:37:45 -0700282 deps = [
283 ":apprtc_common",
284 ":socketrocket",
285 ]
Kári Tristan Helgason946923a2017-06-02 14:05:56 +0200286 if (is_ios) {
Mirko Bonadeicbaaaed2018-02-19 15:14:04 +0100287 # iOS must use WebRTC.framework which is dynamically linked.
288 # 'gn check' is disabled in order to avoid confusion and
289 # errors caused by multiple implementations.
290 check_includes = false
Mirko Bonadei1a339c32017-12-14 13:06:10 +0100291 deps += [
292 ":AppRTCMobile_ios_frameworks",
293 "../sdk:framework_objc",
Kári Tristan Helgason946923a2017-06-02 14:05:56 +0200294 ]
Mirko Bonadei1a339c32017-12-14 13:06:10 +0100295 } else {
Mirko Bonadeicbaaaed2018-02-19 15:14:04 +0100296 deps += [
297 "../sdk:common_objc",
298 "../sdk:mediaconstraints_objc",
299 "../sdk:peerconnectionfactory_base_objc",
300 "../sdk:videocapture_objc",
301 "../sdk:videocodec_objc",
Anders Carlsson358f2e02018-06-04 10:24:37 +0200302 "../sdk:videoframebuffer_objc",
Anders Carlsson9823ee42018-03-07 10:32:03 +0100303 "../sdk:videosource_objc",
Mirko Bonadeicbaaaed2018-02-19 15:14:04 +0100304 ]
Kári Tristan Helgason946923a2017-06-02 14:05:56 +0200305 }
Kári Tristan Helgason3f1d15b2018-05-30 15:09:09 +0200306 libs = [
307 "AVFoundation.framework",
308 "CoreMedia.framework",
309 "QuartzCore.framework",
310 ]
tkchin2ddfdba2016-08-07 21:37:45 -0700311 }
312
313 if (is_ios) {
denicija77bfd7c2016-11-15 00:41:26 -0800314 rtc_static_library("AppRTCMobile_lib") {
Mirko Bonadeicbaaaed2018-02-19 15:14:04 +0100315 # iOS must use WebRTC.framework which is dynamically linked.
316 # 'gn check' is disabled in order to avoid confusion and
317 # errors caused by multiple implementations.
318 check_includes = false
kjellander1993b1d2017-03-06 00:29:21 -0800319 testonly = true
tkchin2ddfdba2016-08-07 21:37:45 -0700320 sources = [
Patrik Höglund49acb1e2018-01-02 14:41:54 +0100321 "objc/AppRTCMobile/ios/ARDAppDelegate.h",
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200322 "objc/AppRTCMobile/ios/ARDAppDelegate.m",
Daniela012b56b2017-11-15 13:15:24 +0100323 "objc/AppRTCMobile/ios/ARDFileCaptureController.h",
324 "objc/AppRTCMobile/ios/ARDFileCaptureController.m",
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200325 "objc/AppRTCMobile/ios/ARDMainView.h",
326 "objc/AppRTCMobile/ios/ARDMainView.m",
327 "objc/AppRTCMobile/ios/ARDMainViewController.h",
328 "objc/AppRTCMobile/ios/ARDMainViewController.m",
denicijad17d5362016-11-02 02:56:09 -0700329 "objc/AppRTCMobile/ios/ARDSettingsViewController.h",
330 "objc/AppRTCMobile/ios/ARDSettingsViewController.m",
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200331 "objc/AppRTCMobile/ios/ARDStatsView.h",
332 "objc/AppRTCMobile/ios/ARDStatsView.m",
333 "objc/AppRTCMobile/ios/ARDVideoCallView.h",
334 "objc/AppRTCMobile/ios/ARDVideoCallView.m",
335 "objc/AppRTCMobile/ios/ARDVideoCallViewController.h",
336 "objc/AppRTCMobile/ios/ARDVideoCallViewController.m",
Anders Carlsson6bf43d22017-10-16 13:51:43 +0200337 "objc/AppRTCMobile/ios/RTCVideoCodecInfo+HumanReadable.h",
338 "objc/AppRTCMobile/ios/RTCVideoCodecInfo+HumanReadable.m",
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200339 "objc/AppRTCMobile/ios/UIImage+ARDUtilities.h",
340 "objc/AppRTCMobile/ios/UIImage+ARDUtilities.m",
denicija77bfd7c2016-11-15 00:41:26 -0800341 ]
denicija77bfd7c2016-11-15 00:41:26 -0800342
343 deps = [
Kári Tristan Helgason946923a2017-06-02 14:05:56 +0200344 ":AppRTCMobile_ios_frameworks",
denicija77bfd7c2016-11-15 00:41:26 -0800345 ":apprtc_common",
346 ":apprtc_signaling",
Mirko Bonadei1a339c32017-12-14 13:06:10 +0100347 "../sdk:framework_objc",
denicija77bfd7c2016-11-15 00:41:26 -0800348 ]
Kári Tristan Helgason3f1d15b2018-05-30 15:09:09 +0200349
350 libs = [ "AVFoundation.framework" ]
denicija77bfd7c2016-11-15 00:41:26 -0800351 }
352
353 ios_app_bundle("AppRTCMobile") {
kjellander1993b1d2017-03-06 00:29:21 -0800354 testonly = true
denicija77bfd7c2016-11-15 00:41:26 -0800355 sources = [
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200356 "objc/AppRTCMobile/ios/main.m",
tkchin2ddfdba2016-08-07 21:37:45 -0700357 ]
358
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200359 info_plist = "objc/AppRTCMobile/ios/Info.plist"
tkchin2ddfdba2016-08-07 21:37:45 -0700360
denicija77bfd7c2016-11-15 00:41:26 -0800361 configs += [ "..:common_config" ]
tkchin2ddfdba2016-08-07 21:37:45 -0700362 public_configs = [ "..:common_inherited_config" ]
363
364 deps = [
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200365 ":AppRTCMobile_ios_bundle_data",
kthelgasond3adbfb2017-01-26 01:14:04 -0800366 ":AppRTCMobile_ios_frameworks",
denicija77bfd7c2016-11-15 00:41:26 -0800367 ":AppRTCMobile_lib",
Mirko Bonadei1a339c32017-12-14 13:06:10 +0100368 "../sdk:framework_objc",
tkchin2ddfdba2016-08-07 21:37:45 -0700369 ]
370
Anders Carlsson358f2e02018-06-04 10:24:37 +0200371 if (rtc_apprtcmobile_broadcast_extension) {
372 deps += [
373 ":AppRTCMobileBroadcastSetupUI_extension_bundle",
374 ":AppRTCMobileBroadcastUpload_extension_bundle",
375 ]
376 }
377
tkchin2ddfdba2016-08-07 21:37:45 -0700378 if (target_cpu == "x86") {
379 deps += [ "//testing/iossim:iossim" ]
380 }
381 }
382
Anders Carlsson358f2e02018-06-04 10:24:37 +0200383 if (rtc_apprtcmobile_broadcast_extension) {
384 bundle_data("AppRTCMobileBroadcastUpload_extension_bundle") {
385 testonly = true
386 public_deps = [
387 ":AppRTCMobileBroadcastUpload",
388 ]
389 sources = [
390 "$root_out_dir/AppRTCMobileBroadcastUpload.appex",
391 ]
392 outputs = [
393 "{{bundle_plugins_dir}}/{{source_file_part}}",
394 ]
395 }
396
397 bundle_data("AppRTCMobileBroadcastSetupUI_extension_bundle") {
398 testonly = true
399 public_deps = [
400 ":AppRTCMobileBroadcastSetupUI",
401 ]
402 sources = [
403 "$root_out_dir/AppRTCMobileBroadcastSetupUI.appex",
404 ]
405 outputs = [
406 "{{bundle_plugins_dir}}/{{source_file_part}}",
407 ]
408 }
409
410 rtc_static_library("AppRTCMobileBroadcastUpload_lib") {
411 check_includes = false
412 testonly = true
413 sources = [
414 "objc/AppRTCMobile/ios/broadcast_extension/ARDBroadcastSampleHandler.h",
415 "objc/AppRTCMobile/ios/broadcast_extension/ARDBroadcastSampleHandler.m",
416 ]
417
418 deps = [
419 ":AppRTCMobile_ios_frameworks",
420 ":apprtc_signaling",
421 "../sdk:framework_objc",
422 ]
423
424 libs = [ "ReplayKit.framework" ]
425 }
426
427 ios_appex_bundle("AppRTCMobileBroadcastUpload") {
428 testonly = true
429 configs += [ "..:common_config" ]
430 public_configs = [ "..:common_inherited_config" ]
431
432 info_plist = "objc/AppRTCMobile/ios/broadcast_extension/BroadcastUploadInfo.plist"
433
434 deps = [
435 ":AppRTCMobileBroadcastUpload_lib",
436 "../sdk:framework_objc",
437 ]
438 }
439
440 ios_appex_bundle("AppRTCMobileBroadcastSetupUI") {
441 sources = [
442 "objc/AppRTCMobile/ios/broadcast_extension/ARDBroadcastSetupViewController.h",
443 "objc/AppRTCMobile/ios/broadcast_extension/ARDBroadcastSetupViewController.m",
444 ]
445
446 info_plist = "objc/AppRTCMobile/ios/broadcast_extension/BroadcastSetupUIInfo.plist"
447
448 libs = [ "ReplayKit.framework" ]
449
450 deps = [
451 ":AppRTCMobile_ios_bundle_data",
452 ]
453 }
454 }
455
kthelgasond3adbfb2017-01-26 01:14:04 -0800456 bundle_data("AppRTCMobile_ios_frameworks") {
Mirko Bonadei1a339c32017-12-14 13:06:10 +0100457 deps = [
kthelgason36d658d2017-08-24 05:43:45 -0700458 "../sdk:framework_objc+link",
kthelgasond3adbfb2017-01-26 01:14:04 -0800459 ]
460 sources = [
wjywbsbef8a5d2017-10-09 02:32:28 -0400461 "$root_build_dir/WebRTC.framework",
kthelgasond3adbfb2017-01-26 01:14:04 -0800462 ]
463 outputs = [
464 "{{bundle_resources_dir}}/Frameworks/{{source_file_part}}",
465 ]
466 }
467
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200468 bundle_data("AppRTCMobile_ios_bundle_data") {
tkchin2ddfdba2016-08-07 21:37:45 -0700469 sources = [
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200470 "objc/AppRTCMobile/ios/resources/Roboto-Regular.ttf",
Daniela012b56b2017-11-15 13:15:24 +0100471
472 # Sample video taken from https://media.xiph.org/video/derf/
473 "objc/AppRTCMobile/ios/resources/foreman.mp4",
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200474 "objc/AppRTCMobile/ios/resources/iPhone5@2x.png",
475 "objc/AppRTCMobile/ios/resources/iPhone6@2x.png",
476 "objc/AppRTCMobile/ios/resources/iPhone6p@3x.png",
477 "objc/AppRTCMobile/ios/resources/ic_call_end_black_24dp.png",
478 "objc/AppRTCMobile/ios/resources/ic_call_end_black_24dp@2x.png",
479 "objc/AppRTCMobile/ios/resources/ic_clear_black_24dp.png",
480 "objc/AppRTCMobile/ios/resources/ic_clear_black_24dp@2x.png",
denicija6d6762c2016-10-28 04:53:16 -0700481 "objc/AppRTCMobile/ios/resources/ic_settings_black_24dp.png",
482 "objc/AppRTCMobile/ios/resources/ic_settings_black_24dp@2x.png",
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200483 "objc/AppRTCMobile/ios/resources/ic_surround_sound_black_24dp.png",
484 "objc/AppRTCMobile/ios/resources/ic_surround_sound_black_24dp@2x.png",
485 "objc/AppRTCMobile/ios/resources/ic_switch_video_black_24dp.png",
486 "objc/AppRTCMobile/ios/resources/ic_switch_video_black_24dp@2x.png",
487 "objc/AppRTCMobile/ios/resources/mozart.mp3",
anderscb5ed9052017-08-15 04:07:12 -0700488 "objc/Icon-120.png",
489 "objc/Icon-180.png",
tkchin2ddfdba2016-08-07 21:37:45 -0700490 "objc/Icon.png",
491 ]
492 outputs = [
493 "{{bundle_resources_dir}}/{{source_file_part}}",
494 ]
495 }
Anders Carlsson73119182018-03-15 09:41:03 +0100496
497 rtc_static_library("ObjCNativeAPIDemo_lib") {
498 testonly = true
499 sources = [
500 "objcnativeapi/objc/NADAppDelegate.h",
501 "objcnativeapi/objc/NADAppDelegate.m",
502 "objcnativeapi/objc/NADViewController.h",
503 "objcnativeapi/objc/NADViewController.mm",
504 "objcnativeapi/objc/objccallclient.h",
505 "objcnativeapi/objc/objccallclient.mm",
506 ]
507
508 if (!build_with_chromium && is_clang) {
509 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
510 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
511 }
512
513 deps = [
514 "../api:libjingle_peerconnection_api",
515 "../api/audio_codecs:builtin_audio_decoder_factory",
516 "../api/audio_codecs:builtin_audio_encoder_factory",
517 "../logging:rtc_event_log_impl_base",
518 "../media:rtc_audio_video",
519 "../modules/audio_processing:audio_processing",
520 "../pc:libjingle_peerconnection",
521 "../rtc_base:rtc_base",
522 "../sdk:default_codec_factory_objc",
523 "../sdk:framework_objc",
524 "../sdk:native_api",
525 "../sdk:ui_objc",
526 "../sdk:videotoolbox_objc",
527 "../system_wrappers:field_trial_default",
528 "../system_wrappers:metrics_default",
529 "../system_wrappers:runtime_enabled_features_default",
530 ]
531
532 if (current_cpu == "arm64") {
533 deps += [ "../sdk:metal_objc" ]
534 }
535 }
536
537 ios_app_bundle("ObjCNativeAPIDemo") {
538 testonly = true
539 sources = [
540 "objcnativeapi/objc/main.m",
541 ]
542
543 info_plist = "objcnativeapi/Info.plist"
544
545 configs += [ "..:common_config" ]
546 public_configs = [ "..:common_inherited_config" ]
547
548 deps = [
549 ":ObjCNativeAPIDemo_lib",
550 ]
551
552 if (target_cpu == "x86") {
553 deps += [ "//testing/iossim:iossim" ]
554 }
555 }
tkchin2ddfdba2016-08-07 21:37:45 -0700556 }
557
558 if (is_mac) {
denicija77bfd7c2016-11-15 00:41:26 -0800559 rtc_static_library("AppRTCMobile_lib") {
kjellander1993b1d2017-03-06 00:29:21 -0800560 testonly = true
tkchin2ddfdba2016-08-07 21:37:45 -0700561 sources = [
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200562 "objc/AppRTCMobile/mac/APPRTCAppDelegate.h",
563 "objc/AppRTCMobile/mac/APPRTCAppDelegate.m",
564 "objc/AppRTCMobile/mac/APPRTCViewController.h",
565 "objc/AppRTCMobile/mac/APPRTCViewController.m",
tkchin2ddfdba2016-08-07 21:37:45 -0700566 ]
jianjun.zhuc0247402017-07-11 06:20:45 -0700567 configs += [ "..:common_objc" ]
tkchin2ddfdba2016-08-07 21:37:45 -0700568 deps = [
569 ":apprtc_common",
570 ":apprtc_signaling",
Kári Tristan Helgason99bf77c2018-02-16 10:49:22 +0100571 "../sdk:default_codec_factory_objc",
Mirko Bonadei1a339c32017-12-14 13:06:10 +0100572 "../sdk:metal_objc",
Mirko Bonadeicbaaaed2018-02-19 15:14:04 +0100573 "../sdk:peerconnectionfactory_base_objc",
kthelgason36d658d2017-08-24 05:43:45 -0700574 "../sdk:ui_objc",
Mirko Bonadeicbaaaed2018-02-19 15:14:04 +0100575 "../sdk:videocapture_objc",
576 "../sdk:videocodec_objc",
Kári Tristan Helgason99bf77c2018-02-16 10:49:22 +0100577 "../sdk:videocodec_objc",
578 "../sdk:videotoolbox_objc",
tkchin2ddfdba2016-08-07 21:37:45 -0700579 ]
580 }
581
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200582 mac_app_bundle("AppRTCMobile") {
kjellander1993b1d2017-03-06 00:29:21 -0800583 testonly = true
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200584 output_name = "AppRTCMobile"
tkchin2ddfdba2016-08-07 21:37:45 -0700585
tkchin2ddfdba2016-08-07 21:37:45 -0700586 sources = [
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200587 "objc/AppRTCMobile/mac/main.m",
tkchin2ddfdba2016-08-07 21:37:45 -0700588 ]
589
590 public_configs = [ "..:common_inherited_config" ]
591
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200592 info_plist = "objc/AppRTCMobile/mac/Info.plist"
tkchin2ddfdba2016-08-07 21:37:45 -0700593
594 libs = [ "AppKit.framework" ]
595
596 deps = [
denicija77bfd7c2016-11-15 00:41:26 -0800597 ":AppRTCMobile_lib",
tkchin2ddfdba2016-08-07 21:37:45 -0700598 ]
599 }
600 }
601
602 config("socketrocket_include_config") {
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200603 include_dirs = [ "objc/AppRTCMobile/third_party/SocketRocket" ]
tkchin2ddfdba2016-08-07 21:37:45 -0700604 }
605
606 config("socketrocket_warning_config") {
607 # GN orders flags on a target before flags from configs. The default config
608 # adds these flags so to cancel them out they need to come from a config and
609 # cannot be on the target directly.
610 cflags = [
611 "-Wno-deprecated-declarations",
612 "-Wno-nonnull",
tkchin2ddfdba2016-08-07 21:37:45 -0700613 "-Wno-semicolon-before-method-body",
kthelgasone47de1a2017-02-24 01:56:01 -0800614 "-Wno-unused-variable",
tkchin2ddfdba2016-08-07 21:37:45 -0700615 ]
616
henrika27d8b612016-09-21 04:13:00 -0700617 cflags_objc = [
618 # Enabled for cflags_objc in build/config/compiler/BUILD.gn.
619 "-Wno-objc-missing-property-synthesis",
henrika27d8b612016-09-21 04:13:00 -0700620 ]
tkchin2ddfdba2016-08-07 21:37:45 -0700621 }
622
kjellanderb62dbbe2016-09-23 00:38:52 -0700623 rtc_static_library("socketrocket") {
kjellander1993b1d2017-03-06 00:29:21 -0800624 testonly = true
tkchin2ddfdba2016-08-07 21:37:45 -0700625 sources = [
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200626 "objc/AppRTCMobile/third_party/SocketRocket/SRWebSocket.h",
627 "objc/AppRTCMobile/third_party/SocketRocket/SRWebSocket.m",
tkchin2ddfdba2016-08-07 21:37:45 -0700628 ]
kthelgasonc0977102017-04-24 00:57:16 -0700629 configs += [ ":socketrocket_warning_config" ]
ehmaldonadoe9cc6862016-09-05 06:10:18 -0700630 public_configs = [ ":socketrocket_include_config" ]
tkchin2ddfdba2016-08-07 21:37:45 -0700631
632 libs = [
633 "CFNetwork.framework",
634 "icucore",
635 ]
636 }
adam.fedorbcc5d872016-11-07 14:53:28 -0800637
638 if (rtc_include_tests) {
kthelgason4065a572017-02-14 04:58:56 -0800639 # TODO(kthelgason): compile xctests on mac when chromium supports it.
640 if (is_ios) {
641 rtc_source_set("apprtcmobile_test_sources") {
Mirko Bonadeicbaaaed2018-02-19 15:14:04 +0100642 # iOS must use WebRTC.framework which is dynamically linked.
643 # 'gn check' is disabled in order to avoid confusion and
644 # errors caused by multiple implementations.
645 check_includes = false
kjellander1993b1d2017-03-06 00:29:21 -0800646 testonly = true
kthelgason4065a572017-02-14 04:58:56 -0800647 include_dirs = [
648 "objc/AppRTCMobile",
649 "objc/AppRTCMobile/ios",
650 ]
651 testonly = true
652 sources = [
653 "objc/AppRTCMobile/tests/ARDAppClient_xctest.mm",
Daniela012b56b2017-11-15 13:15:24 +0100654 "objc/AppRTCMobile/tests/ARDFileCaptureController_xctest.mm",
kthelgason4065a572017-02-14 04:58:56 -0800655 "objc/AppRTCMobile/tests/ARDSettingsModel_xctest.mm",
656 ]
kjellander1993b1d2017-03-06 00:29:21 -0800657 deps = [
kthelgason4065a572017-02-14 04:58:56 -0800658 ":AppRTCMobile_ios_frameworks",
659 ":AppRTCMobile_lib",
Mirko Bonadeicbaaaed2018-02-19 15:14:04 +0100660 ":apprtc_signaling",
Mirko Bonadei1a339c32017-12-14 13:06:10 +0100661 "../rtc_base:rtc_base",
662 "../sdk:framework_objc",
kthelgason4065a572017-02-14 04:58:56 -0800663 "//build/config/ios:xctest",
664 "//third_party/ocmock",
665 ]
adam.fedorbcc5d872016-11-07 14:53:28 -0800666 }
667
kthelgason4065a572017-02-14 04:58:56 -0800668 rtc_ios_xctest_test("apprtcmobile_tests") {
669 info_plist = "objc/AppRTCMobile/ios/Info.plist"
670 sources = [
671 "objc/AppRTCMobile/ios/main.m",
672 ]
673 deps = [
Mirko Bonadeicbaaaed2018-02-19 15:14:04 +0100674 ":AppRTCMobile_lib",
kthelgason4065a572017-02-14 04:58:56 -0800675 ":apprtcmobile_test_sources",
Mirko Bonadei1a339c32017-12-14 13:06:10 +0100676 "../sdk:framework_objc",
kthelgason4065a572017-02-14 04:58:56 -0800677 ]
678 ldflags = [ "-all_load" ]
679 }
adam.fedorbcc5d872016-11-07 14:53:28 -0800680 }
681 }
tkchin2ddfdba2016-08-07 21:37:45 -0700682}
kthelgason0727f152016-08-08 09:03:23 -0700683
684if (is_linux || is_win) {
ehmaldonadod02fe4b2016-08-26 13:31:24 -0700685 config("peerconnection_client_warnings_config") {
kjellander4a9abad2016-09-18 08:12:29 -0700686 cflags = []
ehmaldonadod02fe4b2016-08-26 13:31:24 -0700687 if (is_win && is_clang) {
kjellander4a9abad2016-09-18 08:12:29 -0700688 cflags += [
ehmaldonadod02fe4b2016-08-26 13:31:24 -0700689 # Disable warnings failing when compiling with Clang on Windows.
690 # https://bugs.chromium.org/p/webrtc/issues/detail?id=5366
691 "-Wno-format",
692
693 # See https://bugs.chromium.org/p/webrtc/issues/detail?id=6271
694 # for -Wno-reorder and -Wno-sign-compare
695 "-Wno-reorder",
696 "-Wno-sign-compare",
697 ]
698 }
kjellanderd4626e52016-09-07 02:33:01 -0700699 if (is_linux && target_cpu == "x86") {
kjellander4a9abad2016-09-18 08:12:29 -0700700 cflags += [
kjellanderd4626e52016-09-07 02:33:01 -0700701 # Needed to compile on Linux 32-bit.
702 "-Wno-sentinel",
703 ]
704 }
ehmaldonadod02fe4b2016-08-26 13:31:24 -0700705 }
706
ehmaldonado38a21322016-09-02 04:10:34 -0700707 rtc_executable("peerconnection_client") {
kjellander1993b1d2017-03-06 00:29:21 -0800708 testonly = true
kthelgason0727f152016-08-08 09:03:23 -0700709 sources = [
710 "peerconnection/client/conductor.cc",
711 "peerconnection/client/conductor.h",
712 "peerconnection/client/defaults.cc",
713 "peerconnection/client/defaults.h",
714 "peerconnection/client/peer_connection_client.cc",
715 "peerconnection/client/peer_connection_client.h",
716 ]
ehmaldonado7a2ce0b2016-09-05 01:35:44 -0700717
kjellandere40a7ee2016-10-16 23:56:12 -0700718 if (!build_with_chromium && is_clang) {
719 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
ehmaldonado38a21322016-09-02 04:10:34 -0700720 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
kthelgason0727f152016-08-08 09:03:23 -0700721 }
Patrik Höglundb5b5bce2017-11-13 10:19:58 +0100722 deps = [
Mirko Bonadei34814c72018-01-11 10:13:56 +0100723 "../api:libjingle_peerconnection_api",
Niels Möllerc6ce9c52018-05-11 11:15:30 +0200724 "../api/video:video_frame_i420",
Patrik Höglunda8005cf2017-12-13 16:05:42 +0100725 "../rtc_base:checks",
Patrik Höglund3e113432017-12-15 14:40:10 +0100726 "../rtc_base:stringutils",
Patrik Höglundb5b5bce2017-11-13 10:19:58 +0100727 ]
kthelgason0727f152016-08-08 09:03:23 -0700728 if (is_win) {
729 sources += [
730 "peerconnection/client/flagdefs.h",
731 "peerconnection/client/main.cc",
732 "peerconnection/client/main_wnd.cc",
733 "peerconnection/client/main_wnd.h",
734 ]
735 cflags = [ "/wd4245" ]
736 configs += [ "//build/config/win:windowed" ]
jianjun.zhuc0247402017-07-11 06:20:45 -0700737 deps += [ "../media:rtc_media_base" ]
kthelgason0727f152016-08-08 09:03:23 -0700738 }
739 if (is_linux) {
740 sources += [
741 "peerconnection/client/linux/main.cc",
742 "peerconnection/client/linux/main_wnd.cc",
743 "peerconnection/client/linux/main_wnd.h",
744 ]
Henrik Kjellanderefbde2c2017-03-27 08:28:27 +0200745 cflags = [ "-Wno-deprecated-declarations" ]
kthelgason0727f152016-08-08 09:03:23 -0700746 libs = [
747 "X11",
748 "Xcomposite",
749 "Xext",
750 "Xrender",
751 ]
thomasandersonef16e992016-12-13 02:57:43 -0800752 deps += [ "//build/config/linux/gtk" ]
kthelgason0727f152016-08-08 09:03:23 -0700753 }
ehmaldonadod02fe4b2016-08-26 13:31:24 -0700754 configs += [ ":peerconnection_client_warnings_config" ]
kjellander1993b1d2017-03-06 00:29:21 -0800755
756 deps += [
Niels Möller8366e172018-02-14 12:20:13 +0100757 "../api:libjingle_peerconnection_api",
jianjun.zhuc0247402017-07-11 06:20:45 -0700758 "../api:libjingle_peerconnection_test_api",
Karl Wiberg1b0eae32017-10-17 14:48:54 +0200759 "../api/audio_codecs:builtin_audio_decoder_factory",
760 "../api/audio_codecs:builtin_audio_encoder_factory",
Niels Möllerc6ce9c52018-05-11 11:15:30 +0200761 "../api/video:video_frame",
Anders Carlsson67537952018-05-03 11:28:29 +0200762 "../api/video_codecs:builtin_video_decoder_factory",
763 "../api/video_codecs:builtin_video_encoder_factory",
Mirko Bonadei75baa492018-01-11 17:07:30 +0100764 "../media:rtc_audio_video",
Anders Carlsson67537952018-05-03 11:28:29 +0200765 "../modules/audio_device:audio_device",
766 "../modules/audio_processing:audio_processing",
jianjun.zhuc0247402017-07-11 06:20:45 -0700767 "../modules/video_capture:video_capture_module",
768 "../pc:libjingle_peerconnection",
ehmaldonadof6a861a2017-07-19 10:40:47 -0700769 "../rtc_base:rtc_base",
770 "../rtc_base:rtc_base_approved",
771 "../rtc_base:rtc_json",
jianjun.zhuc0247402017-07-11 06:20:45 -0700772 "../system_wrappers:field_trial_default",
773 "../system_wrappers:metrics_default",
Ilya Nikolaevskiy2ffe3e82018-01-17 19:57:24 +0000774 "../system_wrappers:runtime_enabled_features_default",
kjellander1993b1d2017-03-06 00:29:21 -0800775 "//third_party/libyuv",
kjellander1993b1d2017-03-06 00:29:21 -0800776 ]
kthelgason0727f152016-08-08 09:03:23 -0700777 }
kjellanderd4626e52016-09-07 02:33:01 -0700778
ehmaldonado38a21322016-09-02 04:10:34 -0700779 rtc_executable("peerconnection_server") {
kjellander1993b1d2017-03-06 00:29:21 -0800780 testonly = true
kthelgason0727f152016-08-08 09:03:23 -0700781 sources = [
782 "peerconnection/server/data_socket.cc",
783 "peerconnection/server/data_socket.h",
784 "peerconnection/server/main.cc",
785 "peerconnection/server/peer_channel.cc",
786 "peerconnection/server/peer_channel.h",
787 "peerconnection/server/utils.cc",
788 "peerconnection/server/utils.h",
789 ]
790 deps = [
jianjun.zhuc0247402017-07-11 06:20:45 -0700791 "..:webrtc_common",
ehmaldonadof6a861a2017-07-19 10:40:47 -0700792 "../rtc_base:rtc_base_approved",
Patrik Höglund3e113432017-12-15 14:40:10 +0100793 "../rtc_base:stringutils",
jianjun.zhuc0247402017-07-11 06:20:45 -0700794 "../rtc_tools:command_line_parser",
kthelgason0727f152016-08-08 09:03:23 -0700795 ]
kjellandere40a7ee2016-10-16 23:56:12 -0700796 if (!build_with_chromium && is_clang) {
797 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
ehmaldonado38a21322016-09-02 04:10:34 -0700798 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
kthelgason0727f152016-08-08 09:03:23 -0700799 }
800 }
ehmaldonado38a21322016-09-02 04:10:34 -0700801 rtc_executable("relayserver") {
kjellander1993b1d2017-03-06 00:29:21 -0800802 testonly = true
kthelgason0727f152016-08-08 09:03:23 -0700803 sources = [
804 "relayserver/relayserver_main.cc",
805 ]
806 deps = [
jianjun.zhuc0247402017-07-11 06:20:45 -0700807 "../p2p:rtc_p2p",
808 "../pc:rtc_pc",
ehmaldonadof6a861a2017-07-19 10:40:47 -0700809 "../rtc_base:rtc_base",
810 "../rtc_base:rtc_base_approved",
jianjun.zhuc0247402017-07-11 06:20:45 -0700811 "../system_wrappers:field_trial_default",
812 "../system_wrappers:metrics_default",
Ilya Nikolaevskiy2ffe3e82018-01-17 19:57:24 +0000813 "../system_wrappers:runtime_enabled_features_default",
kthelgason0727f152016-08-08 09:03:23 -0700814 ]
kjellandere40a7ee2016-10-16 23:56:12 -0700815 if (!build_with_chromium && is_clang) {
816 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
ehmaldonado38a21322016-09-02 04:10:34 -0700817 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
kthelgason0727f152016-08-08 09:03:23 -0700818 }
819 }
ehmaldonado38a21322016-09-02 04:10:34 -0700820 rtc_executable("turnserver") {
kjellander1993b1d2017-03-06 00:29:21 -0800821 testonly = true
kthelgason0727f152016-08-08 09:03:23 -0700822 sources = [
823 "turnserver/turnserver_main.cc",
824 ]
825 deps = [
jianjun.zhuc0247402017-07-11 06:20:45 -0700826 "../p2p:rtc_p2p",
827 "../pc:rtc_pc",
ehmaldonadof6a861a2017-07-19 10:40:47 -0700828 "../rtc_base:rtc_base",
829 "../rtc_base:rtc_base_approved",
jianjun.zhuc0247402017-07-11 06:20:45 -0700830 "../system_wrappers:field_trial_default",
831 "../system_wrappers:metrics_default",
Ilya Nikolaevskiy2ffe3e82018-01-17 19:57:24 +0000832 "../system_wrappers:runtime_enabled_features_default",
kthelgason0727f152016-08-08 09:03:23 -0700833 ]
kjellandere40a7ee2016-10-16 23:56:12 -0700834 if (!build_with_chromium && is_clang) {
835 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
ehmaldonado38a21322016-09-02 04:10:34 -0700836 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
kthelgason0727f152016-08-08 09:03:23 -0700837 }
838 }
ehmaldonado38a21322016-09-02 04:10:34 -0700839 rtc_executable("stunserver") {
kjellander1993b1d2017-03-06 00:29:21 -0800840 testonly = true
kthelgason0727f152016-08-08 09:03:23 -0700841 sources = [
842 "stunserver/stunserver_main.cc",
843 ]
844 deps = [
jianjun.zhuc0247402017-07-11 06:20:45 -0700845 "../p2p:rtc_p2p",
846 "../pc:rtc_pc",
ehmaldonadof6a861a2017-07-19 10:40:47 -0700847 "../rtc_base:rtc_base",
848 "../rtc_base:rtc_base_approved",
jianjun.zhuc0247402017-07-11 06:20:45 -0700849 "../system_wrappers:field_trial_default",
850 "../system_wrappers:metrics_default",
Ilya Nikolaevskiy2ffe3e82018-01-17 19:57:24 +0000851 "../system_wrappers:runtime_enabled_features_default",
kthelgason0727f152016-08-08 09:03:23 -0700852 ]
kjellandere40a7ee2016-10-16 23:56:12 -0700853 if (!build_with_chromium && is_clang) {
854 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
ehmaldonado38a21322016-09-02 04:10:34 -0700855 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
kthelgason0727f152016-08-08 09:03:23 -0700856 }
857 }
858}
charujainaca3a242016-11-01 03:09:15 -0700859
qiangchen42f96d52017-08-08 17:08:03 -0700860if (is_win || is_android) {
gyzhouad7cad82017-05-11 16:10:03 -0700861 rtc_shared_library("webrtc_unity_plugin") {
862 testonly = true
863 sources = [
864 "unityplugin/simple_peer_connection.cc",
865 "unityplugin/simple_peer_connection.h",
866 "unityplugin/unity_plugin_apis.cc",
867 "unityplugin/unity_plugin_apis.h",
gyzhoub38f3862017-07-25 16:04:31 -0700868 "unityplugin/video_observer.cc",
869 "unityplugin/video_observer.h",
gyzhouad7cad82017-05-11 16:10:03 -0700870 ]
qiangchen42f96d52017-08-08 17:08:03 -0700871
872 if (is_android) {
873 sources += [
874 "unityplugin/classreferenceholder.cc",
875 "unityplugin/classreferenceholder.h",
876 "unityplugin/jni_onload.cc",
877 ]
Qiang Chen43fb9122017-12-20 10:47:36 -0800878 suppressed_configs += [ "//build/config/android:hide_all_but_jni_onload" ]
qiangchen42f96d52017-08-08 17:08:03 -0700879 }
880
gyzhouad7cad82017-05-11 16:10:03 -0700881 if (!build_with_chromium && is_clang) {
882 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
883 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
884 }
qiangchen42f96d52017-08-08 17:08:03 -0700885 if (is_win) {
886 cflags = [ "/wd4245" ]
887 configs += [
888 "//build/config/win:windowed",
889 ":peerconnection_client_warnings_config",
890 ]
891 }
gyzhouad7cad82017-05-11 16:10:03 -0700892 deps = [
Mirko Bonadei34814c72018-01-11 10:13:56 +0100893 "../api:libjingle_peerconnection_api",
jianjun.zhuc0247402017-07-11 06:20:45 -0700894 "../api:libjingle_peerconnection_test_api",
Qiang Chen51e20462017-12-05 11:11:21 -0800895 "../api/audio_codecs:builtin_audio_decoder_factory",
896 "../api/audio_codecs:builtin_audio_encoder_factory",
Niels Möllerc6ce9c52018-05-11 11:15:30 +0200897 "../api/video:video_frame",
Mirko Bonadei75baa492018-01-11 17:07:30 +0100898 "../media:rtc_audio_video",
Anders Carlssona114c882018-01-04 15:10:22 +0100899 "../media:rtc_internal_video_codecs",
jianjun.zhuc0247402017-07-11 06:20:45 -0700900 "../media:rtc_media",
901 "../media:rtc_media_base",
Qiang Chen43fb9122017-12-20 10:47:36 -0800902 "../modules/audio_device:audio_device",
903 "../modules/audio_processing:audio_processing",
jianjun.zhuc0247402017-07-11 06:20:45 -0700904 "../modules/video_capture:video_capture_module",
905 "../pc:libjingle_peerconnection",
qiangchen42f96d52017-08-08 17:08:03 -0700906 "../rtc_base:rtc_base",
jianjun.zhuc0247402017-07-11 06:20:45 -0700907 "../system_wrappers:field_trial_default",
908 "../system_wrappers:metrics_default",
Ilya Nikolaevskiy2ffe3e82018-01-17 19:57:24 +0000909 "../system_wrappers:runtime_enabled_features_default",
gyzhouad7cad82017-05-11 16:10:03 -0700910 ]
qiangchen42f96d52017-08-08 17:08:03 -0700911 if (is_android) {
George Zhou2770c3d2018-03-07 09:58:54 -0800912 deps += [
913 "../modules/utility:utility",
914 "../sdk/android:libjingle_peerconnection_jni",
915 ]
qiangchen42f96d52017-08-08 17:08:03 -0700916 }
917 }
918}
919
920if (is_android) {
Mirko Bonadeifbb3b7d2017-11-07 15:36:33 +0000921 rtc_android_library("webrtc_unity_java") {
qiangchen42f96d52017-08-08 17:08:03 -0700922 java_files = [ "unityplugin/java/src/org/webrtc/UnityUtility.java" ]
923 deps = [
924 "../rtc_base:base_java",
925 "../sdk/android:libjingle_peerconnection_java",
926 ]
927 }
928
929 dist_jar("libwebrtc_unity") {
930 _target_dir_name = get_label_info(":$target_name", "dir")
931 output = "${root_out_dir}/lib.java${_target_dir_name}/${target_name}.jar"
George Zhou2770c3d2018-03-07 09:58:54 -0800932 direct_deps_only = false
qiangchen42f96d52017-08-08 17:08:03 -0700933 use_interface_jars = false
George Zhou2770c3d2018-03-07 09:58:54 -0800934 use_unprocessed_jars = false
Oleh Prypin86021d92017-09-24 22:29:06 +0200935 requires_android = true
qiangchen42f96d52017-08-08 17:08:03 -0700936 deps = [
937 ":webrtc_unity_java",
Paulina Hensman17071682018-03-26 16:10:29 +0200938 "../modules/audio_device:audio_device_java",
qiangchen42f96d52017-08-08 17:08:03 -0700939 "../rtc_base:base_java",
940 "../sdk/android:libjingle_peerconnection_java",
941 "../sdk/android:libjingle_peerconnection_metrics_default_java",
942 ]
gyzhouad7cad82017-05-11 16:10:03 -0700943 }
944}
945
charujainaca3a242016-11-01 03:09:15 -0700946if (!build_with_chromium) {
947 # Doesn't build within Chrome on Win.
948 rtc_executable("stun_prober") {
kjellander1993b1d2017-03-06 00:29:21 -0800949 testonly = true
charujainaca3a242016-11-01 03:09:15 -0700950 sources = [
951 "stunprober/main.cc",
952 ]
953
954 if (!build_with_chromium && is_clang) {
955 # Suppress warnings from Chrome's Clang plugins.
956 # See http://code.google.com/p/webrtc/issues/detail?id=163 for details.
957 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
958 }
959
960 deps = [
961 "../p2p:libstunprober",
962 "../p2p:rtc_p2p",
Patrik Höglunda8005cf2017-12-13 16:05:42 +0100963 "../rtc_base:checks",
ehmaldonadof6a861a2017-07-19 10:40:47 -0700964 "../rtc_base:rtc_base",
965 "../rtc_base:rtc_base_approved",
Patrik Höglund3e113432017-12-15 14:40:10 +0100966 "../rtc_base:stringutils",
charujainaca3a242016-11-01 03:09:15 -0700967 "../system_wrappers:field_trial_default",
968 ]
969 }
970}