blob: 1fd9168971bdda4166e41a9f8794740c1e82583a [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",
jianjun.zhuc0247402017-07-11 06:20:45 -0700111 "../modules/audio_device:audio_device_java",
112 "../rtc_base:base_java",
113 "../sdk/android:libjingle_peerconnection_java",
114 "../sdk/android:libjingle_peerconnection_metrics_default_java",
115 "androidapp/third_party/autobanh:autobanh_java",
Sami Kalliomaki9c0c75b2016-06-29 14:55:00 +0200116 ]
117 }
118
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200119 android_resources("AppRTCMobile_resources") {
kjellander1993b1d2017-03-06 00:29:21 -0800120 testonly = true
Sami Kalliomaki9c0c75b2016-06-29 14:55:00 +0200121 resource_dirs = [ "androidapp/res" ]
122 custom_package = "org.appspot.apprtc"
123 }
124
Mirko Bonadeifbb3b7d2017-11-07 15:36:33 +0000125 rtc_instrumentation_test_apk("AppRTCMobileTest") {
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200126 apk_name = "AppRTCMobileTest"
Sami Kalliomaki9c0c75b2016-06-29 14:55:00 +0200127 android_manifest = "androidtests/AndroidManifest.xml"
128
Patrik Höglunda8005cf2017-12-13 16:05:42 +0100129 java_files = [
130 "androidtests/src/org/appspot/apprtc/test/PeerConnectionClientTest.java",
131 ]
Sami Kalliomaki9c0c75b2016-06-29 14:55:00 +0200132
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200133 apk_under_test = ":AppRTCMobile"
Sami Kalliomaki9c0c75b2016-06-29 14:55:00 +0200134
135 deps = [
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200136 ":AppRTCMobile_javalib",
jianjun.zhuc0247402017-07-11 06:20:45 -0700137 "../sdk/android:libjingle_peerconnection_java",
sakalcb79d512017-01-11 06:21:26 -0800138 "//third_party/android_support_test_runner:runner_java",
139 "//third_party/junit",
Sami Kalliomaki9c0c75b2016-06-29 14:55:00 +0200140 ]
141 }
mandermoa6069e82017-01-16 02:23:09 -0800142
Mirko Bonadeifbb3b7d2017-11-07 15:36:33 +0000143 rtc_instrumentation_test_apk("AppRTCMobileTestStubbedVideoIO") {
mandermoa6069e82017-01-16 02:23:09 -0800144 apk_name = "AppRTCMobileTestStubbedVideoIO"
145 android_manifest = "androidtests/AndroidManifest.xml"
146
oprypin30cda5e2017-04-24 04:15:13 -0700147 java_files = [ "androidtests/src/org/appspot/apprtc/test/CallActivityStubbedInputOutputTest.java" ]
mandermoa6069e82017-01-16 02:23:09 -0800148
149 apk_under_test = ":AppRTCMobile"
150
151 deps = [
152 ":AppRTCMobile_javalib",
jianjun.zhuc0247402017-07-11 06:20:45 -0700153 "../sdk/android:libjingle_peerconnection_java",
mandermoa6069e82017-01-16 02:23:09 -0800154 "//third_party/android_support_test_runner:rules_java",
155 "//third_party/android_support_test_runner:runner_java",
156 "//third_party/espresso:espresso_all_java",
157 "//third_party/hamcrest:hamcrest_java",
158 "//third_party/junit",
mandermoa6069e82017-01-16 02:23:09 -0800159 ]
160
161 data = [
Edward Lemur70ba9b42018-01-22 13:46:58 +0100162 "../build/android/adb_reverse_forwarder.py",
163 "../examples/androidtests/video_quality_loopback_test.py",
Mirko Bonadei92ea95e2017-09-15 06:47:31 +0200164 "../resources/reference_video_640x360_30fps.y4m",
Edward Lemur70ba9b42018-01-22 13:46:58 +0100165 "../rtc_tools/barcode_tools/barcode_decoder.py",
166 "../rtc_tools/barcode_tools/helper_functions.py",
167 "../rtc_tools/compare_videos.py",
168 "../rtc_tools/testing/prebuilt_apprtc.zip",
169 "../rtc_tools/testing/golang/linux/go.tar.gz",
170 "../rtc_tools/testing/build_apprtc.py",
171 "../rtc_tools/testing/utils.py",
172 "../tools_webrtc/video_quality_toolchain/linux/ffmpeg",
173 "../tools_webrtc/video_quality_toolchain/linux/frame_analyzer",
174 "../tools_webrtc/video_quality_toolchain/linux/zxing",
mandermoa6069e82017-01-16 02:23:09 -0800175 ]
176 }
Sami Kalliomaki9c0c75b2016-06-29 14:55:00 +0200177}
tkchin2ddfdba2016-08-07 21:37:45 -0700178
179if (is_ios || (is_mac && target_cpu != "x86")) {
tkchin2ddfdba2016-08-07 21:37:45 -0700180 config("apprtc_common_config") {
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200181 include_dirs = [ "objc/AppRTCMobile/common" ]
tkchin2ddfdba2016-08-07 21:37:45 -0700182 }
183
kjellanderb62dbbe2016-09-23 00:38:52 -0700184 rtc_static_library("apprtc_common") {
kjellander1993b1d2017-03-06 00:29:21 -0800185 testonly = true
tkchin2ddfdba2016-08-07 21:37:45 -0700186 sources = [
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200187 "objc/AppRTCMobile/common/ARDUtilities.h",
188 "objc/AppRTCMobile/common/ARDUtilities.m",
tkchin2ddfdba2016-08-07 21:37:45 -0700189 ]
ehmaldonadoe9cc6862016-09-05 06:10:18 -0700190 public_configs = [ ":apprtc_common_config" ]
tkchin2ddfdba2016-08-07 21:37:45 -0700191
Kári Tristan Helgason946923a2017-06-02 14:05:56 +0200192 if (is_ios) {
Mirko Bonadeicbaaaed2018-02-19 15:14:04 +0100193 # iOS must use WebRTC.framework which is dynamically linked.
194 # 'gn check' is disabled in order to avoid confusion and
195 # errors caused by multiple implementations.
196 check_includes = false
kthelgason5901d9d2017-08-16 07:28:03 -0700197 deps = [
Kári Tristan Helgason99bf77c2018-02-16 10:49:22 +0100198 "../sdk:framework_objc",
Mirko Bonadei1a339c32017-12-14 13:06:10 +0100199 "../system_wrappers:field_trial_default",
Ilya Nikolaevskiy2ffe3e82018-01-17 19:57:24 +0000200 "../system_wrappers:runtime_enabled_features_default",
kthelgason5901d9d2017-08-16 07:28:03 -0700201 ]
Kári Tristan Helgason946923a2017-06-02 14:05:56 +0200202 } else {
kthelgason5901d9d2017-08-16 07:28:03 -0700203 deps = [
kthelgason36d658d2017-08-24 05:43:45 -0700204 "../sdk:common_objc",
kthelgason5901d9d2017-08-16 07:28:03 -0700205 "../system_wrappers:field_trial_default",
206 "../system_wrappers:metrics_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 }
tkchin2ddfdba2016-08-07 21:37:45 -0700210 }
211
212 config("apprtc_signaling_config") {
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200213 include_dirs = [ "objc/AppRTCMobile" ]
tkchin2ddfdba2016-08-07 21:37:45 -0700214
215 # GN orders flags on a target before flags from configs. The default config
216 # adds these flags so to cancel them out they need to come from a config and
217 # cannot be on the target directly.
218 cflags = [
219 "-Wno-sign-compare",
220 "-Wno-unused-variable",
221 ]
tkchin2ddfdba2016-08-07 21:37:45 -0700222 }
223
kjellanderb62dbbe2016-09-23 00:38:52 -0700224 rtc_static_library("apprtc_signaling") {
kjellander1993b1d2017-03-06 00:29:21 -0800225 testonly = true
tkchin2ddfdba2016-08-07 21:37:45 -0700226 sources = [
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200227 "objc/AppRTCMobile/ARDAppClient+Internal.h",
228 "objc/AppRTCMobile/ARDAppClient.h",
229 "objc/AppRTCMobile/ARDAppClient.m",
230 "objc/AppRTCMobile/ARDAppEngineClient.h",
231 "objc/AppRTCMobile/ARDAppEngineClient.m",
232 "objc/AppRTCMobile/ARDBitrateTracker.h",
233 "objc/AppRTCMobile/ARDBitrateTracker.m",
sakalc522e752017-04-05 12:17:48 -0700234 "objc/AppRTCMobile/ARDCaptureController.h",
235 "objc/AppRTCMobile/ARDCaptureController.m",
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200236 "objc/AppRTCMobile/ARDJoinResponse+Internal.h",
237 "objc/AppRTCMobile/ARDJoinResponse.h",
238 "objc/AppRTCMobile/ARDJoinResponse.m",
239 "objc/AppRTCMobile/ARDMessageResponse+Internal.h",
240 "objc/AppRTCMobile/ARDMessageResponse.h",
241 "objc/AppRTCMobile/ARDMessageResponse.m",
242 "objc/AppRTCMobile/ARDRoomServerClient.h",
sakalc4adacf2017-03-28 01:22:48 -0700243 "objc/AppRTCMobile/ARDSettingsModel+Private.h",
244 "objc/AppRTCMobile/ARDSettingsModel.h",
245 "objc/AppRTCMobile/ARDSettingsModel.m",
246 "objc/AppRTCMobile/ARDSettingsStore.h",
247 "objc/AppRTCMobile/ARDSettingsStore.m",
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200248 "objc/AppRTCMobile/ARDSignalingChannel.h",
249 "objc/AppRTCMobile/ARDSignalingMessage.h",
250 "objc/AppRTCMobile/ARDSignalingMessage.m",
251 "objc/AppRTCMobile/ARDStatsBuilder.h",
252 "objc/AppRTCMobile/ARDStatsBuilder.m",
kthelgasoncc882af2017-01-13 05:59:46 -0800253 "objc/AppRTCMobile/ARDTURNClient+Internal.h",
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200254 "objc/AppRTCMobile/ARDTURNClient.h",
kthelgasoncc882af2017-01-13 05:59:46 -0800255 "objc/AppRTCMobile/ARDTURNClient.m",
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200256 "objc/AppRTCMobile/ARDWebSocketChannel.h",
257 "objc/AppRTCMobile/ARDWebSocketChannel.m",
258 "objc/AppRTCMobile/RTCIceCandidate+JSON.h",
259 "objc/AppRTCMobile/RTCIceCandidate+JSON.m",
260 "objc/AppRTCMobile/RTCIceServer+JSON.h",
261 "objc/AppRTCMobile/RTCIceServer+JSON.m",
262 "objc/AppRTCMobile/RTCMediaConstraints+JSON.h",
263 "objc/AppRTCMobile/RTCMediaConstraints+JSON.m",
264 "objc/AppRTCMobile/RTCSessionDescription+JSON.h",
265 "objc/AppRTCMobile/RTCSessionDescription+JSON.m",
tkchin2ddfdba2016-08-07 21:37:45 -0700266 ]
ehmaldonadoe9cc6862016-09-05 06:10:18 -0700267 public_configs = [ ":apprtc_signaling_config" ]
tkchin2ddfdba2016-08-07 21:37:45 -0700268 deps = [
269 ":apprtc_common",
270 ":socketrocket",
271 ]
Kári Tristan Helgason946923a2017-06-02 14:05:56 +0200272 if (is_ios) {
Mirko Bonadeicbaaaed2018-02-19 15:14:04 +0100273 # iOS must use WebRTC.framework which is dynamically linked.
274 # 'gn check' is disabled in order to avoid confusion and
275 # errors caused by multiple implementations.
276 check_includes = false
Mirko Bonadei1a339c32017-12-14 13:06:10 +0100277 deps += [
278 ":AppRTCMobile_ios_frameworks",
279 "../sdk:framework_objc",
Kári Tristan Helgason946923a2017-06-02 14:05:56 +0200280 ]
Mirko Bonadei1a339c32017-12-14 13:06:10 +0100281 } else {
Mirko Bonadeicbaaaed2018-02-19 15:14:04 +0100282 deps += [
283 "../sdk:common_objc",
284 "../sdk:mediaconstraints_objc",
285 "../sdk:peerconnectionfactory_base_objc",
286 "../sdk:videocapture_objc",
287 "../sdk:videocodec_objc",
Anders Carlsson9823ee42018-03-07 10:32:03 +0100288 "../sdk:videosource_objc",
Mirko Bonadeicbaaaed2018-02-19 15:14:04 +0100289 ]
Kári Tristan Helgason946923a2017-06-02 14:05:56 +0200290 }
tkchin2ddfdba2016-08-07 21:37:45 -0700291 libs = [ "QuartzCore.framework" ]
292 }
293
294 if (is_ios) {
denicija77bfd7c2016-11-15 00:41:26 -0800295 rtc_static_library("AppRTCMobile_lib") {
Mirko Bonadeicbaaaed2018-02-19 15:14:04 +0100296 # iOS must use WebRTC.framework which is dynamically linked.
297 # 'gn check' is disabled in order to avoid confusion and
298 # errors caused by multiple implementations.
299 check_includes = false
kjellander1993b1d2017-03-06 00:29:21 -0800300 testonly = true
tkchin2ddfdba2016-08-07 21:37:45 -0700301 sources = [
Patrik Höglund49acb1e2018-01-02 14:41:54 +0100302 "objc/AppRTCMobile/ios/ARDAppDelegate.h",
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200303 "objc/AppRTCMobile/ios/ARDAppDelegate.m",
Daniela012b56b2017-11-15 13:15:24 +0100304 "objc/AppRTCMobile/ios/ARDFileCaptureController.h",
305 "objc/AppRTCMobile/ios/ARDFileCaptureController.m",
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200306 "objc/AppRTCMobile/ios/ARDMainView.h",
307 "objc/AppRTCMobile/ios/ARDMainView.m",
308 "objc/AppRTCMobile/ios/ARDMainViewController.h",
309 "objc/AppRTCMobile/ios/ARDMainViewController.m",
denicijad17d5362016-11-02 02:56:09 -0700310 "objc/AppRTCMobile/ios/ARDSettingsViewController.h",
311 "objc/AppRTCMobile/ios/ARDSettingsViewController.m",
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200312 "objc/AppRTCMobile/ios/ARDStatsView.h",
313 "objc/AppRTCMobile/ios/ARDStatsView.m",
314 "objc/AppRTCMobile/ios/ARDVideoCallView.h",
315 "objc/AppRTCMobile/ios/ARDVideoCallView.m",
316 "objc/AppRTCMobile/ios/ARDVideoCallViewController.h",
317 "objc/AppRTCMobile/ios/ARDVideoCallViewController.m",
Anders Carlsson6bf43d22017-10-16 13:51:43 +0200318 "objc/AppRTCMobile/ios/RTCVideoCodecInfo+HumanReadable.h",
319 "objc/AppRTCMobile/ios/RTCVideoCodecInfo+HumanReadable.m",
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200320 "objc/AppRTCMobile/ios/UIImage+ARDUtilities.h",
321 "objc/AppRTCMobile/ios/UIImage+ARDUtilities.m",
denicija77bfd7c2016-11-15 00:41:26 -0800322 ]
denicija77bfd7c2016-11-15 00:41:26 -0800323
324 deps = [
Kári Tristan Helgason946923a2017-06-02 14:05:56 +0200325 ":AppRTCMobile_ios_frameworks",
denicija77bfd7c2016-11-15 00:41:26 -0800326 ":apprtc_common",
327 ":apprtc_signaling",
Mirko Bonadei1a339c32017-12-14 13:06:10 +0100328 "../sdk:framework_objc",
denicija77bfd7c2016-11-15 00:41:26 -0800329 ]
330 }
331
332 ios_app_bundle("AppRTCMobile") {
kjellander1993b1d2017-03-06 00:29:21 -0800333 testonly = true
denicija77bfd7c2016-11-15 00:41:26 -0800334 sources = [
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200335 "objc/AppRTCMobile/ios/main.m",
tkchin2ddfdba2016-08-07 21:37:45 -0700336 ]
337
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200338 info_plist = "objc/AppRTCMobile/ios/Info.plist"
tkchin2ddfdba2016-08-07 21:37:45 -0700339
denicija77bfd7c2016-11-15 00:41:26 -0800340 configs += [ "..:common_config" ]
tkchin2ddfdba2016-08-07 21:37:45 -0700341 public_configs = [ "..:common_inherited_config" ]
342
343 deps = [
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200344 ":AppRTCMobile_ios_bundle_data",
kthelgasond3adbfb2017-01-26 01:14:04 -0800345 ":AppRTCMobile_ios_frameworks",
denicija77bfd7c2016-11-15 00:41:26 -0800346 ":AppRTCMobile_lib",
Mirko Bonadei1a339c32017-12-14 13:06:10 +0100347 "../sdk:framework_objc",
tkchin2ddfdba2016-08-07 21:37:45 -0700348 ]
349
350 if (target_cpu == "x86") {
351 deps += [ "//testing/iossim:iossim" ]
352 }
353 }
354
kthelgasond3adbfb2017-01-26 01:14:04 -0800355 bundle_data("AppRTCMobile_ios_frameworks") {
Mirko Bonadei1a339c32017-12-14 13:06:10 +0100356 deps = [
kthelgason36d658d2017-08-24 05:43:45 -0700357 "../sdk:framework_objc+link",
kthelgasond3adbfb2017-01-26 01:14:04 -0800358 ]
359 sources = [
wjywbsbef8a5d2017-10-09 02:32:28 -0400360 "$root_build_dir/WebRTC.framework",
kthelgasond3adbfb2017-01-26 01:14:04 -0800361 ]
362 outputs = [
363 "{{bundle_resources_dir}}/Frameworks/{{source_file_part}}",
364 ]
365 }
366
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200367 bundle_data("AppRTCMobile_ios_bundle_data") {
tkchin2ddfdba2016-08-07 21:37:45 -0700368 sources = [
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200369 "objc/AppRTCMobile/ios/resources/Roboto-Regular.ttf",
Daniela012b56b2017-11-15 13:15:24 +0100370
371 # Sample video taken from https://media.xiph.org/video/derf/
372 "objc/AppRTCMobile/ios/resources/foreman.mp4",
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200373 "objc/AppRTCMobile/ios/resources/iPhone5@2x.png",
374 "objc/AppRTCMobile/ios/resources/iPhone6@2x.png",
375 "objc/AppRTCMobile/ios/resources/iPhone6p@3x.png",
376 "objc/AppRTCMobile/ios/resources/ic_call_end_black_24dp.png",
377 "objc/AppRTCMobile/ios/resources/ic_call_end_black_24dp@2x.png",
378 "objc/AppRTCMobile/ios/resources/ic_clear_black_24dp.png",
379 "objc/AppRTCMobile/ios/resources/ic_clear_black_24dp@2x.png",
denicija6d6762c2016-10-28 04:53:16 -0700380 "objc/AppRTCMobile/ios/resources/ic_settings_black_24dp.png",
381 "objc/AppRTCMobile/ios/resources/ic_settings_black_24dp@2x.png",
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200382 "objc/AppRTCMobile/ios/resources/ic_surround_sound_black_24dp.png",
383 "objc/AppRTCMobile/ios/resources/ic_surround_sound_black_24dp@2x.png",
384 "objc/AppRTCMobile/ios/resources/ic_switch_video_black_24dp.png",
385 "objc/AppRTCMobile/ios/resources/ic_switch_video_black_24dp@2x.png",
386 "objc/AppRTCMobile/ios/resources/mozart.mp3",
anderscb5ed9052017-08-15 04:07:12 -0700387 "objc/Icon-120.png",
388 "objc/Icon-180.png",
tkchin2ddfdba2016-08-07 21:37:45 -0700389 "objc/Icon.png",
390 ]
391 outputs = [
392 "{{bundle_resources_dir}}/{{source_file_part}}",
393 ]
394 }
Anders Carlsson73119182018-03-15 09:41:03 +0100395
396 rtc_static_library("ObjCNativeAPIDemo_lib") {
397 testonly = true
398 sources = [
399 "objcnativeapi/objc/NADAppDelegate.h",
400 "objcnativeapi/objc/NADAppDelegate.m",
401 "objcnativeapi/objc/NADViewController.h",
402 "objcnativeapi/objc/NADViewController.mm",
403 "objcnativeapi/objc/objccallclient.h",
404 "objcnativeapi/objc/objccallclient.mm",
405 ]
406
407 if (!build_with_chromium && is_clang) {
408 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
409 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
410 }
411
412 deps = [
413 "../api:libjingle_peerconnection_api",
414 "../api/audio_codecs:builtin_audio_decoder_factory",
415 "../api/audio_codecs:builtin_audio_encoder_factory",
416 "../logging:rtc_event_log_impl_base",
417 "../media:rtc_audio_video",
418 "../modules/audio_processing:audio_processing",
419 "../pc:libjingle_peerconnection",
420 "../rtc_base:rtc_base",
421 "../sdk:default_codec_factory_objc",
422 "../sdk:framework_objc",
423 "../sdk:native_api",
424 "../sdk:ui_objc",
425 "../sdk:videotoolbox_objc",
426 "../system_wrappers:field_trial_default",
427 "../system_wrappers:metrics_default",
428 "../system_wrappers:runtime_enabled_features_default",
429 ]
430
431 if (current_cpu == "arm64") {
432 deps += [ "../sdk:metal_objc" ]
433 }
434 }
435
436 ios_app_bundle("ObjCNativeAPIDemo") {
437 testonly = true
438 sources = [
439 "objcnativeapi/objc/main.m",
440 ]
441
442 info_plist = "objcnativeapi/Info.plist"
443
444 configs += [ "..:common_config" ]
445 public_configs = [ "..:common_inherited_config" ]
446
447 deps = [
448 ":ObjCNativeAPIDemo_lib",
449 ]
450
451 if (target_cpu == "x86") {
452 deps += [ "//testing/iossim:iossim" ]
453 }
454 }
tkchin2ddfdba2016-08-07 21:37:45 -0700455 }
456
457 if (is_mac) {
denicija77bfd7c2016-11-15 00:41:26 -0800458 rtc_static_library("AppRTCMobile_lib") {
kjellander1993b1d2017-03-06 00:29:21 -0800459 testonly = true
tkchin2ddfdba2016-08-07 21:37:45 -0700460 sources = [
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200461 "objc/AppRTCMobile/mac/APPRTCAppDelegate.h",
462 "objc/AppRTCMobile/mac/APPRTCAppDelegate.m",
463 "objc/AppRTCMobile/mac/APPRTCViewController.h",
464 "objc/AppRTCMobile/mac/APPRTCViewController.m",
tkchin2ddfdba2016-08-07 21:37:45 -0700465 ]
jianjun.zhuc0247402017-07-11 06:20:45 -0700466 configs += [ "..:common_objc" ]
tkchin2ddfdba2016-08-07 21:37:45 -0700467 deps = [
468 ":apprtc_common",
469 ":apprtc_signaling",
Kári Tristan Helgason99bf77c2018-02-16 10:49:22 +0100470 "../sdk:default_codec_factory_objc",
Mirko Bonadei1a339c32017-12-14 13:06:10 +0100471 "../sdk:metal_objc",
Mirko Bonadeicbaaaed2018-02-19 15:14:04 +0100472 "../sdk:peerconnectionfactory_base_objc",
kthelgason36d658d2017-08-24 05:43:45 -0700473 "../sdk:ui_objc",
Mirko Bonadeicbaaaed2018-02-19 15:14:04 +0100474 "../sdk:videocapture_objc",
475 "../sdk:videocodec_objc",
Kári Tristan Helgason99bf77c2018-02-16 10:49:22 +0100476 "../sdk:videocodec_objc",
477 "../sdk:videotoolbox_objc",
tkchin2ddfdba2016-08-07 21:37:45 -0700478 ]
479 }
480
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200481 mac_app_bundle("AppRTCMobile") {
kjellander1993b1d2017-03-06 00:29:21 -0800482 testonly = true
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200483 output_name = "AppRTCMobile"
tkchin2ddfdba2016-08-07 21:37:45 -0700484
tkchin2ddfdba2016-08-07 21:37:45 -0700485 sources = [
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200486 "objc/AppRTCMobile/mac/main.m",
tkchin2ddfdba2016-08-07 21:37:45 -0700487 ]
488
489 public_configs = [ "..:common_inherited_config" ]
490
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200491 info_plist = "objc/AppRTCMobile/mac/Info.plist"
tkchin2ddfdba2016-08-07 21:37:45 -0700492
493 libs = [ "AppKit.framework" ]
494
495 deps = [
denicija77bfd7c2016-11-15 00:41:26 -0800496 ":AppRTCMobile_lib",
tkchin2ddfdba2016-08-07 21:37:45 -0700497 ]
498 }
499 }
500
501 config("socketrocket_include_config") {
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200502 include_dirs = [ "objc/AppRTCMobile/third_party/SocketRocket" ]
tkchin2ddfdba2016-08-07 21:37:45 -0700503 }
504
505 config("socketrocket_warning_config") {
506 # GN orders flags on a target before flags from configs. The default config
507 # adds these flags so to cancel them out they need to come from a config and
508 # cannot be on the target directly.
509 cflags = [
510 "-Wno-deprecated-declarations",
511 "-Wno-nonnull",
tkchin2ddfdba2016-08-07 21:37:45 -0700512 "-Wno-semicolon-before-method-body",
kthelgasone47de1a2017-02-24 01:56:01 -0800513 "-Wno-unused-variable",
tkchin2ddfdba2016-08-07 21:37:45 -0700514 ]
515
henrika27d8b612016-09-21 04:13:00 -0700516 cflags_objc = [
517 # Enabled for cflags_objc in build/config/compiler/BUILD.gn.
518 "-Wno-objc-missing-property-synthesis",
henrika27d8b612016-09-21 04:13:00 -0700519 ]
tkchin2ddfdba2016-08-07 21:37:45 -0700520 }
521
kjellanderb62dbbe2016-09-23 00:38:52 -0700522 rtc_static_library("socketrocket") {
kjellander1993b1d2017-03-06 00:29:21 -0800523 testonly = true
tkchin2ddfdba2016-08-07 21:37:45 -0700524 sources = [
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200525 "objc/AppRTCMobile/third_party/SocketRocket/SRWebSocket.h",
526 "objc/AppRTCMobile/third_party/SocketRocket/SRWebSocket.m",
tkchin2ddfdba2016-08-07 21:37:45 -0700527 ]
kthelgasonc0977102017-04-24 00:57:16 -0700528 configs += [ ":socketrocket_warning_config" ]
ehmaldonadoe9cc6862016-09-05 06:10:18 -0700529 public_configs = [ ":socketrocket_include_config" ]
tkchin2ddfdba2016-08-07 21:37:45 -0700530
531 libs = [
532 "CFNetwork.framework",
533 "icucore",
534 ]
535 }
adam.fedorbcc5d872016-11-07 14:53:28 -0800536
537 if (rtc_include_tests) {
kthelgason4065a572017-02-14 04:58:56 -0800538 # TODO(kthelgason): compile xctests on mac when chromium supports it.
539 if (is_ios) {
540 rtc_source_set("apprtcmobile_test_sources") {
Mirko Bonadeicbaaaed2018-02-19 15:14:04 +0100541 # iOS must use WebRTC.framework which is dynamically linked.
542 # 'gn check' is disabled in order to avoid confusion and
543 # errors caused by multiple implementations.
544 check_includes = false
kjellander1993b1d2017-03-06 00:29:21 -0800545 testonly = true
kthelgason4065a572017-02-14 04:58:56 -0800546 include_dirs = [
547 "objc/AppRTCMobile",
548 "objc/AppRTCMobile/ios",
549 ]
550 testonly = true
551 sources = [
552 "objc/AppRTCMobile/tests/ARDAppClient_xctest.mm",
Daniela012b56b2017-11-15 13:15:24 +0100553 "objc/AppRTCMobile/tests/ARDFileCaptureController_xctest.mm",
kthelgason4065a572017-02-14 04:58:56 -0800554 "objc/AppRTCMobile/tests/ARDSettingsModel_xctest.mm",
555 ]
kjellander1993b1d2017-03-06 00:29:21 -0800556 deps = [
kthelgason4065a572017-02-14 04:58:56 -0800557 ":AppRTCMobile_ios_frameworks",
558 ":AppRTCMobile_lib",
Mirko Bonadeicbaaaed2018-02-19 15:14:04 +0100559 ":apprtc_signaling",
Mirko Bonadei1a339c32017-12-14 13:06:10 +0100560 "../rtc_base:rtc_base",
561 "../sdk:framework_objc",
kthelgason4065a572017-02-14 04:58:56 -0800562 "//build/config/ios:xctest",
563 "//third_party/ocmock",
564 ]
adam.fedorbcc5d872016-11-07 14:53:28 -0800565 }
566
kthelgason4065a572017-02-14 04:58:56 -0800567 rtc_ios_xctest_test("apprtcmobile_tests") {
568 info_plist = "objc/AppRTCMobile/ios/Info.plist"
569 sources = [
570 "objc/AppRTCMobile/ios/main.m",
571 ]
572 deps = [
Mirko Bonadeicbaaaed2018-02-19 15:14:04 +0100573 ":AppRTCMobile_lib",
kthelgason4065a572017-02-14 04:58:56 -0800574 ":apprtcmobile_test_sources",
Mirko Bonadei1a339c32017-12-14 13:06:10 +0100575 "../sdk:framework_objc",
kthelgason4065a572017-02-14 04:58:56 -0800576 ]
577 ldflags = [ "-all_load" ]
578 }
adam.fedorbcc5d872016-11-07 14:53:28 -0800579 }
580 }
tkchin2ddfdba2016-08-07 21:37:45 -0700581}
kthelgason0727f152016-08-08 09:03:23 -0700582
583if (is_linux || is_win) {
ehmaldonadod02fe4b2016-08-26 13:31:24 -0700584 config("peerconnection_client_warnings_config") {
kjellander4a9abad2016-09-18 08:12:29 -0700585 cflags = []
ehmaldonadod02fe4b2016-08-26 13:31:24 -0700586 if (is_win && is_clang) {
kjellander4a9abad2016-09-18 08:12:29 -0700587 cflags += [
ehmaldonadod02fe4b2016-08-26 13:31:24 -0700588 # Disable warnings failing when compiling with Clang on Windows.
589 # https://bugs.chromium.org/p/webrtc/issues/detail?id=5366
590 "-Wno-format",
591
592 # See https://bugs.chromium.org/p/webrtc/issues/detail?id=6271
593 # for -Wno-reorder and -Wno-sign-compare
594 "-Wno-reorder",
595 "-Wno-sign-compare",
596 ]
597 }
kjellanderd4626e52016-09-07 02:33:01 -0700598 if (is_linux && target_cpu == "x86") {
kjellander4a9abad2016-09-18 08:12:29 -0700599 cflags += [
kjellanderd4626e52016-09-07 02:33:01 -0700600 # Needed to compile on Linux 32-bit.
601 "-Wno-sentinel",
602 ]
603 }
ehmaldonadod02fe4b2016-08-26 13:31:24 -0700604 }
605
ehmaldonado38a21322016-09-02 04:10:34 -0700606 rtc_executable("peerconnection_client") {
kjellander1993b1d2017-03-06 00:29:21 -0800607 testonly = true
kthelgason0727f152016-08-08 09:03:23 -0700608 sources = [
609 "peerconnection/client/conductor.cc",
610 "peerconnection/client/conductor.h",
611 "peerconnection/client/defaults.cc",
612 "peerconnection/client/defaults.h",
613 "peerconnection/client/peer_connection_client.cc",
614 "peerconnection/client/peer_connection_client.h",
615 ]
ehmaldonado7a2ce0b2016-09-05 01:35:44 -0700616
kjellandere40a7ee2016-10-16 23:56:12 -0700617 if (!build_with_chromium && is_clang) {
618 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
ehmaldonado38a21322016-09-02 04:10:34 -0700619 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
kthelgason0727f152016-08-08 09:03:23 -0700620 }
Patrik Höglundb5b5bce2017-11-13 10:19:58 +0100621 deps = [
Mirko Bonadei34814c72018-01-11 10:13:56 +0100622 "../api:libjingle_peerconnection_api",
Patrik Höglundb5b5bce2017-11-13 10:19:58 +0100623 "../api:video_frame_api_i420",
Patrik Höglunda8005cf2017-12-13 16:05:42 +0100624 "../rtc_base:checks",
Patrik Höglund3e113432017-12-15 14:40:10 +0100625 "../rtc_base:stringutils",
Patrik Höglundb5b5bce2017-11-13 10:19:58 +0100626 ]
kthelgason0727f152016-08-08 09:03:23 -0700627 if (is_win) {
628 sources += [
629 "peerconnection/client/flagdefs.h",
630 "peerconnection/client/main.cc",
631 "peerconnection/client/main_wnd.cc",
632 "peerconnection/client/main_wnd.h",
633 ]
634 cflags = [ "/wd4245" ]
635 configs += [ "//build/config/win:windowed" ]
jianjun.zhuc0247402017-07-11 06:20:45 -0700636 deps += [ "../media:rtc_media_base" ]
kthelgason0727f152016-08-08 09:03:23 -0700637 }
638 if (is_linux) {
639 sources += [
640 "peerconnection/client/linux/main.cc",
641 "peerconnection/client/linux/main_wnd.cc",
642 "peerconnection/client/linux/main_wnd.h",
643 ]
Henrik Kjellanderefbde2c2017-03-27 08:28:27 +0200644 cflags = [ "-Wno-deprecated-declarations" ]
kthelgason0727f152016-08-08 09:03:23 -0700645 libs = [
646 "X11",
647 "Xcomposite",
648 "Xext",
649 "Xrender",
650 ]
thomasandersonef16e992016-12-13 02:57:43 -0800651 deps += [ "//build/config/linux/gtk" ]
kthelgason0727f152016-08-08 09:03:23 -0700652 }
ehmaldonadod02fe4b2016-08-26 13:31:24 -0700653 configs += [ ":peerconnection_client_warnings_config" ]
kjellander1993b1d2017-03-06 00:29:21 -0800654
655 deps += [
Niels Möller8366e172018-02-14 12:20:13 +0100656 "../api:libjingle_peerconnection_api",
jianjun.zhuc0247402017-07-11 06:20:45 -0700657 "../api:libjingle_peerconnection_test_api",
658 "../api:video_frame_api",
Karl Wiberg1b0eae32017-10-17 14:48:54 +0200659 "../api/audio_codecs:builtin_audio_decoder_factory",
660 "../api/audio_codecs:builtin_audio_encoder_factory",
Mirko Bonadei75baa492018-01-11 17:07:30 +0100661 "../media:rtc_audio_video",
jianjun.zhuc0247402017-07-11 06:20:45 -0700662 "../modules/video_capture:video_capture_module",
663 "../pc:libjingle_peerconnection",
ehmaldonadof6a861a2017-07-19 10:40:47 -0700664 "../rtc_base:rtc_base",
665 "../rtc_base:rtc_base_approved",
666 "../rtc_base:rtc_json",
jianjun.zhuc0247402017-07-11 06:20:45 -0700667 "../system_wrappers:field_trial_default",
668 "../system_wrappers:metrics_default",
Ilya Nikolaevskiy2ffe3e82018-01-17 19:57:24 +0000669 "../system_wrappers:runtime_enabled_features_default",
kjellander1993b1d2017-03-06 00:29:21 -0800670 "//third_party/libyuv",
kjellander1993b1d2017-03-06 00:29:21 -0800671 ]
kthelgason0727f152016-08-08 09:03:23 -0700672 }
kjellanderd4626e52016-09-07 02:33:01 -0700673
ehmaldonado38a21322016-09-02 04:10:34 -0700674 rtc_executable("peerconnection_server") {
kjellander1993b1d2017-03-06 00:29:21 -0800675 testonly = true
kthelgason0727f152016-08-08 09:03:23 -0700676 sources = [
677 "peerconnection/server/data_socket.cc",
678 "peerconnection/server/data_socket.h",
679 "peerconnection/server/main.cc",
680 "peerconnection/server/peer_channel.cc",
681 "peerconnection/server/peer_channel.h",
682 "peerconnection/server/utils.cc",
683 "peerconnection/server/utils.h",
684 ]
685 deps = [
jianjun.zhuc0247402017-07-11 06:20:45 -0700686 "..:webrtc_common",
ehmaldonadof6a861a2017-07-19 10:40:47 -0700687 "../rtc_base:rtc_base_approved",
Patrik Höglund3e113432017-12-15 14:40:10 +0100688 "../rtc_base:stringutils",
jianjun.zhuc0247402017-07-11 06:20:45 -0700689 "../rtc_tools:command_line_parser",
kthelgason0727f152016-08-08 09:03:23 -0700690 ]
kjellandere40a7ee2016-10-16 23:56:12 -0700691 if (!build_with_chromium && is_clang) {
692 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
ehmaldonado38a21322016-09-02 04:10:34 -0700693 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
kthelgason0727f152016-08-08 09:03:23 -0700694 }
695 }
ehmaldonado38a21322016-09-02 04:10:34 -0700696 rtc_executable("relayserver") {
kjellander1993b1d2017-03-06 00:29:21 -0800697 testonly = true
kthelgason0727f152016-08-08 09:03:23 -0700698 sources = [
699 "relayserver/relayserver_main.cc",
700 ]
701 deps = [
jianjun.zhuc0247402017-07-11 06:20:45 -0700702 "../p2p:rtc_p2p",
703 "../pc:rtc_pc",
ehmaldonadof6a861a2017-07-19 10:40:47 -0700704 "../rtc_base:rtc_base",
705 "../rtc_base:rtc_base_approved",
jianjun.zhuc0247402017-07-11 06:20:45 -0700706 "../system_wrappers:field_trial_default",
707 "../system_wrappers:metrics_default",
Ilya Nikolaevskiy2ffe3e82018-01-17 19:57:24 +0000708 "../system_wrappers:runtime_enabled_features_default",
kthelgason0727f152016-08-08 09:03:23 -0700709 ]
kjellandere40a7ee2016-10-16 23:56:12 -0700710 if (!build_with_chromium && is_clang) {
711 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
ehmaldonado38a21322016-09-02 04:10:34 -0700712 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
kthelgason0727f152016-08-08 09:03:23 -0700713 }
714 }
ehmaldonado38a21322016-09-02 04:10:34 -0700715 rtc_executable("turnserver") {
kjellander1993b1d2017-03-06 00:29:21 -0800716 testonly = true
kthelgason0727f152016-08-08 09:03:23 -0700717 sources = [
718 "turnserver/turnserver_main.cc",
719 ]
720 deps = [
jianjun.zhuc0247402017-07-11 06:20:45 -0700721 "../p2p:rtc_p2p",
722 "../pc:rtc_pc",
ehmaldonadof6a861a2017-07-19 10:40:47 -0700723 "../rtc_base:rtc_base",
724 "../rtc_base:rtc_base_approved",
jianjun.zhuc0247402017-07-11 06:20:45 -0700725 "../system_wrappers:field_trial_default",
726 "../system_wrappers:metrics_default",
Ilya Nikolaevskiy2ffe3e82018-01-17 19:57:24 +0000727 "../system_wrappers:runtime_enabled_features_default",
kthelgason0727f152016-08-08 09:03:23 -0700728 ]
kjellandere40a7ee2016-10-16 23:56:12 -0700729 if (!build_with_chromium && is_clang) {
730 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
ehmaldonado38a21322016-09-02 04:10:34 -0700731 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
kthelgason0727f152016-08-08 09:03:23 -0700732 }
733 }
ehmaldonado38a21322016-09-02 04:10:34 -0700734 rtc_executable("stunserver") {
kjellander1993b1d2017-03-06 00:29:21 -0800735 testonly = true
kthelgason0727f152016-08-08 09:03:23 -0700736 sources = [
737 "stunserver/stunserver_main.cc",
738 ]
739 deps = [
jianjun.zhuc0247402017-07-11 06:20:45 -0700740 "../p2p:rtc_p2p",
741 "../pc:rtc_pc",
ehmaldonadof6a861a2017-07-19 10:40:47 -0700742 "../rtc_base:rtc_base",
743 "../rtc_base:rtc_base_approved",
jianjun.zhuc0247402017-07-11 06:20:45 -0700744 "../system_wrappers:field_trial_default",
745 "../system_wrappers:metrics_default",
Ilya Nikolaevskiy2ffe3e82018-01-17 19:57:24 +0000746 "../system_wrappers:runtime_enabled_features_default",
kthelgason0727f152016-08-08 09:03:23 -0700747 ]
kjellandere40a7ee2016-10-16 23:56:12 -0700748 if (!build_with_chromium && is_clang) {
749 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
ehmaldonado38a21322016-09-02 04:10:34 -0700750 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
kthelgason0727f152016-08-08 09:03:23 -0700751 }
752 }
753}
charujainaca3a242016-11-01 03:09:15 -0700754
qiangchen42f96d52017-08-08 17:08:03 -0700755if (is_win || is_android) {
gyzhouad7cad82017-05-11 16:10:03 -0700756 rtc_shared_library("webrtc_unity_plugin") {
757 testonly = true
758 sources = [
759 "unityplugin/simple_peer_connection.cc",
760 "unityplugin/simple_peer_connection.h",
761 "unityplugin/unity_plugin_apis.cc",
762 "unityplugin/unity_plugin_apis.h",
gyzhoub38f3862017-07-25 16:04:31 -0700763 "unityplugin/video_observer.cc",
764 "unityplugin/video_observer.h",
gyzhouad7cad82017-05-11 16:10:03 -0700765 ]
qiangchen42f96d52017-08-08 17:08:03 -0700766
767 if (is_android) {
768 sources += [
769 "unityplugin/classreferenceholder.cc",
770 "unityplugin/classreferenceholder.h",
771 "unityplugin/jni_onload.cc",
772 ]
Qiang Chen43fb9122017-12-20 10:47:36 -0800773 suppressed_configs += [ "//build/config/android:hide_all_but_jni_onload" ]
qiangchen42f96d52017-08-08 17:08:03 -0700774 }
775
gyzhouad7cad82017-05-11 16:10:03 -0700776 if (!build_with_chromium && is_clang) {
777 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
778 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
779 }
qiangchen42f96d52017-08-08 17:08:03 -0700780 if (is_win) {
781 cflags = [ "/wd4245" ]
782 configs += [
783 "//build/config/win:windowed",
784 ":peerconnection_client_warnings_config",
785 ]
786 }
gyzhouad7cad82017-05-11 16:10:03 -0700787 deps = [
Mirko Bonadei34814c72018-01-11 10:13:56 +0100788 "../api:libjingle_peerconnection_api",
jianjun.zhuc0247402017-07-11 06:20:45 -0700789 "../api:libjingle_peerconnection_test_api",
790 "../api:video_frame_api",
Qiang Chen51e20462017-12-05 11:11:21 -0800791 "../api/audio_codecs:builtin_audio_decoder_factory",
792 "../api/audio_codecs:builtin_audio_encoder_factory",
Mirko Bonadei75baa492018-01-11 17:07:30 +0100793 "../media:rtc_audio_video",
Anders Carlssona114c882018-01-04 15:10:22 +0100794 "../media:rtc_internal_video_codecs",
jianjun.zhuc0247402017-07-11 06:20:45 -0700795 "../media:rtc_media",
796 "../media:rtc_media_base",
Qiang Chen43fb9122017-12-20 10:47:36 -0800797 "../modules/audio_device:audio_device",
798 "../modules/audio_processing:audio_processing",
jianjun.zhuc0247402017-07-11 06:20:45 -0700799 "../modules/video_capture:video_capture_module",
800 "../pc:libjingle_peerconnection",
qiangchen42f96d52017-08-08 17:08:03 -0700801 "../rtc_base:rtc_base",
jianjun.zhuc0247402017-07-11 06:20:45 -0700802 "../system_wrappers:field_trial_default",
803 "../system_wrappers:metrics_default",
Ilya Nikolaevskiy2ffe3e82018-01-17 19:57:24 +0000804 "../system_wrappers:runtime_enabled_features_default",
gyzhouad7cad82017-05-11 16:10:03 -0700805 ]
qiangchen42f96d52017-08-08 17:08:03 -0700806 if (is_android) {
George Zhou2770c3d2018-03-07 09:58:54 -0800807 deps += [
808 "../modules/utility:utility",
809 "../sdk/android:libjingle_peerconnection_jni",
810 ]
qiangchen42f96d52017-08-08 17:08:03 -0700811 }
812 }
813}
814
815if (is_android) {
Mirko Bonadeifbb3b7d2017-11-07 15:36:33 +0000816 rtc_android_library("webrtc_unity_java") {
qiangchen42f96d52017-08-08 17:08:03 -0700817 java_files = [ "unityplugin/java/src/org/webrtc/UnityUtility.java" ]
818 deps = [
819 "../rtc_base:base_java",
820 "../sdk/android:libjingle_peerconnection_java",
821 ]
822 }
823
824 dist_jar("libwebrtc_unity") {
825 _target_dir_name = get_label_info(":$target_name", "dir")
826 output = "${root_out_dir}/lib.java${_target_dir_name}/${target_name}.jar"
George Zhou2770c3d2018-03-07 09:58:54 -0800827 direct_deps_only = false
qiangchen42f96d52017-08-08 17:08:03 -0700828 use_interface_jars = false
George Zhou2770c3d2018-03-07 09:58:54 -0800829 use_unprocessed_jars = false
Oleh Prypin86021d92017-09-24 22:29:06 +0200830 requires_android = true
qiangchen42f96d52017-08-08 17:08:03 -0700831 deps = [
832 ":webrtc_unity_java",
833 "../modules/audio_device:audio_device_java",
834 "../rtc_base:base_java",
835 "../sdk/android:libjingle_peerconnection_java",
836 "../sdk/android:libjingle_peerconnection_metrics_default_java",
837 ]
gyzhouad7cad82017-05-11 16:10:03 -0700838 }
839}
840
charujainaca3a242016-11-01 03:09:15 -0700841if (!build_with_chromium) {
842 # Doesn't build within Chrome on Win.
843 rtc_executable("stun_prober") {
kjellander1993b1d2017-03-06 00:29:21 -0800844 testonly = true
charujainaca3a242016-11-01 03:09:15 -0700845 sources = [
846 "stunprober/main.cc",
847 ]
848
849 if (!build_with_chromium && is_clang) {
850 # Suppress warnings from Chrome's Clang plugins.
851 # See http://code.google.com/p/webrtc/issues/detail?id=163 for details.
852 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
853 }
854
855 deps = [
856 "../p2p:libstunprober",
857 "../p2p:rtc_p2p",
Patrik Höglunda8005cf2017-12-13 16:05:42 +0100858 "../rtc_base:checks",
ehmaldonadof6a861a2017-07-19 10:40:47 -0700859 "../rtc_base:rtc_base",
860 "../rtc_base:rtc_base_approved",
Patrik Höglund3e113432017-12-15 14:40:10 +0100861 "../rtc_base:stringutils",
charujainaca3a242016-11-01 03:09:15 -0700862 "../system_wrappers:field_trial_default",
863 ]
864 }
865}