blob: bdb70f3b1351f32530fd8ec19f87f43fbe73239e [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
Sami Kalliomäki06e363a2018-03-22 13:42:50 +0100109 javac_args = [
110 "-Xep:ParameterNotNullable:ERROR",
111 "-Xep:FieldMissingNullable:ERROR",
112 "-Xep:ReturnMissingNullable:ERROR",
113 ]
114
Sami Kalliomaki9c0c75b2016-06-29 14:55:00 +0200115 deps = [
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200116 ":AppRTCMobile_resources",
Paulina Hensman17071682018-03-26 16:10:29 +0200117 "../modules/audio_device:audio_device_java",
jianjun.zhuc0247402017-07-11 06:20:45 -0700118 "../rtc_base:base_java",
119 "../sdk/android:libjingle_peerconnection_java",
120 "../sdk/android:libjingle_peerconnection_metrics_default_java",
121 "androidapp/third_party/autobanh:autobanh_java",
Sami Kalliomäki06e363a2018-03-22 13:42:50 +0100122 "//third_party/jsr-305:jsr_305_javalib",
Sami Kalliomaki9c0c75b2016-06-29 14:55:00 +0200123 ]
124 }
125
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200126 android_resources("AppRTCMobile_resources") {
kjellander1993b1d2017-03-06 00:29:21 -0800127 testonly = true
Sami Kalliomaki9c0c75b2016-06-29 14:55:00 +0200128 resource_dirs = [ "androidapp/res" ]
129 custom_package = "org.appspot.apprtc"
130 }
131
Mirko Bonadeifbb3b7d2017-11-07 15:36:33 +0000132 rtc_instrumentation_test_apk("AppRTCMobileTest") {
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200133 apk_name = "AppRTCMobileTest"
Sami Kalliomaki9c0c75b2016-06-29 14:55:00 +0200134 android_manifest = "androidtests/AndroidManifest.xml"
135
Patrik Höglunda8005cf2017-12-13 16:05:42 +0100136 java_files = [
137 "androidtests/src/org/appspot/apprtc/test/PeerConnectionClientTest.java",
138 ]
Sami Kalliomaki9c0c75b2016-06-29 14:55:00 +0200139
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200140 apk_under_test = ":AppRTCMobile"
Sami Kalliomaki9c0c75b2016-06-29 14:55:00 +0200141
142 deps = [
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200143 ":AppRTCMobile_javalib",
jianjun.zhuc0247402017-07-11 06:20:45 -0700144 "../sdk/android:libjingle_peerconnection_java",
sakalcb79d512017-01-11 06:21:26 -0800145 "//third_party/android_support_test_runner:runner_java",
146 "//third_party/junit",
Sami Kalliomaki9c0c75b2016-06-29 14:55:00 +0200147 ]
148 }
mandermoa6069e82017-01-16 02:23:09 -0800149
Mirko Bonadeifbb3b7d2017-11-07 15:36:33 +0000150 rtc_instrumentation_test_apk("AppRTCMobileTestStubbedVideoIO") {
mandermoa6069e82017-01-16 02:23:09 -0800151 apk_name = "AppRTCMobileTestStubbedVideoIO"
152 android_manifest = "androidtests/AndroidManifest.xml"
153
oprypin30cda5e2017-04-24 04:15:13 -0700154 java_files = [ "androidtests/src/org/appspot/apprtc/test/CallActivityStubbedInputOutputTest.java" ]
mandermoa6069e82017-01-16 02:23:09 -0800155
156 apk_under_test = ":AppRTCMobile"
157
158 deps = [
159 ":AppRTCMobile_javalib",
jianjun.zhuc0247402017-07-11 06:20:45 -0700160 "../sdk/android:libjingle_peerconnection_java",
mandermoa6069e82017-01-16 02:23:09 -0800161 "//third_party/android_support_test_runner:rules_java",
162 "//third_party/android_support_test_runner:runner_java",
163 "//third_party/espresso:espresso_all_java",
164 "//third_party/hamcrest:hamcrest_java",
165 "//third_party/junit",
mandermoa6069e82017-01-16 02:23:09 -0800166 ]
167
168 data = [
Edward Lemur70ba9b42018-01-22 13:46:58 +0100169 "../build/android/adb_reverse_forwarder.py",
170 "../examples/androidtests/video_quality_loopback_test.py",
Mirko Bonadei92ea95e2017-09-15 06:47:31 +0200171 "../resources/reference_video_640x360_30fps.y4m",
Edward Lemur70ba9b42018-01-22 13:46:58 +0100172 "../rtc_tools/barcode_tools/barcode_decoder.py",
173 "../rtc_tools/barcode_tools/helper_functions.py",
174 "../rtc_tools/compare_videos.py",
175 "../rtc_tools/testing/prebuilt_apprtc.zip",
176 "../rtc_tools/testing/golang/linux/go.tar.gz",
177 "../rtc_tools/testing/build_apprtc.py",
178 "../rtc_tools/testing/utils.py",
179 "../tools_webrtc/video_quality_toolchain/linux/ffmpeg",
180 "../tools_webrtc/video_quality_toolchain/linux/frame_analyzer",
181 "../tools_webrtc/video_quality_toolchain/linux/zxing",
mandermoa6069e82017-01-16 02:23:09 -0800182 ]
183 }
Sami Kalliomaki9c0c75b2016-06-29 14:55:00 +0200184}
tkchin2ddfdba2016-08-07 21:37:45 -0700185
186if (is_ios || (is_mac && target_cpu != "x86")) {
tkchin2ddfdba2016-08-07 21:37:45 -0700187 config("apprtc_common_config") {
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200188 include_dirs = [ "objc/AppRTCMobile/common" ]
tkchin2ddfdba2016-08-07 21:37:45 -0700189 }
190
kjellanderb62dbbe2016-09-23 00:38:52 -0700191 rtc_static_library("apprtc_common") {
kjellander1993b1d2017-03-06 00:29:21 -0800192 testonly = true
tkchin2ddfdba2016-08-07 21:37:45 -0700193 sources = [
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200194 "objc/AppRTCMobile/common/ARDUtilities.h",
195 "objc/AppRTCMobile/common/ARDUtilities.m",
tkchin2ddfdba2016-08-07 21:37:45 -0700196 ]
ehmaldonadoe9cc6862016-09-05 06:10:18 -0700197 public_configs = [ ":apprtc_common_config" ]
tkchin2ddfdba2016-08-07 21:37:45 -0700198
Kári Tristan Helgason946923a2017-06-02 14:05:56 +0200199 if (is_ios) {
Mirko Bonadeicbaaaed2018-02-19 15:14:04 +0100200 # iOS must use WebRTC.framework which is dynamically linked.
201 # 'gn check' is disabled in order to avoid confusion and
202 # errors caused by multiple implementations.
203 check_includes = false
kthelgason5901d9d2017-08-16 07:28:03 -0700204 deps = [
Kári Tristan Helgason99bf77c2018-02-16 10:49:22 +0100205 "../sdk:framework_objc",
Mirko Bonadei1a339c32017-12-14 13:06:10 +0100206 "../system_wrappers:field_trial_default",
Ilya Nikolaevskiy2ffe3e82018-01-17 19:57:24 +0000207 "../system_wrappers:runtime_enabled_features_default",
kthelgason5901d9d2017-08-16 07:28:03 -0700208 ]
Kári Tristan Helgason946923a2017-06-02 14:05:56 +0200209 } else {
kthelgason5901d9d2017-08-16 07:28:03 -0700210 deps = [
kthelgason36d658d2017-08-24 05:43:45 -0700211 "../sdk:common_objc",
kthelgason5901d9d2017-08-16 07:28:03 -0700212 "../system_wrappers:field_trial_default",
213 "../system_wrappers:metrics_default",
Ilya Nikolaevskiy2ffe3e82018-01-17 19:57:24 +0000214 "../system_wrappers:runtime_enabled_features_default",
kthelgason5901d9d2017-08-16 07:28:03 -0700215 ]
Kári Tristan Helgason946923a2017-06-02 14:05:56 +0200216 }
tkchin2ddfdba2016-08-07 21:37:45 -0700217 }
218
219 config("apprtc_signaling_config") {
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200220 include_dirs = [ "objc/AppRTCMobile" ]
tkchin2ddfdba2016-08-07 21:37:45 -0700221
222 # GN orders flags on a target before flags from configs. The default config
223 # adds these flags so to cancel them out they need to come from a config and
224 # cannot be on the target directly.
225 cflags = [
226 "-Wno-sign-compare",
227 "-Wno-unused-variable",
228 ]
tkchin2ddfdba2016-08-07 21:37:45 -0700229 }
230
kjellanderb62dbbe2016-09-23 00:38:52 -0700231 rtc_static_library("apprtc_signaling") {
kjellander1993b1d2017-03-06 00:29:21 -0800232 testonly = true
tkchin2ddfdba2016-08-07 21:37:45 -0700233 sources = [
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200234 "objc/AppRTCMobile/ARDAppClient+Internal.h",
235 "objc/AppRTCMobile/ARDAppClient.h",
236 "objc/AppRTCMobile/ARDAppClient.m",
237 "objc/AppRTCMobile/ARDAppEngineClient.h",
238 "objc/AppRTCMobile/ARDAppEngineClient.m",
239 "objc/AppRTCMobile/ARDBitrateTracker.h",
240 "objc/AppRTCMobile/ARDBitrateTracker.m",
sakalc522e752017-04-05 12:17:48 -0700241 "objc/AppRTCMobile/ARDCaptureController.h",
242 "objc/AppRTCMobile/ARDCaptureController.m",
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200243 "objc/AppRTCMobile/ARDJoinResponse+Internal.h",
244 "objc/AppRTCMobile/ARDJoinResponse.h",
245 "objc/AppRTCMobile/ARDJoinResponse.m",
246 "objc/AppRTCMobile/ARDMessageResponse+Internal.h",
247 "objc/AppRTCMobile/ARDMessageResponse.h",
248 "objc/AppRTCMobile/ARDMessageResponse.m",
249 "objc/AppRTCMobile/ARDRoomServerClient.h",
sakalc4adacf2017-03-28 01:22:48 -0700250 "objc/AppRTCMobile/ARDSettingsModel+Private.h",
251 "objc/AppRTCMobile/ARDSettingsModel.h",
252 "objc/AppRTCMobile/ARDSettingsModel.m",
253 "objc/AppRTCMobile/ARDSettingsStore.h",
254 "objc/AppRTCMobile/ARDSettingsStore.m",
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200255 "objc/AppRTCMobile/ARDSignalingChannel.h",
256 "objc/AppRTCMobile/ARDSignalingMessage.h",
257 "objc/AppRTCMobile/ARDSignalingMessage.m",
258 "objc/AppRTCMobile/ARDStatsBuilder.h",
259 "objc/AppRTCMobile/ARDStatsBuilder.m",
kthelgasoncc882af2017-01-13 05:59:46 -0800260 "objc/AppRTCMobile/ARDTURNClient+Internal.h",
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200261 "objc/AppRTCMobile/ARDTURNClient.h",
kthelgasoncc882af2017-01-13 05:59:46 -0800262 "objc/AppRTCMobile/ARDTURNClient.m",
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200263 "objc/AppRTCMobile/ARDWebSocketChannel.h",
264 "objc/AppRTCMobile/ARDWebSocketChannel.m",
265 "objc/AppRTCMobile/RTCIceCandidate+JSON.h",
266 "objc/AppRTCMobile/RTCIceCandidate+JSON.m",
267 "objc/AppRTCMobile/RTCIceServer+JSON.h",
268 "objc/AppRTCMobile/RTCIceServer+JSON.m",
269 "objc/AppRTCMobile/RTCMediaConstraints+JSON.h",
270 "objc/AppRTCMobile/RTCMediaConstraints+JSON.m",
271 "objc/AppRTCMobile/RTCSessionDescription+JSON.h",
272 "objc/AppRTCMobile/RTCSessionDescription+JSON.m",
tkchin2ddfdba2016-08-07 21:37:45 -0700273 ]
ehmaldonadoe9cc6862016-09-05 06:10:18 -0700274 public_configs = [ ":apprtc_signaling_config" ]
tkchin2ddfdba2016-08-07 21:37:45 -0700275 deps = [
276 ":apprtc_common",
277 ":socketrocket",
278 ]
Kári Tristan Helgason946923a2017-06-02 14:05:56 +0200279 if (is_ios) {
Mirko Bonadeicbaaaed2018-02-19 15:14:04 +0100280 # iOS must use WebRTC.framework which is dynamically linked.
281 # 'gn check' is disabled in order to avoid confusion and
282 # errors caused by multiple implementations.
283 check_includes = false
Mirko Bonadei1a339c32017-12-14 13:06:10 +0100284 deps += [
285 ":AppRTCMobile_ios_frameworks",
286 "../sdk:framework_objc",
Kári Tristan Helgason946923a2017-06-02 14:05:56 +0200287 ]
Mirko Bonadei1a339c32017-12-14 13:06:10 +0100288 } else {
Mirko Bonadeicbaaaed2018-02-19 15:14:04 +0100289 deps += [
290 "../sdk:common_objc",
291 "../sdk:mediaconstraints_objc",
292 "../sdk:peerconnectionfactory_base_objc",
293 "../sdk:videocapture_objc",
294 "../sdk:videocodec_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 }
tkchin2ddfdba2016-08-07 21:37:45 -0700298 libs = [ "QuartzCore.framework" ]
299 }
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
357 if (target_cpu == "x86") {
358 deps += [ "//testing/iossim:iossim" ]
359 }
360 }
361
kthelgasond3adbfb2017-01-26 01:14:04 -0800362 bundle_data("AppRTCMobile_ios_frameworks") {
Mirko Bonadei1a339c32017-12-14 13:06:10 +0100363 deps = [
kthelgason36d658d2017-08-24 05:43:45 -0700364 "../sdk:framework_objc+link",
kthelgasond3adbfb2017-01-26 01:14:04 -0800365 ]
366 sources = [
wjywbsbef8a5d2017-10-09 02:32:28 -0400367 "$root_build_dir/WebRTC.framework",
kthelgasond3adbfb2017-01-26 01:14:04 -0800368 ]
369 outputs = [
370 "{{bundle_resources_dir}}/Frameworks/{{source_file_part}}",
371 ]
372 }
373
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200374 bundle_data("AppRTCMobile_ios_bundle_data") {
tkchin2ddfdba2016-08-07 21:37:45 -0700375 sources = [
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200376 "objc/AppRTCMobile/ios/resources/Roboto-Regular.ttf",
Daniela012b56b2017-11-15 13:15:24 +0100377
378 # Sample video taken from https://media.xiph.org/video/derf/
379 "objc/AppRTCMobile/ios/resources/foreman.mp4",
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200380 "objc/AppRTCMobile/ios/resources/iPhone5@2x.png",
381 "objc/AppRTCMobile/ios/resources/iPhone6@2x.png",
382 "objc/AppRTCMobile/ios/resources/iPhone6p@3x.png",
383 "objc/AppRTCMobile/ios/resources/ic_call_end_black_24dp.png",
384 "objc/AppRTCMobile/ios/resources/ic_call_end_black_24dp@2x.png",
385 "objc/AppRTCMobile/ios/resources/ic_clear_black_24dp.png",
386 "objc/AppRTCMobile/ios/resources/ic_clear_black_24dp@2x.png",
denicija6d6762c2016-10-28 04:53:16 -0700387 "objc/AppRTCMobile/ios/resources/ic_settings_black_24dp.png",
388 "objc/AppRTCMobile/ios/resources/ic_settings_black_24dp@2x.png",
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200389 "objc/AppRTCMobile/ios/resources/ic_surround_sound_black_24dp.png",
390 "objc/AppRTCMobile/ios/resources/ic_surround_sound_black_24dp@2x.png",
391 "objc/AppRTCMobile/ios/resources/ic_switch_video_black_24dp.png",
392 "objc/AppRTCMobile/ios/resources/ic_switch_video_black_24dp@2x.png",
393 "objc/AppRTCMobile/ios/resources/mozart.mp3",
anderscb5ed9052017-08-15 04:07:12 -0700394 "objc/Icon-120.png",
395 "objc/Icon-180.png",
tkchin2ddfdba2016-08-07 21:37:45 -0700396 "objc/Icon.png",
397 ]
398 outputs = [
399 "{{bundle_resources_dir}}/{{source_file_part}}",
400 ]
401 }
Anders Carlsson73119182018-03-15 09:41:03 +0100402
403 rtc_static_library("ObjCNativeAPIDemo_lib") {
404 testonly = true
405 sources = [
406 "objcnativeapi/objc/NADAppDelegate.h",
407 "objcnativeapi/objc/NADAppDelegate.m",
408 "objcnativeapi/objc/NADViewController.h",
409 "objcnativeapi/objc/NADViewController.mm",
410 "objcnativeapi/objc/objccallclient.h",
411 "objcnativeapi/objc/objccallclient.mm",
412 ]
413
414 if (!build_with_chromium && is_clang) {
415 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
416 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
417 }
418
419 deps = [
420 "../api:libjingle_peerconnection_api",
421 "../api/audio_codecs:builtin_audio_decoder_factory",
422 "../api/audio_codecs:builtin_audio_encoder_factory",
423 "../logging:rtc_event_log_impl_base",
424 "../media:rtc_audio_video",
425 "../modules/audio_processing:audio_processing",
426 "../pc:libjingle_peerconnection",
427 "../rtc_base:rtc_base",
428 "../sdk:default_codec_factory_objc",
429 "../sdk:framework_objc",
430 "../sdk:native_api",
431 "../sdk:ui_objc",
432 "../sdk:videotoolbox_objc",
433 "../system_wrappers:field_trial_default",
434 "../system_wrappers:metrics_default",
435 "../system_wrappers:runtime_enabled_features_default",
436 ]
437
438 if (current_cpu == "arm64") {
439 deps += [ "../sdk:metal_objc" ]
440 }
441 }
442
443 ios_app_bundle("ObjCNativeAPIDemo") {
444 testonly = true
445 sources = [
446 "objcnativeapi/objc/main.m",
447 ]
448
449 info_plist = "objcnativeapi/Info.plist"
450
451 configs += [ "..:common_config" ]
452 public_configs = [ "..:common_inherited_config" ]
453
454 deps = [
455 ":ObjCNativeAPIDemo_lib",
456 ]
457
458 if (target_cpu == "x86") {
459 deps += [ "//testing/iossim:iossim" ]
460 }
461 }
tkchin2ddfdba2016-08-07 21:37:45 -0700462 }
463
464 if (is_mac) {
denicija77bfd7c2016-11-15 00:41:26 -0800465 rtc_static_library("AppRTCMobile_lib") {
kjellander1993b1d2017-03-06 00:29:21 -0800466 testonly = true
tkchin2ddfdba2016-08-07 21:37:45 -0700467 sources = [
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200468 "objc/AppRTCMobile/mac/APPRTCAppDelegate.h",
469 "objc/AppRTCMobile/mac/APPRTCAppDelegate.m",
470 "objc/AppRTCMobile/mac/APPRTCViewController.h",
471 "objc/AppRTCMobile/mac/APPRTCViewController.m",
tkchin2ddfdba2016-08-07 21:37:45 -0700472 ]
jianjun.zhuc0247402017-07-11 06:20:45 -0700473 configs += [ "..:common_objc" ]
tkchin2ddfdba2016-08-07 21:37:45 -0700474 deps = [
475 ":apprtc_common",
476 ":apprtc_signaling",
Kári Tristan Helgason99bf77c2018-02-16 10:49:22 +0100477 "../sdk:default_codec_factory_objc",
Mirko Bonadei1a339c32017-12-14 13:06:10 +0100478 "../sdk:metal_objc",
Mirko Bonadeicbaaaed2018-02-19 15:14:04 +0100479 "../sdk:peerconnectionfactory_base_objc",
kthelgason36d658d2017-08-24 05:43:45 -0700480 "../sdk:ui_objc",
Mirko Bonadeicbaaaed2018-02-19 15:14:04 +0100481 "../sdk:videocapture_objc",
482 "../sdk:videocodec_objc",
Kári Tristan Helgason99bf77c2018-02-16 10:49:22 +0100483 "../sdk:videocodec_objc",
484 "../sdk:videotoolbox_objc",
tkchin2ddfdba2016-08-07 21:37:45 -0700485 ]
486 }
487
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200488 mac_app_bundle("AppRTCMobile") {
kjellander1993b1d2017-03-06 00:29:21 -0800489 testonly = true
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200490 output_name = "AppRTCMobile"
tkchin2ddfdba2016-08-07 21:37:45 -0700491
tkchin2ddfdba2016-08-07 21:37:45 -0700492 sources = [
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200493 "objc/AppRTCMobile/mac/main.m",
tkchin2ddfdba2016-08-07 21:37:45 -0700494 ]
495
496 public_configs = [ "..:common_inherited_config" ]
497
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200498 info_plist = "objc/AppRTCMobile/mac/Info.plist"
tkchin2ddfdba2016-08-07 21:37:45 -0700499
500 libs = [ "AppKit.framework" ]
501
502 deps = [
denicija77bfd7c2016-11-15 00:41:26 -0800503 ":AppRTCMobile_lib",
tkchin2ddfdba2016-08-07 21:37:45 -0700504 ]
505 }
506 }
507
508 config("socketrocket_include_config") {
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200509 include_dirs = [ "objc/AppRTCMobile/third_party/SocketRocket" ]
tkchin2ddfdba2016-08-07 21:37:45 -0700510 }
511
512 config("socketrocket_warning_config") {
513 # GN orders flags on a target before flags from configs. The default config
514 # adds these flags so to cancel them out they need to come from a config and
515 # cannot be on the target directly.
516 cflags = [
517 "-Wno-deprecated-declarations",
518 "-Wno-nonnull",
tkchin2ddfdba2016-08-07 21:37:45 -0700519 "-Wno-semicolon-before-method-body",
kthelgasone47de1a2017-02-24 01:56:01 -0800520 "-Wno-unused-variable",
tkchin2ddfdba2016-08-07 21:37:45 -0700521 ]
522
henrika27d8b612016-09-21 04:13:00 -0700523 cflags_objc = [
524 # Enabled for cflags_objc in build/config/compiler/BUILD.gn.
525 "-Wno-objc-missing-property-synthesis",
henrika27d8b612016-09-21 04:13:00 -0700526 ]
tkchin2ddfdba2016-08-07 21:37:45 -0700527 }
528
kjellanderb62dbbe2016-09-23 00:38:52 -0700529 rtc_static_library("socketrocket") {
kjellander1993b1d2017-03-06 00:29:21 -0800530 testonly = true
tkchin2ddfdba2016-08-07 21:37:45 -0700531 sources = [
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200532 "objc/AppRTCMobile/third_party/SocketRocket/SRWebSocket.h",
533 "objc/AppRTCMobile/third_party/SocketRocket/SRWebSocket.m",
tkchin2ddfdba2016-08-07 21:37:45 -0700534 ]
kthelgasonc0977102017-04-24 00:57:16 -0700535 configs += [ ":socketrocket_warning_config" ]
ehmaldonadoe9cc6862016-09-05 06:10:18 -0700536 public_configs = [ ":socketrocket_include_config" ]
tkchin2ddfdba2016-08-07 21:37:45 -0700537
538 libs = [
539 "CFNetwork.framework",
540 "icucore",
541 ]
542 }
adam.fedorbcc5d872016-11-07 14:53:28 -0800543
544 if (rtc_include_tests) {
kthelgason4065a572017-02-14 04:58:56 -0800545 # TODO(kthelgason): compile xctests on mac when chromium supports it.
546 if (is_ios) {
547 rtc_source_set("apprtcmobile_test_sources") {
Mirko Bonadeicbaaaed2018-02-19 15:14:04 +0100548 # iOS must use WebRTC.framework which is dynamically linked.
549 # 'gn check' is disabled in order to avoid confusion and
550 # errors caused by multiple implementations.
551 check_includes = false
kjellander1993b1d2017-03-06 00:29:21 -0800552 testonly = true
kthelgason4065a572017-02-14 04:58:56 -0800553 include_dirs = [
554 "objc/AppRTCMobile",
555 "objc/AppRTCMobile/ios",
556 ]
557 testonly = true
558 sources = [
559 "objc/AppRTCMobile/tests/ARDAppClient_xctest.mm",
Daniela012b56b2017-11-15 13:15:24 +0100560 "objc/AppRTCMobile/tests/ARDFileCaptureController_xctest.mm",
kthelgason4065a572017-02-14 04:58:56 -0800561 "objc/AppRTCMobile/tests/ARDSettingsModel_xctest.mm",
562 ]
kjellander1993b1d2017-03-06 00:29:21 -0800563 deps = [
kthelgason4065a572017-02-14 04:58:56 -0800564 ":AppRTCMobile_ios_frameworks",
565 ":AppRTCMobile_lib",
Mirko Bonadeicbaaaed2018-02-19 15:14:04 +0100566 ":apprtc_signaling",
Mirko Bonadei1a339c32017-12-14 13:06:10 +0100567 "../rtc_base:rtc_base",
568 "../sdk:framework_objc",
kthelgason4065a572017-02-14 04:58:56 -0800569 "//build/config/ios:xctest",
570 "//third_party/ocmock",
571 ]
adam.fedorbcc5d872016-11-07 14:53:28 -0800572 }
573
kthelgason4065a572017-02-14 04:58:56 -0800574 rtc_ios_xctest_test("apprtcmobile_tests") {
575 info_plist = "objc/AppRTCMobile/ios/Info.plist"
576 sources = [
577 "objc/AppRTCMobile/ios/main.m",
578 ]
579 deps = [
Mirko Bonadeicbaaaed2018-02-19 15:14:04 +0100580 ":AppRTCMobile_lib",
kthelgason4065a572017-02-14 04:58:56 -0800581 ":apprtcmobile_test_sources",
Mirko Bonadei1a339c32017-12-14 13:06:10 +0100582 "../sdk:framework_objc",
kthelgason4065a572017-02-14 04:58:56 -0800583 ]
584 ldflags = [ "-all_load" ]
585 }
adam.fedorbcc5d872016-11-07 14:53:28 -0800586 }
587 }
tkchin2ddfdba2016-08-07 21:37:45 -0700588}
kthelgason0727f152016-08-08 09:03:23 -0700589
590if (is_linux || is_win) {
ehmaldonadod02fe4b2016-08-26 13:31:24 -0700591 config("peerconnection_client_warnings_config") {
kjellander4a9abad2016-09-18 08:12:29 -0700592 cflags = []
ehmaldonadod02fe4b2016-08-26 13:31:24 -0700593 if (is_win && is_clang) {
kjellander4a9abad2016-09-18 08:12:29 -0700594 cflags += [
ehmaldonadod02fe4b2016-08-26 13:31:24 -0700595 # Disable warnings failing when compiling with Clang on Windows.
596 # https://bugs.chromium.org/p/webrtc/issues/detail?id=5366
597 "-Wno-format",
598
599 # See https://bugs.chromium.org/p/webrtc/issues/detail?id=6271
600 # for -Wno-reorder and -Wno-sign-compare
601 "-Wno-reorder",
602 "-Wno-sign-compare",
603 ]
604 }
kjellanderd4626e52016-09-07 02:33:01 -0700605 if (is_linux && target_cpu == "x86") {
kjellander4a9abad2016-09-18 08:12:29 -0700606 cflags += [
kjellanderd4626e52016-09-07 02:33:01 -0700607 # Needed to compile on Linux 32-bit.
608 "-Wno-sentinel",
609 ]
610 }
ehmaldonadod02fe4b2016-08-26 13:31:24 -0700611 }
612
ehmaldonado38a21322016-09-02 04:10:34 -0700613 rtc_executable("peerconnection_client") {
kjellander1993b1d2017-03-06 00:29:21 -0800614 testonly = true
kthelgason0727f152016-08-08 09:03:23 -0700615 sources = [
616 "peerconnection/client/conductor.cc",
617 "peerconnection/client/conductor.h",
618 "peerconnection/client/defaults.cc",
619 "peerconnection/client/defaults.h",
620 "peerconnection/client/peer_connection_client.cc",
621 "peerconnection/client/peer_connection_client.h",
622 ]
ehmaldonado7a2ce0b2016-09-05 01:35:44 -0700623
kjellandere40a7ee2016-10-16 23:56:12 -0700624 if (!build_with_chromium && is_clang) {
625 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
ehmaldonado38a21322016-09-02 04:10:34 -0700626 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
kthelgason0727f152016-08-08 09:03:23 -0700627 }
Patrik Höglundb5b5bce2017-11-13 10:19:58 +0100628 deps = [
Mirko Bonadei34814c72018-01-11 10:13:56 +0100629 "../api:libjingle_peerconnection_api",
Patrik Höglundb5b5bce2017-11-13 10:19:58 +0100630 "../api:video_frame_api_i420",
Patrik Höglunda8005cf2017-12-13 16:05:42 +0100631 "../rtc_base:checks",
Patrik Höglund3e113432017-12-15 14:40:10 +0100632 "../rtc_base:stringutils",
Patrik Höglundb5b5bce2017-11-13 10:19:58 +0100633 ]
kthelgason0727f152016-08-08 09:03:23 -0700634 if (is_win) {
635 sources += [
636 "peerconnection/client/flagdefs.h",
637 "peerconnection/client/main.cc",
638 "peerconnection/client/main_wnd.cc",
639 "peerconnection/client/main_wnd.h",
640 ]
641 cflags = [ "/wd4245" ]
642 configs += [ "//build/config/win:windowed" ]
jianjun.zhuc0247402017-07-11 06:20:45 -0700643 deps += [ "../media:rtc_media_base" ]
kthelgason0727f152016-08-08 09:03:23 -0700644 }
645 if (is_linux) {
646 sources += [
647 "peerconnection/client/linux/main.cc",
648 "peerconnection/client/linux/main_wnd.cc",
649 "peerconnection/client/linux/main_wnd.h",
650 ]
Henrik Kjellanderefbde2c2017-03-27 08:28:27 +0200651 cflags = [ "-Wno-deprecated-declarations" ]
kthelgason0727f152016-08-08 09:03:23 -0700652 libs = [
653 "X11",
654 "Xcomposite",
655 "Xext",
656 "Xrender",
657 ]
thomasandersonef16e992016-12-13 02:57:43 -0800658 deps += [ "//build/config/linux/gtk" ]
kthelgason0727f152016-08-08 09:03:23 -0700659 }
ehmaldonadod02fe4b2016-08-26 13:31:24 -0700660 configs += [ ":peerconnection_client_warnings_config" ]
kjellander1993b1d2017-03-06 00:29:21 -0800661
662 deps += [
Niels Möller8366e172018-02-14 12:20:13 +0100663 "../api:libjingle_peerconnection_api",
jianjun.zhuc0247402017-07-11 06:20:45 -0700664 "../api:libjingle_peerconnection_test_api",
665 "../api:video_frame_api",
Karl Wiberg1b0eae32017-10-17 14:48:54 +0200666 "../api/audio_codecs:builtin_audio_decoder_factory",
667 "../api/audio_codecs:builtin_audio_encoder_factory",
Mirko Bonadei75baa492018-01-11 17:07:30 +0100668 "../media:rtc_audio_video",
jianjun.zhuc0247402017-07-11 06:20:45 -0700669 "../modules/video_capture:video_capture_module",
670 "../pc:libjingle_peerconnection",
ehmaldonadof6a861a2017-07-19 10:40:47 -0700671 "../rtc_base:rtc_base",
672 "../rtc_base:rtc_base_approved",
673 "../rtc_base:rtc_json",
jianjun.zhuc0247402017-07-11 06:20:45 -0700674 "../system_wrappers:field_trial_default",
675 "../system_wrappers:metrics_default",
Ilya Nikolaevskiy2ffe3e82018-01-17 19:57:24 +0000676 "../system_wrappers:runtime_enabled_features_default",
kjellander1993b1d2017-03-06 00:29:21 -0800677 "//third_party/libyuv",
kjellander1993b1d2017-03-06 00:29:21 -0800678 ]
kthelgason0727f152016-08-08 09:03:23 -0700679 }
kjellanderd4626e52016-09-07 02:33:01 -0700680
ehmaldonado38a21322016-09-02 04:10:34 -0700681 rtc_executable("peerconnection_server") {
kjellander1993b1d2017-03-06 00:29:21 -0800682 testonly = true
kthelgason0727f152016-08-08 09:03:23 -0700683 sources = [
684 "peerconnection/server/data_socket.cc",
685 "peerconnection/server/data_socket.h",
686 "peerconnection/server/main.cc",
687 "peerconnection/server/peer_channel.cc",
688 "peerconnection/server/peer_channel.h",
689 "peerconnection/server/utils.cc",
690 "peerconnection/server/utils.h",
691 ]
692 deps = [
jianjun.zhuc0247402017-07-11 06:20:45 -0700693 "..:webrtc_common",
ehmaldonadof6a861a2017-07-19 10:40:47 -0700694 "../rtc_base:rtc_base_approved",
Patrik Höglund3e113432017-12-15 14:40:10 +0100695 "../rtc_base:stringutils",
jianjun.zhuc0247402017-07-11 06:20:45 -0700696 "../rtc_tools:command_line_parser",
kthelgason0727f152016-08-08 09:03:23 -0700697 ]
kjellandere40a7ee2016-10-16 23:56:12 -0700698 if (!build_with_chromium && is_clang) {
699 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
ehmaldonado38a21322016-09-02 04:10:34 -0700700 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
kthelgason0727f152016-08-08 09:03:23 -0700701 }
702 }
ehmaldonado38a21322016-09-02 04:10:34 -0700703 rtc_executable("relayserver") {
kjellander1993b1d2017-03-06 00:29:21 -0800704 testonly = true
kthelgason0727f152016-08-08 09:03:23 -0700705 sources = [
706 "relayserver/relayserver_main.cc",
707 ]
708 deps = [
jianjun.zhuc0247402017-07-11 06:20:45 -0700709 "../p2p:rtc_p2p",
710 "../pc:rtc_pc",
ehmaldonadof6a861a2017-07-19 10:40:47 -0700711 "../rtc_base:rtc_base",
712 "../rtc_base:rtc_base_approved",
jianjun.zhuc0247402017-07-11 06:20:45 -0700713 "../system_wrappers:field_trial_default",
714 "../system_wrappers:metrics_default",
Ilya Nikolaevskiy2ffe3e82018-01-17 19:57:24 +0000715 "../system_wrappers:runtime_enabled_features_default",
kthelgason0727f152016-08-08 09:03:23 -0700716 ]
kjellandere40a7ee2016-10-16 23:56:12 -0700717 if (!build_with_chromium && is_clang) {
718 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
ehmaldonado38a21322016-09-02 04:10:34 -0700719 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
kthelgason0727f152016-08-08 09:03:23 -0700720 }
721 }
ehmaldonado38a21322016-09-02 04:10:34 -0700722 rtc_executable("turnserver") {
kjellander1993b1d2017-03-06 00:29:21 -0800723 testonly = true
kthelgason0727f152016-08-08 09:03:23 -0700724 sources = [
725 "turnserver/turnserver_main.cc",
726 ]
727 deps = [
jianjun.zhuc0247402017-07-11 06:20:45 -0700728 "../p2p:rtc_p2p",
729 "../pc:rtc_pc",
ehmaldonadof6a861a2017-07-19 10:40:47 -0700730 "../rtc_base:rtc_base",
731 "../rtc_base:rtc_base_approved",
jianjun.zhuc0247402017-07-11 06:20:45 -0700732 "../system_wrappers:field_trial_default",
733 "../system_wrappers:metrics_default",
Ilya Nikolaevskiy2ffe3e82018-01-17 19:57:24 +0000734 "../system_wrappers:runtime_enabled_features_default",
kthelgason0727f152016-08-08 09:03:23 -0700735 ]
kjellandere40a7ee2016-10-16 23:56:12 -0700736 if (!build_with_chromium && is_clang) {
737 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
ehmaldonado38a21322016-09-02 04:10:34 -0700738 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
kthelgason0727f152016-08-08 09:03:23 -0700739 }
740 }
ehmaldonado38a21322016-09-02 04:10:34 -0700741 rtc_executable("stunserver") {
kjellander1993b1d2017-03-06 00:29:21 -0800742 testonly = true
kthelgason0727f152016-08-08 09:03:23 -0700743 sources = [
744 "stunserver/stunserver_main.cc",
745 ]
746 deps = [
jianjun.zhuc0247402017-07-11 06:20:45 -0700747 "../p2p:rtc_p2p",
748 "../pc:rtc_pc",
ehmaldonadof6a861a2017-07-19 10:40:47 -0700749 "../rtc_base:rtc_base",
750 "../rtc_base:rtc_base_approved",
jianjun.zhuc0247402017-07-11 06:20:45 -0700751 "../system_wrappers:field_trial_default",
752 "../system_wrappers:metrics_default",
Ilya Nikolaevskiy2ffe3e82018-01-17 19:57:24 +0000753 "../system_wrappers:runtime_enabled_features_default",
kthelgason0727f152016-08-08 09:03:23 -0700754 ]
kjellandere40a7ee2016-10-16 23:56:12 -0700755 if (!build_with_chromium && is_clang) {
756 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
ehmaldonado38a21322016-09-02 04:10:34 -0700757 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
kthelgason0727f152016-08-08 09:03:23 -0700758 }
759 }
760}
charujainaca3a242016-11-01 03:09:15 -0700761
qiangchen42f96d52017-08-08 17:08:03 -0700762if (is_win || is_android) {
gyzhouad7cad82017-05-11 16:10:03 -0700763 rtc_shared_library("webrtc_unity_plugin") {
764 testonly = true
765 sources = [
766 "unityplugin/simple_peer_connection.cc",
767 "unityplugin/simple_peer_connection.h",
768 "unityplugin/unity_plugin_apis.cc",
769 "unityplugin/unity_plugin_apis.h",
gyzhoub38f3862017-07-25 16:04:31 -0700770 "unityplugin/video_observer.cc",
771 "unityplugin/video_observer.h",
gyzhouad7cad82017-05-11 16:10:03 -0700772 ]
qiangchen42f96d52017-08-08 17:08:03 -0700773
774 if (is_android) {
775 sources += [
776 "unityplugin/classreferenceholder.cc",
777 "unityplugin/classreferenceholder.h",
778 "unityplugin/jni_onload.cc",
779 ]
Qiang Chen43fb9122017-12-20 10:47:36 -0800780 suppressed_configs += [ "//build/config/android:hide_all_but_jni_onload" ]
qiangchen42f96d52017-08-08 17:08:03 -0700781 }
782
gyzhouad7cad82017-05-11 16:10:03 -0700783 if (!build_with_chromium && is_clang) {
784 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
785 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
786 }
qiangchen42f96d52017-08-08 17:08:03 -0700787 if (is_win) {
788 cflags = [ "/wd4245" ]
789 configs += [
790 "//build/config/win:windowed",
791 ":peerconnection_client_warnings_config",
792 ]
793 }
gyzhouad7cad82017-05-11 16:10:03 -0700794 deps = [
Mirko Bonadei34814c72018-01-11 10:13:56 +0100795 "../api:libjingle_peerconnection_api",
jianjun.zhuc0247402017-07-11 06:20:45 -0700796 "../api:libjingle_peerconnection_test_api",
797 "../api:video_frame_api",
Qiang Chen51e20462017-12-05 11:11:21 -0800798 "../api/audio_codecs:builtin_audio_decoder_factory",
799 "../api/audio_codecs:builtin_audio_encoder_factory",
Mirko Bonadei75baa492018-01-11 17:07:30 +0100800 "../media:rtc_audio_video",
Anders Carlssona114c882018-01-04 15:10:22 +0100801 "../media:rtc_internal_video_codecs",
jianjun.zhuc0247402017-07-11 06:20:45 -0700802 "../media:rtc_media",
803 "../media:rtc_media_base",
Qiang Chen43fb9122017-12-20 10:47:36 -0800804 "../modules/audio_device:audio_device",
805 "../modules/audio_processing:audio_processing",
jianjun.zhuc0247402017-07-11 06:20:45 -0700806 "../modules/video_capture:video_capture_module",
807 "../pc:libjingle_peerconnection",
qiangchen42f96d52017-08-08 17:08:03 -0700808 "../rtc_base:rtc_base",
jianjun.zhuc0247402017-07-11 06:20:45 -0700809 "../system_wrappers:field_trial_default",
810 "../system_wrappers:metrics_default",
Ilya Nikolaevskiy2ffe3e82018-01-17 19:57:24 +0000811 "../system_wrappers:runtime_enabled_features_default",
gyzhouad7cad82017-05-11 16:10:03 -0700812 ]
qiangchen42f96d52017-08-08 17:08:03 -0700813 if (is_android) {
George Zhou2770c3d2018-03-07 09:58:54 -0800814 deps += [
815 "../modules/utility:utility",
816 "../sdk/android:libjingle_peerconnection_jni",
817 ]
qiangchen42f96d52017-08-08 17:08:03 -0700818 }
819 }
820}
821
822if (is_android) {
Mirko Bonadeifbb3b7d2017-11-07 15:36:33 +0000823 rtc_android_library("webrtc_unity_java") {
qiangchen42f96d52017-08-08 17:08:03 -0700824 java_files = [ "unityplugin/java/src/org/webrtc/UnityUtility.java" ]
825 deps = [
826 "../rtc_base:base_java",
827 "../sdk/android:libjingle_peerconnection_java",
828 ]
829 }
830
831 dist_jar("libwebrtc_unity") {
832 _target_dir_name = get_label_info(":$target_name", "dir")
833 output = "${root_out_dir}/lib.java${_target_dir_name}/${target_name}.jar"
George Zhou2770c3d2018-03-07 09:58:54 -0800834 direct_deps_only = false
qiangchen42f96d52017-08-08 17:08:03 -0700835 use_interface_jars = false
George Zhou2770c3d2018-03-07 09:58:54 -0800836 use_unprocessed_jars = false
Oleh Prypin86021d92017-09-24 22:29:06 +0200837 requires_android = true
qiangchen42f96d52017-08-08 17:08:03 -0700838 deps = [
839 ":webrtc_unity_java",
Paulina Hensman17071682018-03-26 16:10:29 +0200840 "../modules/audio_device:audio_device_java",
qiangchen42f96d52017-08-08 17:08:03 -0700841 "../rtc_base:base_java",
842 "../sdk/android:libjingle_peerconnection_java",
843 "../sdk/android:libjingle_peerconnection_metrics_default_java",
844 ]
gyzhouad7cad82017-05-11 16:10:03 -0700845 }
846}
847
charujainaca3a242016-11-01 03:09:15 -0700848if (!build_with_chromium) {
849 # Doesn't build within Chrome on Win.
850 rtc_executable("stun_prober") {
kjellander1993b1d2017-03-06 00:29:21 -0800851 testonly = true
charujainaca3a242016-11-01 03:09:15 -0700852 sources = [
853 "stunprober/main.cc",
854 ]
855
856 if (!build_with_chromium && is_clang) {
857 # Suppress warnings from Chrome's Clang plugins.
858 # See http://code.google.com/p/webrtc/issues/detail?id=163 for details.
859 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
860 }
861
862 deps = [
863 "../p2p:libstunprober",
864 "../p2p:rtc_p2p",
Patrik Höglunda8005cf2017-12-13 16:05:42 +0100865 "../rtc_base:checks",
ehmaldonadof6a861a2017-07-19 10:40:47 -0700866 "../rtc_base:rtc_base",
867 "../rtc_base:rtc_base_approved",
Patrik Höglund3e113432017-12-15 14:40:10 +0100868 "../rtc_base:stringutils",
charujainaca3a242016-11-01 03:09:15 -0700869 "../system_wrappers:field_trial_default",
870 ]
871 }
872}