blob: 25b6a03d9e4ca926cd9ef8416e05f0dd9219eece [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 "../rtc_base:base_java",
112 "../sdk/android:libjingle_peerconnection_java",
113 "../sdk/android:libjingle_peerconnection_metrics_default_java",
114 "androidapp/third_party/autobanh:autobanh_java",
Sami Kalliomaki9c0c75b2016-06-29 14:55:00 +0200115 ]
116 }
117
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200118 android_resources("AppRTCMobile_resources") {
kjellander1993b1d2017-03-06 00:29:21 -0800119 testonly = true
Sami Kalliomaki9c0c75b2016-06-29 14:55:00 +0200120 resource_dirs = [ "androidapp/res" ]
121 custom_package = "org.appspot.apprtc"
122 }
123
Mirko Bonadeifbb3b7d2017-11-07 15:36:33 +0000124 rtc_instrumentation_test_apk("AppRTCMobileTest") {
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200125 apk_name = "AppRTCMobileTest"
Sami Kalliomaki9c0c75b2016-06-29 14:55:00 +0200126 android_manifest = "androidtests/AndroidManifest.xml"
127
Patrik Höglunda8005cf2017-12-13 16:05:42 +0100128 java_files = [
129 "androidtests/src/org/appspot/apprtc/test/PeerConnectionClientTest.java",
130 ]
Sami Kalliomaki9c0c75b2016-06-29 14:55:00 +0200131
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200132 apk_under_test = ":AppRTCMobile"
Sami Kalliomaki9c0c75b2016-06-29 14:55:00 +0200133
134 deps = [
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200135 ":AppRTCMobile_javalib",
jianjun.zhuc0247402017-07-11 06:20:45 -0700136 "../sdk/android:libjingle_peerconnection_java",
sakalcb79d512017-01-11 06:21:26 -0800137 "//third_party/android_support_test_runner:runner_java",
138 "//third_party/junit",
Sami Kalliomaki9c0c75b2016-06-29 14:55:00 +0200139 ]
140 }
mandermoa6069e82017-01-16 02:23:09 -0800141
Mirko Bonadeifbb3b7d2017-11-07 15:36:33 +0000142 rtc_instrumentation_test_apk("AppRTCMobileTestStubbedVideoIO") {
mandermoa6069e82017-01-16 02:23:09 -0800143 apk_name = "AppRTCMobileTestStubbedVideoIO"
144 android_manifest = "androidtests/AndroidManifest.xml"
145
oprypin30cda5e2017-04-24 04:15:13 -0700146 java_files = [ "androidtests/src/org/appspot/apprtc/test/CallActivityStubbedInputOutputTest.java" ]
mandermoa6069e82017-01-16 02:23:09 -0800147
148 apk_under_test = ":AppRTCMobile"
149
150 deps = [
151 ":AppRTCMobile_javalib",
jianjun.zhuc0247402017-07-11 06:20:45 -0700152 "../sdk/android:libjingle_peerconnection_java",
mandermoa6069e82017-01-16 02:23:09 -0800153 "//third_party/android_support_test_runner:rules_java",
154 "//third_party/android_support_test_runner:runner_java",
155 "//third_party/espresso:espresso_all_java",
156 "//third_party/hamcrest:hamcrest_java",
157 "//third_party/junit",
mandermoa6069e82017-01-16 02:23:09 -0800158 ]
159
160 data = [
Edward Lemur70ba9b42018-01-22 13:46:58 +0100161 "../build/android/adb_reverse_forwarder.py",
162 "../examples/androidtests/video_quality_loopback_test.py",
Mirko Bonadei92ea95e2017-09-15 06:47:31 +0200163 "../resources/reference_video_640x360_30fps.y4m",
Edward Lemur70ba9b42018-01-22 13:46:58 +0100164 "../rtc_tools/barcode_tools/barcode_decoder.py",
165 "../rtc_tools/barcode_tools/helper_functions.py",
166 "../rtc_tools/compare_videos.py",
167 "../rtc_tools/testing/prebuilt_apprtc.zip",
168 "../rtc_tools/testing/golang/linux/go.tar.gz",
169 "../rtc_tools/testing/build_apprtc.py",
170 "../rtc_tools/testing/utils.py",
171 "../tools_webrtc/video_quality_toolchain/linux/ffmpeg",
172 "../tools_webrtc/video_quality_toolchain/linux/frame_analyzer",
173 "../tools_webrtc/video_quality_toolchain/linux/zxing",
mandermoa6069e82017-01-16 02:23:09 -0800174 ]
175 }
Sami Kalliomaki9c0c75b2016-06-29 14:55:00 +0200176}
tkchin2ddfdba2016-08-07 21:37:45 -0700177
178if (is_ios || (is_mac && target_cpu != "x86")) {
tkchin2ddfdba2016-08-07 21:37:45 -0700179 config("apprtc_common_config") {
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200180 include_dirs = [ "objc/AppRTCMobile/common" ]
tkchin2ddfdba2016-08-07 21:37:45 -0700181 }
182
kjellanderb62dbbe2016-09-23 00:38:52 -0700183 rtc_static_library("apprtc_common") {
kjellander1993b1d2017-03-06 00:29:21 -0800184 testonly = true
tkchin2ddfdba2016-08-07 21:37:45 -0700185 sources = [
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200186 "objc/AppRTCMobile/common/ARDUtilities.h",
187 "objc/AppRTCMobile/common/ARDUtilities.m",
tkchin2ddfdba2016-08-07 21:37:45 -0700188 ]
ehmaldonadoe9cc6862016-09-05 06:10:18 -0700189 public_configs = [ ":apprtc_common_config" ]
tkchin2ddfdba2016-08-07 21:37:45 -0700190
Kári Tristan Helgason946923a2017-06-02 14:05:56 +0200191 if (is_ios) {
Mirko Bonadeicbaaaed2018-02-19 15:14:04 +0100192 # iOS must use WebRTC.framework which is dynamically linked.
193 # 'gn check' is disabled in order to avoid confusion and
194 # errors caused by multiple implementations.
195 check_includes = false
kthelgason5901d9d2017-08-16 07:28:03 -0700196 deps = [
Kári Tristan Helgason99bf77c2018-02-16 10:49:22 +0100197 "../sdk:framework_objc",
Mirko Bonadei1a339c32017-12-14 13:06:10 +0100198 "../system_wrappers:field_trial_default",
Ilya Nikolaevskiy2ffe3e82018-01-17 19:57:24 +0000199 "../system_wrappers:runtime_enabled_features_default",
kthelgason5901d9d2017-08-16 07:28:03 -0700200 ]
Kári Tristan Helgason946923a2017-06-02 14:05:56 +0200201 } else {
kthelgason5901d9d2017-08-16 07:28:03 -0700202 deps = [
kthelgason36d658d2017-08-24 05:43:45 -0700203 "../sdk:common_objc",
kthelgason5901d9d2017-08-16 07:28:03 -0700204 "../system_wrappers:field_trial_default",
205 "../system_wrappers:metrics_default",
Ilya Nikolaevskiy2ffe3e82018-01-17 19:57:24 +0000206 "../system_wrappers:runtime_enabled_features_default",
kthelgason5901d9d2017-08-16 07:28:03 -0700207 ]
Kári Tristan Helgason946923a2017-06-02 14:05:56 +0200208 }
tkchin2ddfdba2016-08-07 21:37:45 -0700209 }
210
211 config("apprtc_signaling_config") {
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200212 include_dirs = [ "objc/AppRTCMobile" ]
tkchin2ddfdba2016-08-07 21:37:45 -0700213
214 # GN orders flags on a target before flags from configs. The default config
215 # adds these flags so to cancel them out they need to come from a config and
216 # cannot be on the target directly.
217 cflags = [
218 "-Wno-sign-compare",
219 "-Wno-unused-variable",
220 ]
tkchin2ddfdba2016-08-07 21:37:45 -0700221 }
222
kjellanderb62dbbe2016-09-23 00:38:52 -0700223 rtc_static_library("apprtc_signaling") {
kjellander1993b1d2017-03-06 00:29:21 -0800224 testonly = true
tkchin2ddfdba2016-08-07 21:37:45 -0700225 sources = [
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200226 "objc/AppRTCMobile/ARDAppClient+Internal.h",
227 "objc/AppRTCMobile/ARDAppClient.h",
228 "objc/AppRTCMobile/ARDAppClient.m",
229 "objc/AppRTCMobile/ARDAppEngineClient.h",
230 "objc/AppRTCMobile/ARDAppEngineClient.m",
231 "objc/AppRTCMobile/ARDBitrateTracker.h",
232 "objc/AppRTCMobile/ARDBitrateTracker.m",
sakalc522e752017-04-05 12:17:48 -0700233 "objc/AppRTCMobile/ARDCaptureController.h",
234 "objc/AppRTCMobile/ARDCaptureController.m",
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200235 "objc/AppRTCMobile/ARDJoinResponse+Internal.h",
236 "objc/AppRTCMobile/ARDJoinResponse.h",
237 "objc/AppRTCMobile/ARDJoinResponse.m",
238 "objc/AppRTCMobile/ARDMessageResponse+Internal.h",
239 "objc/AppRTCMobile/ARDMessageResponse.h",
240 "objc/AppRTCMobile/ARDMessageResponse.m",
241 "objc/AppRTCMobile/ARDRoomServerClient.h",
sakalc4adacf2017-03-28 01:22:48 -0700242 "objc/AppRTCMobile/ARDSettingsModel+Private.h",
243 "objc/AppRTCMobile/ARDSettingsModel.h",
244 "objc/AppRTCMobile/ARDSettingsModel.m",
245 "objc/AppRTCMobile/ARDSettingsStore.h",
246 "objc/AppRTCMobile/ARDSettingsStore.m",
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200247 "objc/AppRTCMobile/ARDSignalingChannel.h",
248 "objc/AppRTCMobile/ARDSignalingMessage.h",
249 "objc/AppRTCMobile/ARDSignalingMessage.m",
250 "objc/AppRTCMobile/ARDStatsBuilder.h",
251 "objc/AppRTCMobile/ARDStatsBuilder.m",
kthelgasoncc882af2017-01-13 05:59:46 -0800252 "objc/AppRTCMobile/ARDTURNClient+Internal.h",
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200253 "objc/AppRTCMobile/ARDTURNClient.h",
kthelgasoncc882af2017-01-13 05:59:46 -0800254 "objc/AppRTCMobile/ARDTURNClient.m",
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200255 "objc/AppRTCMobile/ARDWebSocketChannel.h",
256 "objc/AppRTCMobile/ARDWebSocketChannel.m",
257 "objc/AppRTCMobile/RTCIceCandidate+JSON.h",
258 "objc/AppRTCMobile/RTCIceCandidate+JSON.m",
259 "objc/AppRTCMobile/RTCIceServer+JSON.h",
260 "objc/AppRTCMobile/RTCIceServer+JSON.m",
261 "objc/AppRTCMobile/RTCMediaConstraints+JSON.h",
262 "objc/AppRTCMobile/RTCMediaConstraints+JSON.m",
263 "objc/AppRTCMobile/RTCSessionDescription+JSON.h",
264 "objc/AppRTCMobile/RTCSessionDescription+JSON.m",
tkchin2ddfdba2016-08-07 21:37:45 -0700265 ]
ehmaldonadoe9cc6862016-09-05 06:10:18 -0700266 public_configs = [ ":apprtc_signaling_config" ]
tkchin2ddfdba2016-08-07 21:37:45 -0700267 deps = [
268 ":apprtc_common",
269 ":socketrocket",
270 ]
Kári Tristan Helgason946923a2017-06-02 14:05:56 +0200271 if (is_ios) {
Mirko Bonadeicbaaaed2018-02-19 15:14:04 +0100272 # iOS must use WebRTC.framework which is dynamically linked.
273 # 'gn check' is disabled in order to avoid confusion and
274 # errors caused by multiple implementations.
275 check_includes = false
Mirko Bonadei1a339c32017-12-14 13:06:10 +0100276 deps += [
277 ":AppRTCMobile_ios_frameworks",
278 "../sdk:framework_objc",
Kári Tristan Helgason946923a2017-06-02 14:05:56 +0200279 ]
Mirko Bonadei1a339c32017-12-14 13:06:10 +0100280 } else {
Mirko Bonadeicbaaaed2018-02-19 15:14:04 +0100281 deps += [
282 "../sdk:common_objc",
283 "../sdk:mediaconstraints_objc",
284 "../sdk:peerconnectionfactory_base_objc",
285 "../sdk:videocapture_objc",
286 "../sdk:videocodec_objc",
Anders Carlsson9823ee42018-03-07 10:32:03 +0100287 "../sdk:videosource_objc",
Mirko Bonadeicbaaaed2018-02-19 15:14:04 +0100288 ]
Kári Tristan Helgason946923a2017-06-02 14:05:56 +0200289 }
tkchin2ddfdba2016-08-07 21:37:45 -0700290 libs = [ "QuartzCore.framework" ]
291 }
292
293 if (is_ios) {
denicija77bfd7c2016-11-15 00:41:26 -0800294 rtc_static_library("AppRTCMobile_lib") {
Mirko Bonadeicbaaaed2018-02-19 15:14:04 +0100295 # iOS must use WebRTC.framework which is dynamically linked.
296 # 'gn check' is disabled in order to avoid confusion and
297 # errors caused by multiple implementations.
298 check_includes = false
kjellander1993b1d2017-03-06 00:29:21 -0800299 testonly = true
tkchin2ddfdba2016-08-07 21:37:45 -0700300 sources = [
Patrik Höglund49acb1e2018-01-02 14:41:54 +0100301 "objc/AppRTCMobile/ios/ARDAppDelegate.h",
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200302 "objc/AppRTCMobile/ios/ARDAppDelegate.m",
Daniela012b56b2017-11-15 13:15:24 +0100303 "objc/AppRTCMobile/ios/ARDFileCaptureController.h",
304 "objc/AppRTCMobile/ios/ARDFileCaptureController.m",
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200305 "objc/AppRTCMobile/ios/ARDMainView.h",
306 "objc/AppRTCMobile/ios/ARDMainView.m",
307 "objc/AppRTCMobile/ios/ARDMainViewController.h",
308 "objc/AppRTCMobile/ios/ARDMainViewController.m",
denicijad17d5362016-11-02 02:56:09 -0700309 "objc/AppRTCMobile/ios/ARDSettingsViewController.h",
310 "objc/AppRTCMobile/ios/ARDSettingsViewController.m",
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200311 "objc/AppRTCMobile/ios/ARDStatsView.h",
312 "objc/AppRTCMobile/ios/ARDStatsView.m",
313 "objc/AppRTCMobile/ios/ARDVideoCallView.h",
314 "objc/AppRTCMobile/ios/ARDVideoCallView.m",
315 "objc/AppRTCMobile/ios/ARDVideoCallViewController.h",
316 "objc/AppRTCMobile/ios/ARDVideoCallViewController.m",
Anders Carlsson6bf43d22017-10-16 13:51:43 +0200317 "objc/AppRTCMobile/ios/RTCVideoCodecInfo+HumanReadable.h",
318 "objc/AppRTCMobile/ios/RTCVideoCodecInfo+HumanReadable.m",
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200319 "objc/AppRTCMobile/ios/UIImage+ARDUtilities.h",
320 "objc/AppRTCMobile/ios/UIImage+ARDUtilities.m",
denicija77bfd7c2016-11-15 00:41:26 -0800321 ]
denicija77bfd7c2016-11-15 00:41:26 -0800322
323 deps = [
Kári Tristan Helgason946923a2017-06-02 14:05:56 +0200324 ":AppRTCMobile_ios_frameworks",
denicija77bfd7c2016-11-15 00:41:26 -0800325 ":apprtc_common",
326 ":apprtc_signaling",
Mirko Bonadei1a339c32017-12-14 13:06:10 +0100327 "../sdk:framework_objc",
denicija77bfd7c2016-11-15 00:41:26 -0800328 ]
329 }
330
331 ios_app_bundle("AppRTCMobile") {
kjellander1993b1d2017-03-06 00:29:21 -0800332 testonly = true
denicija77bfd7c2016-11-15 00:41:26 -0800333 sources = [
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200334 "objc/AppRTCMobile/ios/main.m",
tkchin2ddfdba2016-08-07 21:37:45 -0700335 ]
336
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200337 info_plist = "objc/AppRTCMobile/ios/Info.plist"
tkchin2ddfdba2016-08-07 21:37:45 -0700338
denicija77bfd7c2016-11-15 00:41:26 -0800339 configs += [ "..:common_config" ]
tkchin2ddfdba2016-08-07 21:37:45 -0700340 public_configs = [ "..:common_inherited_config" ]
341
342 deps = [
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200343 ":AppRTCMobile_ios_bundle_data",
kthelgasond3adbfb2017-01-26 01:14:04 -0800344 ":AppRTCMobile_ios_frameworks",
denicija77bfd7c2016-11-15 00:41:26 -0800345 ":AppRTCMobile_lib",
Mirko Bonadei1a339c32017-12-14 13:06:10 +0100346 "../sdk:framework_objc",
tkchin2ddfdba2016-08-07 21:37:45 -0700347 ]
348
349 if (target_cpu == "x86") {
350 deps += [ "//testing/iossim:iossim" ]
351 }
352 }
353
kthelgasond3adbfb2017-01-26 01:14:04 -0800354 bundle_data("AppRTCMobile_ios_frameworks") {
Mirko Bonadei1a339c32017-12-14 13:06:10 +0100355 deps = [
kthelgason36d658d2017-08-24 05:43:45 -0700356 "../sdk:framework_objc+link",
kthelgasond3adbfb2017-01-26 01:14:04 -0800357 ]
358 sources = [
wjywbsbef8a5d2017-10-09 02:32:28 -0400359 "$root_build_dir/WebRTC.framework",
kthelgasond3adbfb2017-01-26 01:14:04 -0800360 ]
361 outputs = [
362 "{{bundle_resources_dir}}/Frameworks/{{source_file_part}}",
363 ]
364 }
365
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200366 bundle_data("AppRTCMobile_ios_bundle_data") {
tkchin2ddfdba2016-08-07 21:37:45 -0700367 sources = [
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200368 "objc/AppRTCMobile/ios/resources/Roboto-Regular.ttf",
Daniela012b56b2017-11-15 13:15:24 +0100369
370 # Sample video taken from https://media.xiph.org/video/derf/
371 "objc/AppRTCMobile/ios/resources/foreman.mp4",
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200372 "objc/AppRTCMobile/ios/resources/iPhone5@2x.png",
373 "objc/AppRTCMobile/ios/resources/iPhone6@2x.png",
374 "objc/AppRTCMobile/ios/resources/iPhone6p@3x.png",
375 "objc/AppRTCMobile/ios/resources/ic_call_end_black_24dp.png",
376 "objc/AppRTCMobile/ios/resources/ic_call_end_black_24dp@2x.png",
377 "objc/AppRTCMobile/ios/resources/ic_clear_black_24dp.png",
378 "objc/AppRTCMobile/ios/resources/ic_clear_black_24dp@2x.png",
denicija6d6762c2016-10-28 04:53:16 -0700379 "objc/AppRTCMobile/ios/resources/ic_settings_black_24dp.png",
380 "objc/AppRTCMobile/ios/resources/ic_settings_black_24dp@2x.png",
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200381 "objc/AppRTCMobile/ios/resources/ic_surround_sound_black_24dp.png",
382 "objc/AppRTCMobile/ios/resources/ic_surround_sound_black_24dp@2x.png",
383 "objc/AppRTCMobile/ios/resources/ic_switch_video_black_24dp.png",
384 "objc/AppRTCMobile/ios/resources/ic_switch_video_black_24dp@2x.png",
385 "objc/AppRTCMobile/ios/resources/mozart.mp3",
anderscb5ed9052017-08-15 04:07:12 -0700386 "objc/Icon-120.png",
387 "objc/Icon-180.png",
tkchin2ddfdba2016-08-07 21:37:45 -0700388 "objc/Icon.png",
389 ]
390 outputs = [
391 "{{bundle_resources_dir}}/{{source_file_part}}",
392 ]
393 }
Anders Carlsson73119182018-03-15 09:41:03 +0100394
395 rtc_static_library("ObjCNativeAPIDemo_lib") {
396 testonly = true
397 sources = [
398 "objcnativeapi/objc/NADAppDelegate.h",
399 "objcnativeapi/objc/NADAppDelegate.m",
400 "objcnativeapi/objc/NADViewController.h",
401 "objcnativeapi/objc/NADViewController.mm",
402 "objcnativeapi/objc/objccallclient.h",
403 "objcnativeapi/objc/objccallclient.mm",
404 ]
405
406 if (!build_with_chromium && is_clang) {
407 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
408 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
409 }
410
411 deps = [
412 "../api:libjingle_peerconnection_api",
413 "../api/audio_codecs:builtin_audio_decoder_factory",
414 "../api/audio_codecs:builtin_audio_encoder_factory",
415 "../logging:rtc_event_log_impl_base",
416 "../media:rtc_audio_video",
417 "../modules/audio_processing:audio_processing",
418 "../pc:libjingle_peerconnection",
419 "../rtc_base:rtc_base",
420 "../sdk:default_codec_factory_objc",
421 "../sdk:framework_objc",
422 "../sdk:native_api",
423 "../sdk:ui_objc",
424 "../sdk:videotoolbox_objc",
425 "../system_wrappers:field_trial_default",
426 "../system_wrappers:metrics_default",
427 "../system_wrappers:runtime_enabled_features_default",
428 ]
429
430 if (current_cpu == "arm64") {
431 deps += [ "../sdk:metal_objc" ]
432 }
433 }
434
435 ios_app_bundle("ObjCNativeAPIDemo") {
436 testonly = true
437 sources = [
438 "objcnativeapi/objc/main.m",
439 ]
440
441 info_plist = "objcnativeapi/Info.plist"
442
443 configs += [ "..:common_config" ]
444 public_configs = [ "..:common_inherited_config" ]
445
446 deps = [
447 ":ObjCNativeAPIDemo_lib",
448 ]
449
450 if (target_cpu == "x86") {
451 deps += [ "//testing/iossim:iossim" ]
452 }
453 }
tkchin2ddfdba2016-08-07 21:37:45 -0700454 }
455
456 if (is_mac) {
denicija77bfd7c2016-11-15 00:41:26 -0800457 rtc_static_library("AppRTCMobile_lib") {
kjellander1993b1d2017-03-06 00:29:21 -0800458 testonly = true
tkchin2ddfdba2016-08-07 21:37:45 -0700459 sources = [
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200460 "objc/AppRTCMobile/mac/APPRTCAppDelegate.h",
461 "objc/AppRTCMobile/mac/APPRTCAppDelegate.m",
462 "objc/AppRTCMobile/mac/APPRTCViewController.h",
463 "objc/AppRTCMobile/mac/APPRTCViewController.m",
tkchin2ddfdba2016-08-07 21:37:45 -0700464 ]
jianjun.zhuc0247402017-07-11 06:20:45 -0700465 configs += [ "..:common_objc" ]
tkchin2ddfdba2016-08-07 21:37:45 -0700466 deps = [
467 ":apprtc_common",
468 ":apprtc_signaling",
Kári Tristan Helgason99bf77c2018-02-16 10:49:22 +0100469 "../sdk:default_codec_factory_objc",
Mirko Bonadei1a339c32017-12-14 13:06:10 +0100470 "../sdk:metal_objc",
Mirko Bonadeicbaaaed2018-02-19 15:14:04 +0100471 "../sdk:peerconnectionfactory_base_objc",
kthelgason36d658d2017-08-24 05:43:45 -0700472 "../sdk:ui_objc",
Mirko Bonadeicbaaaed2018-02-19 15:14:04 +0100473 "../sdk:videocapture_objc",
474 "../sdk:videocodec_objc",
Kári Tristan Helgason99bf77c2018-02-16 10:49:22 +0100475 "../sdk:videocodec_objc",
476 "../sdk:videotoolbox_objc",
tkchin2ddfdba2016-08-07 21:37:45 -0700477 ]
478 }
479
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200480 mac_app_bundle("AppRTCMobile") {
kjellander1993b1d2017-03-06 00:29:21 -0800481 testonly = true
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200482 output_name = "AppRTCMobile"
tkchin2ddfdba2016-08-07 21:37:45 -0700483
tkchin2ddfdba2016-08-07 21:37:45 -0700484 sources = [
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200485 "objc/AppRTCMobile/mac/main.m",
tkchin2ddfdba2016-08-07 21:37:45 -0700486 ]
487
488 public_configs = [ "..:common_inherited_config" ]
489
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200490 info_plist = "objc/AppRTCMobile/mac/Info.plist"
tkchin2ddfdba2016-08-07 21:37:45 -0700491
492 libs = [ "AppKit.framework" ]
493
494 deps = [
denicija77bfd7c2016-11-15 00:41:26 -0800495 ":AppRTCMobile_lib",
tkchin2ddfdba2016-08-07 21:37:45 -0700496 ]
497 }
498 }
499
500 config("socketrocket_include_config") {
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200501 include_dirs = [ "objc/AppRTCMobile/third_party/SocketRocket" ]
tkchin2ddfdba2016-08-07 21:37:45 -0700502 }
503
504 config("socketrocket_warning_config") {
505 # GN orders flags on a target before flags from configs. The default config
506 # adds these flags so to cancel them out they need to come from a config and
507 # cannot be on the target directly.
508 cflags = [
509 "-Wno-deprecated-declarations",
510 "-Wno-nonnull",
tkchin2ddfdba2016-08-07 21:37:45 -0700511 "-Wno-semicolon-before-method-body",
kthelgasone47de1a2017-02-24 01:56:01 -0800512 "-Wno-unused-variable",
tkchin2ddfdba2016-08-07 21:37:45 -0700513 ]
514
henrika27d8b612016-09-21 04:13:00 -0700515 cflags_objc = [
516 # Enabled for cflags_objc in build/config/compiler/BUILD.gn.
517 "-Wno-objc-missing-property-synthesis",
henrika27d8b612016-09-21 04:13:00 -0700518 ]
tkchin2ddfdba2016-08-07 21:37:45 -0700519 }
520
kjellanderb62dbbe2016-09-23 00:38:52 -0700521 rtc_static_library("socketrocket") {
kjellander1993b1d2017-03-06 00:29:21 -0800522 testonly = true
tkchin2ddfdba2016-08-07 21:37:45 -0700523 sources = [
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200524 "objc/AppRTCMobile/third_party/SocketRocket/SRWebSocket.h",
525 "objc/AppRTCMobile/third_party/SocketRocket/SRWebSocket.m",
tkchin2ddfdba2016-08-07 21:37:45 -0700526 ]
kthelgasonc0977102017-04-24 00:57:16 -0700527 configs += [ ":socketrocket_warning_config" ]
ehmaldonadoe9cc6862016-09-05 06:10:18 -0700528 public_configs = [ ":socketrocket_include_config" ]
tkchin2ddfdba2016-08-07 21:37:45 -0700529
530 libs = [
531 "CFNetwork.framework",
532 "icucore",
533 ]
534 }
adam.fedorbcc5d872016-11-07 14:53:28 -0800535
536 if (rtc_include_tests) {
kthelgason4065a572017-02-14 04:58:56 -0800537 # TODO(kthelgason): compile xctests on mac when chromium supports it.
538 if (is_ios) {
539 rtc_source_set("apprtcmobile_test_sources") {
Mirko Bonadeicbaaaed2018-02-19 15:14:04 +0100540 # iOS must use WebRTC.framework which is dynamically linked.
541 # 'gn check' is disabled in order to avoid confusion and
542 # errors caused by multiple implementations.
543 check_includes = false
kjellander1993b1d2017-03-06 00:29:21 -0800544 testonly = true
kthelgason4065a572017-02-14 04:58:56 -0800545 include_dirs = [
546 "objc/AppRTCMobile",
547 "objc/AppRTCMobile/ios",
548 ]
549 testonly = true
550 sources = [
551 "objc/AppRTCMobile/tests/ARDAppClient_xctest.mm",
Daniela012b56b2017-11-15 13:15:24 +0100552 "objc/AppRTCMobile/tests/ARDFileCaptureController_xctest.mm",
kthelgason4065a572017-02-14 04:58:56 -0800553 "objc/AppRTCMobile/tests/ARDSettingsModel_xctest.mm",
554 ]
kjellander1993b1d2017-03-06 00:29:21 -0800555 deps = [
kthelgason4065a572017-02-14 04:58:56 -0800556 ":AppRTCMobile_ios_frameworks",
557 ":AppRTCMobile_lib",
Mirko Bonadeicbaaaed2018-02-19 15:14:04 +0100558 ":apprtc_signaling",
Mirko Bonadei1a339c32017-12-14 13:06:10 +0100559 "../rtc_base:rtc_base",
560 "../sdk:framework_objc",
kthelgason4065a572017-02-14 04:58:56 -0800561 "//build/config/ios:xctest",
562 "//third_party/ocmock",
563 ]
adam.fedorbcc5d872016-11-07 14:53:28 -0800564 }
565
kthelgason4065a572017-02-14 04:58:56 -0800566 rtc_ios_xctest_test("apprtcmobile_tests") {
567 info_plist = "objc/AppRTCMobile/ios/Info.plist"
568 sources = [
569 "objc/AppRTCMobile/ios/main.m",
570 ]
571 deps = [
Mirko Bonadeicbaaaed2018-02-19 15:14:04 +0100572 ":AppRTCMobile_lib",
kthelgason4065a572017-02-14 04:58:56 -0800573 ":apprtcmobile_test_sources",
Mirko Bonadei1a339c32017-12-14 13:06:10 +0100574 "../sdk:framework_objc",
kthelgason4065a572017-02-14 04:58:56 -0800575 ]
576 ldflags = [ "-all_load" ]
577 }
adam.fedorbcc5d872016-11-07 14:53:28 -0800578 }
579 }
tkchin2ddfdba2016-08-07 21:37:45 -0700580}
kthelgason0727f152016-08-08 09:03:23 -0700581
582if (is_linux || is_win) {
ehmaldonadod02fe4b2016-08-26 13:31:24 -0700583 config("peerconnection_client_warnings_config") {
kjellander4a9abad2016-09-18 08:12:29 -0700584 cflags = []
ehmaldonadod02fe4b2016-08-26 13:31:24 -0700585 if (is_win && is_clang) {
kjellander4a9abad2016-09-18 08:12:29 -0700586 cflags += [
ehmaldonadod02fe4b2016-08-26 13:31:24 -0700587 # Disable warnings failing when compiling with Clang on Windows.
588 # https://bugs.chromium.org/p/webrtc/issues/detail?id=5366
589 "-Wno-format",
590
591 # See https://bugs.chromium.org/p/webrtc/issues/detail?id=6271
592 # for -Wno-reorder and -Wno-sign-compare
593 "-Wno-reorder",
594 "-Wno-sign-compare",
595 ]
596 }
kjellanderd4626e52016-09-07 02:33:01 -0700597 if (is_linux && target_cpu == "x86") {
kjellander4a9abad2016-09-18 08:12:29 -0700598 cflags += [
kjellanderd4626e52016-09-07 02:33:01 -0700599 # Needed to compile on Linux 32-bit.
600 "-Wno-sentinel",
601 ]
602 }
ehmaldonadod02fe4b2016-08-26 13:31:24 -0700603 }
604
ehmaldonado38a21322016-09-02 04:10:34 -0700605 rtc_executable("peerconnection_client") {
kjellander1993b1d2017-03-06 00:29:21 -0800606 testonly = true
kthelgason0727f152016-08-08 09:03:23 -0700607 sources = [
608 "peerconnection/client/conductor.cc",
609 "peerconnection/client/conductor.h",
610 "peerconnection/client/defaults.cc",
611 "peerconnection/client/defaults.h",
612 "peerconnection/client/peer_connection_client.cc",
613 "peerconnection/client/peer_connection_client.h",
614 ]
ehmaldonado7a2ce0b2016-09-05 01:35:44 -0700615
kjellandere40a7ee2016-10-16 23:56:12 -0700616 if (!build_with_chromium && is_clang) {
617 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
ehmaldonado38a21322016-09-02 04:10:34 -0700618 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
kthelgason0727f152016-08-08 09:03:23 -0700619 }
Patrik Höglundb5b5bce2017-11-13 10:19:58 +0100620 deps = [
Mirko Bonadei34814c72018-01-11 10:13:56 +0100621 "../api:libjingle_peerconnection_api",
Patrik Höglundb5b5bce2017-11-13 10:19:58 +0100622 "../api:video_frame_api_i420",
Patrik Höglunda8005cf2017-12-13 16:05:42 +0100623 "../rtc_base:checks",
Patrik Höglund3e113432017-12-15 14:40:10 +0100624 "../rtc_base:stringutils",
Patrik Höglundb5b5bce2017-11-13 10:19:58 +0100625 ]
kthelgason0727f152016-08-08 09:03:23 -0700626 if (is_win) {
627 sources += [
628 "peerconnection/client/flagdefs.h",
629 "peerconnection/client/main.cc",
630 "peerconnection/client/main_wnd.cc",
631 "peerconnection/client/main_wnd.h",
632 ]
633 cflags = [ "/wd4245" ]
634 configs += [ "//build/config/win:windowed" ]
jianjun.zhuc0247402017-07-11 06:20:45 -0700635 deps += [ "../media:rtc_media_base" ]
kthelgason0727f152016-08-08 09:03:23 -0700636 }
637 if (is_linux) {
638 sources += [
639 "peerconnection/client/linux/main.cc",
640 "peerconnection/client/linux/main_wnd.cc",
641 "peerconnection/client/linux/main_wnd.h",
642 ]
Henrik Kjellanderefbde2c2017-03-27 08:28:27 +0200643 cflags = [ "-Wno-deprecated-declarations" ]
kthelgason0727f152016-08-08 09:03:23 -0700644 libs = [
645 "X11",
646 "Xcomposite",
647 "Xext",
648 "Xrender",
649 ]
thomasandersonef16e992016-12-13 02:57:43 -0800650 deps += [ "//build/config/linux/gtk" ]
kthelgason0727f152016-08-08 09:03:23 -0700651 }
ehmaldonadod02fe4b2016-08-26 13:31:24 -0700652 configs += [ ":peerconnection_client_warnings_config" ]
kjellander1993b1d2017-03-06 00:29:21 -0800653
654 deps += [
Niels Möller8366e172018-02-14 12:20:13 +0100655 "../api:libjingle_peerconnection_api",
jianjun.zhuc0247402017-07-11 06:20:45 -0700656 "../api:libjingle_peerconnection_test_api",
657 "../api:video_frame_api",
Karl Wiberg1b0eae32017-10-17 14:48:54 +0200658 "../api/audio_codecs:builtin_audio_decoder_factory",
659 "../api/audio_codecs:builtin_audio_encoder_factory",
Mirko Bonadei75baa492018-01-11 17:07:30 +0100660 "../media:rtc_audio_video",
jianjun.zhuc0247402017-07-11 06:20:45 -0700661 "../modules/video_capture:video_capture_module",
662 "../pc:libjingle_peerconnection",
ehmaldonadof6a861a2017-07-19 10:40:47 -0700663 "../rtc_base:rtc_base",
664 "../rtc_base:rtc_base_approved",
665 "../rtc_base:rtc_json",
jianjun.zhuc0247402017-07-11 06:20:45 -0700666 "../system_wrappers:field_trial_default",
667 "../system_wrappers:metrics_default",
Ilya Nikolaevskiy2ffe3e82018-01-17 19:57:24 +0000668 "../system_wrappers:runtime_enabled_features_default",
kjellander1993b1d2017-03-06 00:29:21 -0800669 "//third_party/libyuv",
kjellander1993b1d2017-03-06 00:29:21 -0800670 ]
kthelgason0727f152016-08-08 09:03:23 -0700671 }
kjellanderd4626e52016-09-07 02:33:01 -0700672
ehmaldonado38a21322016-09-02 04:10:34 -0700673 rtc_executable("peerconnection_server") {
kjellander1993b1d2017-03-06 00:29:21 -0800674 testonly = true
kthelgason0727f152016-08-08 09:03:23 -0700675 sources = [
676 "peerconnection/server/data_socket.cc",
677 "peerconnection/server/data_socket.h",
678 "peerconnection/server/main.cc",
679 "peerconnection/server/peer_channel.cc",
680 "peerconnection/server/peer_channel.h",
681 "peerconnection/server/utils.cc",
682 "peerconnection/server/utils.h",
683 ]
684 deps = [
jianjun.zhuc0247402017-07-11 06:20:45 -0700685 "..:webrtc_common",
ehmaldonadof6a861a2017-07-19 10:40:47 -0700686 "../rtc_base:rtc_base_approved",
Patrik Höglund3e113432017-12-15 14:40:10 +0100687 "../rtc_base:stringutils",
jianjun.zhuc0247402017-07-11 06:20:45 -0700688 "../rtc_tools:command_line_parser",
kthelgason0727f152016-08-08 09:03:23 -0700689 ]
kjellandere40a7ee2016-10-16 23:56:12 -0700690 if (!build_with_chromium && is_clang) {
691 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
ehmaldonado38a21322016-09-02 04:10:34 -0700692 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
kthelgason0727f152016-08-08 09:03:23 -0700693 }
694 }
ehmaldonado38a21322016-09-02 04:10:34 -0700695 rtc_executable("relayserver") {
kjellander1993b1d2017-03-06 00:29:21 -0800696 testonly = true
kthelgason0727f152016-08-08 09:03:23 -0700697 sources = [
698 "relayserver/relayserver_main.cc",
699 ]
700 deps = [
jianjun.zhuc0247402017-07-11 06:20:45 -0700701 "../p2p:rtc_p2p",
702 "../pc:rtc_pc",
ehmaldonadof6a861a2017-07-19 10:40:47 -0700703 "../rtc_base:rtc_base",
704 "../rtc_base:rtc_base_approved",
jianjun.zhuc0247402017-07-11 06:20:45 -0700705 "../system_wrappers:field_trial_default",
706 "../system_wrappers:metrics_default",
Ilya Nikolaevskiy2ffe3e82018-01-17 19:57:24 +0000707 "../system_wrappers:runtime_enabled_features_default",
kthelgason0727f152016-08-08 09:03:23 -0700708 ]
kjellandere40a7ee2016-10-16 23:56:12 -0700709 if (!build_with_chromium && is_clang) {
710 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
ehmaldonado38a21322016-09-02 04:10:34 -0700711 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
kthelgason0727f152016-08-08 09:03:23 -0700712 }
713 }
ehmaldonado38a21322016-09-02 04:10:34 -0700714 rtc_executable("turnserver") {
kjellander1993b1d2017-03-06 00:29:21 -0800715 testonly = true
kthelgason0727f152016-08-08 09:03:23 -0700716 sources = [
717 "turnserver/turnserver_main.cc",
718 ]
719 deps = [
jianjun.zhuc0247402017-07-11 06:20:45 -0700720 "../p2p:rtc_p2p",
721 "../pc:rtc_pc",
ehmaldonadof6a861a2017-07-19 10:40:47 -0700722 "../rtc_base:rtc_base",
723 "../rtc_base:rtc_base_approved",
jianjun.zhuc0247402017-07-11 06:20:45 -0700724 "../system_wrappers:field_trial_default",
725 "../system_wrappers:metrics_default",
Ilya Nikolaevskiy2ffe3e82018-01-17 19:57:24 +0000726 "../system_wrappers:runtime_enabled_features_default",
kthelgason0727f152016-08-08 09:03:23 -0700727 ]
kjellandere40a7ee2016-10-16 23:56:12 -0700728 if (!build_with_chromium && is_clang) {
729 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
ehmaldonado38a21322016-09-02 04:10:34 -0700730 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
kthelgason0727f152016-08-08 09:03:23 -0700731 }
732 }
ehmaldonado38a21322016-09-02 04:10:34 -0700733 rtc_executable("stunserver") {
kjellander1993b1d2017-03-06 00:29:21 -0800734 testonly = true
kthelgason0727f152016-08-08 09:03:23 -0700735 sources = [
736 "stunserver/stunserver_main.cc",
737 ]
738 deps = [
jianjun.zhuc0247402017-07-11 06:20:45 -0700739 "../p2p:rtc_p2p",
740 "../pc:rtc_pc",
ehmaldonadof6a861a2017-07-19 10:40:47 -0700741 "../rtc_base:rtc_base",
742 "../rtc_base:rtc_base_approved",
jianjun.zhuc0247402017-07-11 06:20:45 -0700743 "../system_wrappers:field_trial_default",
744 "../system_wrappers:metrics_default",
Ilya Nikolaevskiy2ffe3e82018-01-17 19:57:24 +0000745 "../system_wrappers:runtime_enabled_features_default",
kthelgason0727f152016-08-08 09:03:23 -0700746 ]
kjellandere40a7ee2016-10-16 23:56:12 -0700747 if (!build_with_chromium && is_clang) {
748 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
ehmaldonado38a21322016-09-02 04:10:34 -0700749 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
kthelgason0727f152016-08-08 09:03:23 -0700750 }
751 }
752}
charujainaca3a242016-11-01 03:09:15 -0700753
qiangchen42f96d52017-08-08 17:08:03 -0700754if (is_win || is_android) {
gyzhouad7cad82017-05-11 16:10:03 -0700755 rtc_shared_library("webrtc_unity_plugin") {
756 testonly = true
757 sources = [
758 "unityplugin/simple_peer_connection.cc",
759 "unityplugin/simple_peer_connection.h",
760 "unityplugin/unity_plugin_apis.cc",
761 "unityplugin/unity_plugin_apis.h",
gyzhoub38f3862017-07-25 16:04:31 -0700762 "unityplugin/video_observer.cc",
763 "unityplugin/video_observer.h",
gyzhouad7cad82017-05-11 16:10:03 -0700764 ]
qiangchen42f96d52017-08-08 17:08:03 -0700765
766 if (is_android) {
767 sources += [
768 "unityplugin/classreferenceholder.cc",
769 "unityplugin/classreferenceholder.h",
770 "unityplugin/jni_onload.cc",
771 ]
Qiang Chen43fb9122017-12-20 10:47:36 -0800772 suppressed_configs += [ "//build/config/android:hide_all_but_jni_onload" ]
qiangchen42f96d52017-08-08 17:08:03 -0700773 }
774
gyzhouad7cad82017-05-11 16:10:03 -0700775 if (!build_with_chromium && is_clang) {
776 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
777 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
778 }
qiangchen42f96d52017-08-08 17:08:03 -0700779 if (is_win) {
780 cflags = [ "/wd4245" ]
781 configs += [
782 "//build/config/win:windowed",
783 ":peerconnection_client_warnings_config",
784 ]
785 }
gyzhouad7cad82017-05-11 16:10:03 -0700786 deps = [
Mirko Bonadei34814c72018-01-11 10:13:56 +0100787 "../api:libjingle_peerconnection_api",
jianjun.zhuc0247402017-07-11 06:20:45 -0700788 "../api:libjingle_peerconnection_test_api",
789 "../api:video_frame_api",
Qiang Chen51e20462017-12-05 11:11:21 -0800790 "../api/audio_codecs:builtin_audio_decoder_factory",
791 "../api/audio_codecs:builtin_audio_encoder_factory",
Mirko Bonadei75baa492018-01-11 17:07:30 +0100792 "../media:rtc_audio_video",
Anders Carlssona114c882018-01-04 15:10:22 +0100793 "../media:rtc_internal_video_codecs",
jianjun.zhuc0247402017-07-11 06:20:45 -0700794 "../media:rtc_media",
795 "../media:rtc_media_base",
Qiang Chen43fb9122017-12-20 10:47:36 -0800796 "../modules/audio_device:audio_device",
797 "../modules/audio_processing:audio_processing",
jianjun.zhuc0247402017-07-11 06:20:45 -0700798 "../modules/video_capture:video_capture_module",
799 "../pc:libjingle_peerconnection",
qiangchen42f96d52017-08-08 17:08:03 -0700800 "../rtc_base:rtc_base",
jianjun.zhuc0247402017-07-11 06:20:45 -0700801 "../system_wrappers:field_trial_default",
802 "../system_wrappers:metrics_default",
Ilya Nikolaevskiy2ffe3e82018-01-17 19:57:24 +0000803 "../system_wrappers:runtime_enabled_features_default",
gyzhouad7cad82017-05-11 16:10:03 -0700804 ]
qiangchen42f96d52017-08-08 17:08:03 -0700805 if (is_android) {
George Zhou2770c3d2018-03-07 09:58:54 -0800806 deps += [
807 "../modules/utility:utility",
808 "../sdk/android:libjingle_peerconnection_jni",
809 ]
qiangchen42f96d52017-08-08 17:08:03 -0700810 }
811 }
812}
813
814if (is_android) {
Mirko Bonadeifbb3b7d2017-11-07 15:36:33 +0000815 rtc_android_library("webrtc_unity_java") {
qiangchen42f96d52017-08-08 17:08:03 -0700816 java_files = [ "unityplugin/java/src/org/webrtc/UnityUtility.java" ]
817 deps = [
818 "../rtc_base:base_java",
819 "../sdk/android:libjingle_peerconnection_java",
820 ]
821 }
822
823 dist_jar("libwebrtc_unity") {
824 _target_dir_name = get_label_info(":$target_name", "dir")
825 output = "${root_out_dir}/lib.java${_target_dir_name}/${target_name}.jar"
George Zhou2770c3d2018-03-07 09:58:54 -0800826 direct_deps_only = false
qiangchen42f96d52017-08-08 17:08:03 -0700827 use_interface_jars = false
George Zhou2770c3d2018-03-07 09:58:54 -0800828 use_unprocessed_jars = false
Oleh Prypin86021d92017-09-24 22:29:06 +0200829 requires_android = true
qiangchen42f96d52017-08-08 17:08:03 -0700830 deps = [
831 ":webrtc_unity_java",
qiangchen42f96d52017-08-08 17:08:03 -0700832 "../rtc_base:base_java",
833 "../sdk/android:libjingle_peerconnection_java",
834 "../sdk/android:libjingle_peerconnection_metrics_default_java",
835 ]
gyzhouad7cad82017-05-11 16:10:03 -0700836 }
837}
838
charujainaca3a242016-11-01 03:09:15 -0700839if (!build_with_chromium) {
840 # Doesn't build within Chrome on Win.
841 rtc_executable("stun_prober") {
kjellander1993b1d2017-03-06 00:29:21 -0800842 testonly = true
charujainaca3a242016-11-01 03:09:15 -0700843 sources = [
844 "stunprober/main.cc",
845 ]
846
847 if (!build_with_chromium && is_clang) {
848 # Suppress warnings from Chrome's Clang plugins.
849 # See http://code.google.com/p/webrtc/issues/detail?id=163 for details.
850 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
851 }
852
853 deps = [
854 "../p2p:libstunprober",
855 "../p2p:rtc_p2p",
Patrik Höglunda8005cf2017-12-13 16:05:42 +0100856 "../rtc_base:checks",
ehmaldonadof6a861a2017-07-19 10:40:47 -0700857 "../rtc_base:rtc_base",
858 "../rtc_base:rtc_base_approved",
Patrik Höglund3e113432017-12-15 14:40:10 +0100859 "../rtc_base:stringutils",
charujainaca3a242016-11-01 03:09:15 -0700860 "../system_wrappers:field_trial_default",
861 ]
862 }
863}