blob: 561c2452572278e6a1456d2db87cbe817cf548fb [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 ]
32 }
33
charujainaca3a242016-11-01 03:09:15 -070034 if (!build_with_chromium) {
Mirko Bonadei1a339c32017-12-14 13:06:10 +010035 deps += [ ":stun_prober" ]
charujainaca3a242016-11-01 03:09:15 -070036 }
37
kjellander6ceab082016-10-28 05:44:03 -070038 if (is_ios || (is_mac && target_cpu != "x86")) {
Mirko Bonadei1a339c32017-12-14 13:06:10 +010039 deps += [ ":AppRTCMobile" ]
Sami Kalliomaki9c0c75b2016-06-29 14:55:00 +020040 }
kjellander6ceab082016-10-28 05:44:03 -070041
42 if (is_linux || is_win) {
Mirko Bonadei1a339c32017-12-14 13:06:10 +010043 deps += [
kthelgason0727f152016-08-08 09:03:23 -070044 ":peerconnection_client",
45 ":peerconnection_server",
46 ":relayserver",
47 ":stunserver",
48 ":turnserver",
49 ]
50 }
George Zhou2770c3d2018-03-07 09:58:54 -080051
52 if (is_android || is_win) {
53 deps += [ ":webrtc_unity_plugin" ]
54 }
Sami Kalliomaki9c0c75b2016-06-29 14:55:00 +020055}
56
tkchin2ddfdba2016-08-07 21:37:45 -070057if (is_android) {
Mirko Bonadeifbb3b7d2017-11-07 15:36:33 +000058 rtc_android_apk("AppRTCMobile") {
kjellander1993b1d2017-03-06 00:29:21 -080059 testonly = true
Magnus Jedvertc1815cf2016-09-27 10:10:41 +020060 apk_name = "AppRTCMobile"
Sami Kalliomaki9c0c75b2016-06-29 14:55:00 +020061 android_manifest = "androidapp/AndroidManifest.xml"
62
63 deps = [
Magnus Jedvertc1815cf2016-09-27 10:10:41 +020064 ":AppRTCMobile_javalib",
65 ":AppRTCMobile_resources",
jianjun.zhuc0247402017-07-11 06:20:45 -070066 "../rtc_base:base_java",
Sami Kalliomaki9c0c75b2016-06-29 14:55:00 +020067 "//base:base_java",
Sami Kalliomaki9c0c75b2016-06-29 14:55:00 +020068 ]
69
jianjun.zhuc0247402017-07-11 06:20:45 -070070 shared_libraries = [ "../sdk/android:libjingle_peerconnection_so" ]
Sami Kalliomaki9c0c75b2016-06-29 14:55:00 +020071 }
72
Mirko Bonadeifbb3b7d2017-11-07 15:36:33 +000073 rtc_android_library("AppRTCMobile_javalib") {
kjellander1993b1d2017-03-06 00:29:21 -080074 testonly = true
Mirko Bonadei4f024ef2018-01-04 13:12:03 +010075 android_manifest_for_lint = "androidapp/AndroidManifest.xml"
sakal07a050f2017-02-13 05:58:27 -080076
Sami Kalliomaki9c0c75b2016-06-29 14:55:00 +020077 java_files = [
78 "androidapp/src/org/appspot/apprtc/AppRTCAudioManager.java",
henrikac3c2f312016-12-14 07:36:56 -080079 "androidapp/src/org/appspot/apprtc/AppRTCBluetoothManager.java",
Sami Kalliomaki9c0c75b2016-06-29 14:55:00 +020080 "androidapp/src/org/appspot/apprtc/AppRTCClient.java",
81 "androidapp/src/org/appspot/apprtc/AppRTCProximitySensor.java",
82 "androidapp/src/org/appspot/apprtc/CallActivity.java",
83 "androidapp/src/org/appspot/apprtc/CallFragment.java",
84 "androidapp/src/org/appspot/apprtc/CaptureQualityController.java",
85 "androidapp/src/org/appspot/apprtc/ConnectActivity.java",
86 "androidapp/src/org/appspot/apprtc/CpuMonitor.java",
87 "androidapp/src/org/appspot/apprtc/DirectRTCClient.java",
88 "androidapp/src/org/appspot/apprtc/HudFragment.java",
89 "androidapp/src/org/appspot/apprtc/PeerConnectionClient.java",
Sami Kalliomaki9c0c75b2016-06-29 14:55:00 +020090 "androidapp/src/org/appspot/apprtc/RoomParametersFetcher.java",
Qingsi Wanga4e72b72018-02-12 10:34:18 -080091 "androidapp/src/org/appspot/apprtc/RtcEventLog.java",
henrika5641fbb2018-02-21 14:12:53 +010092 "androidapp/src/org/appspot/apprtc/RecordedAudioToFileController.java",
Sami Kalliomaki9c0c75b2016-06-29 14:55:00 +020093 "androidapp/src/org/appspot/apprtc/SettingsActivity.java",
94 "androidapp/src/org/appspot/apprtc/SettingsFragment.java",
95 "androidapp/src/org/appspot/apprtc/TCPChannelClient.java",
96 "androidapp/src/org/appspot/apprtc/UnhandledExceptionHandler.java",
97 "androidapp/src/org/appspot/apprtc/WebSocketChannelClient.java",
98 "androidapp/src/org/appspot/apprtc/WebSocketRTCClient.java",
99 "androidapp/src/org/appspot/apprtc/util/AppRTCUtils.java",
100 "androidapp/src/org/appspot/apprtc/util/AsyncHttpURLConnection.java",
Sami Kalliomaki9c0c75b2016-06-29 14:55:00 +0200101 ]
102
103 deps = [
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200104 ":AppRTCMobile_resources",
jianjun.zhuc0247402017-07-11 06:20:45 -0700105 "../modules/audio_device:audio_device_java",
106 "../rtc_base:base_java",
107 "../sdk/android:libjingle_peerconnection_java",
108 "../sdk/android:libjingle_peerconnection_metrics_default_java",
109 "androidapp/third_party/autobanh:autobanh_java",
Sami Kalliomaki9c0c75b2016-06-29 14:55:00 +0200110 ]
111 }
112
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200113 android_resources("AppRTCMobile_resources") {
kjellander1993b1d2017-03-06 00:29:21 -0800114 testonly = true
Sami Kalliomaki9c0c75b2016-06-29 14:55:00 +0200115 resource_dirs = [ "androidapp/res" ]
116 custom_package = "org.appspot.apprtc"
117 }
118
Mirko Bonadeifbb3b7d2017-11-07 15:36:33 +0000119 rtc_instrumentation_test_apk("AppRTCMobileTest") {
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200120 apk_name = "AppRTCMobileTest"
Sami Kalliomaki9c0c75b2016-06-29 14:55:00 +0200121 android_manifest = "androidtests/AndroidManifest.xml"
122
Patrik Höglunda8005cf2017-12-13 16:05:42 +0100123 java_files = [
124 "androidtests/src/org/appspot/apprtc/test/PeerConnectionClientTest.java",
125 ]
Sami Kalliomaki9c0c75b2016-06-29 14:55:00 +0200126
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200127 apk_under_test = ":AppRTCMobile"
Sami Kalliomaki9c0c75b2016-06-29 14:55:00 +0200128
129 deps = [
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200130 ":AppRTCMobile_javalib",
jianjun.zhuc0247402017-07-11 06:20:45 -0700131 "../sdk/android:libjingle_peerconnection_java",
sakalcb79d512017-01-11 06:21:26 -0800132 "//third_party/android_support_test_runner:runner_java",
133 "//third_party/junit",
Sami Kalliomaki9c0c75b2016-06-29 14:55:00 +0200134 ]
135 }
mandermoa6069e82017-01-16 02:23:09 -0800136
Mirko Bonadeifbb3b7d2017-11-07 15:36:33 +0000137 rtc_instrumentation_test_apk("AppRTCMobileTestStubbedVideoIO") {
mandermoa6069e82017-01-16 02:23:09 -0800138 apk_name = "AppRTCMobileTestStubbedVideoIO"
139 android_manifest = "androidtests/AndroidManifest.xml"
140
oprypin30cda5e2017-04-24 04:15:13 -0700141 java_files = [ "androidtests/src/org/appspot/apprtc/test/CallActivityStubbedInputOutputTest.java" ]
mandermoa6069e82017-01-16 02:23:09 -0800142
143 apk_under_test = ":AppRTCMobile"
144
145 deps = [
146 ":AppRTCMobile_javalib",
jianjun.zhuc0247402017-07-11 06:20:45 -0700147 "../sdk/android:libjingle_peerconnection_java",
mandermoa6069e82017-01-16 02:23:09 -0800148 "//third_party/android_support_test_runner:rules_java",
149 "//third_party/android_support_test_runner:runner_java",
150 "//third_party/espresso:espresso_all_java",
151 "//third_party/hamcrest:hamcrest_java",
152 "//third_party/junit",
mandermoa6069e82017-01-16 02:23:09 -0800153 ]
154
155 data = [
Edward Lemur70ba9b42018-01-22 13:46:58 +0100156 "../build/android/adb_reverse_forwarder.py",
157 "../examples/androidtests/video_quality_loopback_test.py",
Mirko Bonadei92ea95e2017-09-15 06:47:31 +0200158 "../resources/reference_video_640x360_30fps.y4m",
Edward Lemur70ba9b42018-01-22 13:46:58 +0100159 "../rtc_tools/barcode_tools/barcode_decoder.py",
160 "../rtc_tools/barcode_tools/helper_functions.py",
161 "../rtc_tools/compare_videos.py",
162 "../rtc_tools/testing/prebuilt_apprtc.zip",
163 "../rtc_tools/testing/golang/linux/go.tar.gz",
164 "../rtc_tools/testing/build_apprtc.py",
165 "../rtc_tools/testing/utils.py",
166 "../tools_webrtc/video_quality_toolchain/linux/ffmpeg",
167 "../tools_webrtc/video_quality_toolchain/linux/frame_analyzer",
168 "../tools_webrtc/video_quality_toolchain/linux/zxing",
mandermoa6069e82017-01-16 02:23:09 -0800169 ]
170 }
Sami Kalliomaki9c0c75b2016-06-29 14:55:00 +0200171}
tkchin2ddfdba2016-08-07 21:37:45 -0700172
173if (is_ios || (is_mac && target_cpu != "x86")) {
tkchin2ddfdba2016-08-07 21:37:45 -0700174 config("apprtc_common_config") {
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200175 include_dirs = [ "objc/AppRTCMobile/common" ]
tkchin2ddfdba2016-08-07 21:37:45 -0700176 }
177
kjellanderb62dbbe2016-09-23 00:38:52 -0700178 rtc_static_library("apprtc_common") {
kjellander1993b1d2017-03-06 00:29:21 -0800179 testonly = true
tkchin2ddfdba2016-08-07 21:37:45 -0700180 sources = [
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200181 "objc/AppRTCMobile/common/ARDUtilities.h",
182 "objc/AppRTCMobile/common/ARDUtilities.m",
tkchin2ddfdba2016-08-07 21:37:45 -0700183 ]
ehmaldonadoe9cc6862016-09-05 06:10:18 -0700184 public_configs = [ ":apprtc_common_config" ]
tkchin2ddfdba2016-08-07 21:37:45 -0700185
Kári Tristan Helgason946923a2017-06-02 14:05:56 +0200186 if (is_ios) {
Mirko Bonadeicbaaaed2018-02-19 15:14:04 +0100187 # iOS must use WebRTC.framework which is dynamically linked.
188 # 'gn check' is disabled in order to avoid confusion and
189 # errors caused by multiple implementations.
190 check_includes = false
kthelgason5901d9d2017-08-16 07:28:03 -0700191 deps = [
Kári Tristan Helgason99bf77c2018-02-16 10:49:22 +0100192 "../sdk:framework_objc",
Mirko Bonadei1a339c32017-12-14 13:06:10 +0100193 "../system_wrappers:field_trial_default",
Ilya Nikolaevskiy2ffe3e82018-01-17 19:57:24 +0000194 "../system_wrappers:runtime_enabled_features_default",
kthelgason5901d9d2017-08-16 07:28:03 -0700195 ]
Kári Tristan Helgason946923a2017-06-02 14:05:56 +0200196 } else {
kthelgason5901d9d2017-08-16 07:28:03 -0700197 deps = [
kthelgason36d658d2017-08-24 05:43:45 -0700198 "../sdk:common_objc",
kthelgason5901d9d2017-08-16 07:28:03 -0700199 "../system_wrappers:field_trial_default",
200 "../system_wrappers:metrics_default",
Ilya Nikolaevskiy2ffe3e82018-01-17 19:57:24 +0000201 "../system_wrappers:runtime_enabled_features_default",
kthelgason5901d9d2017-08-16 07:28:03 -0700202 ]
Kári Tristan Helgason946923a2017-06-02 14:05:56 +0200203 }
tkchin2ddfdba2016-08-07 21:37:45 -0700204 }
205
206 config("apprtc_signaling_config") {
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200207 include_dirs = [ "objc/AppRTCMobile" ]
tkchin2ddfdba2016-08-07 21:37:45 -0700208
209 # GN orders flags on a target before flags from configs. The default config
210 # adds these flags so to cancel them out they need to come from a config and
211 # cannot be on the target directly.
212 cflags = [
213 "-Wno-sign-compare",
214 "-Wno-unused-variable",
215 ]
tkchin2ddfdba2016-08-07 21:37:45 -0700216 }
217
kjellanderb62dbbe2016-09-23 00:38:52 -0700218 rtc_static_library("apprtc_signaling") {
kjellander1993b1d2017-03-06 00:29:21 -0800219 testonly = true
tkchin2ddfdba2016-08-07 21:37:45 -0700220 sources = [
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200221 "objc/AppRTCMobile/ARDAppClient+Internal.h",
222 "objc/AppRTCMobile/ARDAppClient.h",
223 "objc/AppRTCMobile/ARDAppClient.m",
224 "objc/AppRTCMobile/ARDAppEngineClient.h",
225 "objc/AppRTCMobile/ARDAppEngineClient.m",
226 "objc/AppRTCMobile/ARDBitrateTracker.h",
227 "objc/AppRTCMobile/ARDBitrateTracker.m",
sakalc522e752017-04-05 12:17:48 -0700228 "objc/AppRTCMobile/ARDCaptureController.h",
229 "objc/AppRTCMobile/ARDCaptureController.m",
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200230 "objc/AppRTCMobile/ARDJoinResponse+Internal.h",
231 "objc/AppRTCMobile/ARDJoinResponse.h",
232 "objc/AppRTCMobile/ARDJoinResponse.m",
233 "objc/AppRTCMobile/ARDMessageResponse+Internal.h",
234 "objc/AppRTCMobile/ARDMessageResponse.h",
235 "objc/AppRTCMobile/ARDMessageResponse.m",
236 "objc/AppRTCMobile/ARDRoomServerClient.h",
sakalc4adacf2017-03-28 01:22:48 -0700237 "objc/AppRTCMobile/ARDSettingsModel+Private.h",
238 "objc/AppRTCMobile/ARDSettingsModel.h",
239 "objc/AppRTCMobile/ARDSettingsModel.m",
240 "objc/AppRTCMobile/ARDSettingsStore.h",
241 "objc/AppRTCMobile/ARDSettingsStore.m",
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200242 "objc/AppRTCMobile/ARDSignalingChannel.h",
243 "objc/AppRTCMobile/ARDSignalingMessage.h",
244 "objc/AppRTCMobile/ARDSignalingMessage.m",
245 "objc/AppRTCMobile/ARDStatsBuilder.h",
246 "objc/AppRTCMobile/ARDStatsBuilder.m",
kthelgasoncc882af2017-01-13 05:59:46 -0800247 "objc/AppRTCMobile/ARDTURNClient+Internal.h",
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200248 "objc/AppRTCMobile/ARDTURNClient.h",
kthelgasoncc882af2017-01-13 05:59:46 -0800249 "objc/AppRTCMobile/ARDTURNClient.m",
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200250 "objc/AppRTCMobile/ARDWebSocketChannel.h",
251 "objc/AppRTCMobile/ARDWebSocketChannel.m",
252 "objc/AppRTCMobile/RTCIceCandidate+JSON.h",
253 "objc/AppRTCMobile/RTCIceCandidate+JSON.m",
254 "objc/AppRTCMobile/RTCIceServer+JSON.h",
255 "objc/AppRTCMobile/RTCIceServer+JSON.m",
256 "objc/AppRTCMobile/RTCMediaConstraints+JSON.h",
257 "objc/AppRTCMobile/RTCMediaConstraints+JSON.m",
258 "objc/AppRTCMobile/RTCSessionDescription+JSON.h",
259 "objc/AppRTCMobile/RTCSessionDescription+JSON.m",
tkchin2ddfdba2016-08-07 21:37:45 -0700260 ]
ehmaldonadoe9cc6862016-09-05 06:10:18 -0700261 public_configs = [ ":apprtc_signaling_config" ]
tkchin2ddfdba2016-08-07 21:37:45 -0700262 deps = [
263 ":apprtc_common",
264 ":socketrocket",
265 ]
Kári Tristan Helgason946923a2017-06-02 14:05:56 +0200266 if (is_ios) {
Mirko Bonadeicbaaaed2018-02-19 15:14:04 +0100267 # iOS must use WebRTC.framework which is dynamically linked.
268 # 'gn check' is disabled in order to avoid confusion and
269 # errors caused by multiple implementations.
270 check_includes = false
Mirko Bonadei1a339c32017-12-14 13:06:10 +0100271 deps += [
272 ":AppRTCMobile_ios_frameworks",
273 "../sdk:framework_objc",
Kári Tristan Helgason946923a2017-06-02 14:05:56 +0200274 ]
Mirko Bonadei1a339c32017-12-14 13:06:10 +0100275 } else {
Mirko Bonadeicbaaaed2018-02-19 15:14:04 +0100276 deps += [
277 "../sdk:common_objc",
278 "../sdk:mediaconstraints_objc",
279 "../sdk:peerconnectionfactory_base_objc",
280 "../sdk:videocapture_objc",
281 "../sdk:videocodec_objc",
Anders Carlsson9823ee42018-03-07 10:32:03 +0100282 "../sdk:videosource_objc",
Mirko Bonadeicbaaaed2018-02-19 15:14:04 +0100283 ]
Kári Tristan Helgason946923a2017-06-02 14:05:56 +0200284 }
tkchin2ddfdba2016-08-07 21:37:45 -0700285 libs = [ "QuartzCore.framework" ]
286 }
287
288 if (is_ios) {
denicija77bfd7c2016-11-15 00:41:26 -0800289 rtc_static_library("AppRTCMobile_lib") {
Mirko Bonadeicbaaaed2018-02-19 15:14:04 +0100290 # iOS must use WebRTC.framework which is dynamically linked.
291 # 'gn check' is disabled in order to avoid confusion and
292 # errors caused by multiple implementations.
293 check_includes = false
kjellander1993b1d2017-03-06 00:29:21 -0800294 testonly = true
tkchin2ddfdba2016-08-07 21:37:45 -0700295 sources = [
Patrik Höglund49acb1e2018-01-02 14:41:54 +0100296 "objc/AppRTCMobile/ios/ARDAppDelegate.h",
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200297 "objc/AppRTCMobile/ios/ARDAppDelegate.m",
Daniela012b56b2017-11-15 13:15:24 +0100298 "objc/AppRTCMobile/ios/ARDFileCaptureController.h",
299 "objc/AppRTCMobile/ios/ARDFileCaptureController.m",
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200300 "objc/AppRTCMobile/ios/ARDMainView.h",
301 "objc/AppRTCMobile/ios/ARDMainView.m",
302 "objc/AppRTCMobile/ios/ARDMainViewController.h",
303 "objc/AppRTCMobile/ios/ARDMainViewController.m",
denicijad17d5362016-11-02 02:56:09 -0700304 "objc/AppRTCMobile/ios/ARDSettingsViewController.h",
305 "objc/AppRTCMobile/ios/ARDSettingsViewController.m",
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200306 "objc/AppRTCMobile/ios/ARDStatsView.h",
307 "objc/AppRTCMobile/ios/ARDStatsView.m",
308 "objc/AppRTCMobile/ios/ARDVideoCallView.h",
309 "objc/AppRTCMobile/ios/ARDVideoCallView.m",
310 "objc/AppRTCMobile/ios/ARDVideoCallViewController.h",
311 "objc/AppRTCMobile/ios/ARDVideoCallViewController.m",
Anders Carlsson6bf43d22017-10-16 13:51:43 +0200312 "objc/AppRTCMobile/ios/RTCVideoCodecInfo+HumanReadable.h",
313 "objc/AppRTCMobile/ios/RTCVideoCodecInfo+HumanReadable.m",
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200314 "objc/AppRTCMobile/ios/UIImage+ARDUtilities.h",
315 "objc/AppRTCMobile/ios/UIImage+ARDUtilities.m",
denicija77bfd7c2016-11-15 00:41:26 -0800316 ]
denicija77bfd7c2016-11-15 00:41:26 -0800317
318 deps = [
Kári Tristan Helgason946923a2017-06-02 14:05:56 +0200319 ":AppRTCMobile_ios_frameworks",
denicija77bfd7c2016-11-15 00:41:26 -0800320 ":apprtc_common",
321 ":apprtc_signaling",
Mirko Bonadei1a339c32017-12-14 13:06:10 +0100322 "../sdk:framework_objc",
denicija77bfd7c2016-11-15 00:41:26 -0800323 ]
324 }
325
326 ios_app_bundle("AppRTCMobile") {
kjellander1993b1d2017-03-06 00:29:21 -0800327 testonly = true
denicija77bfd7c2016-11-15 00:41:26 -0800328 sources = [
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200329 "objc/AppRTCMobile/ios/main.m",
tkchin2ddfdba2016-08-07 21:37:45 -0700330 ]
331
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200332 info_plist = "objc/AppRTCMobile/ios/Info.plist"
tkchin2ddfdba2016-08-07 21:37:45 -0700333
denicija77bfd7c2016-11-15 00:41:26 -0800334 configs += [ "..:common_config" ]
tkchin2ddfdba2016-08-07 21:37:45 -0700335 public_configs = [ "..:common_inherited_config" ]
336
337 deps = [
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200338 ":AppRTCMobile_ios_bundle_data",
kthelgasond3adbfb2017-01-26 01:14:04 -0800339 ":AppRTCMobile_ios_frameworks",
denicija77bfd7c2016-11-15 00:41:26 -0800340 ":AppRTCMobile_lib",
Mirko Bonadei1a339c32017-12-14 13:06:10 +0100341 "../sdk:framework_objc",
tkchin2ddfdba2016-08-07 21:37:45 -0700342 ]
343
344 if (target_cpu == "x86") {
345 deps += [ "//testing/iossim:iossim" ]
346 }
347 }
348
kthelgasond3adbfb2017-01-26 01:14:04 -0800349 bundle_data("AppRTCMobile_ios_frameworks") {
Mirko Bonadei1a339c32017-12-14 13:06:10 +0100350 deps = [
kthelgason36d658d2017-08-24 05:43:45 -0700351 "../sdk:framework_objc+link",
kthelgasond3adbfb2017-01-26 01:14:04 -0800352 ]
353 sources = [
wjywbsbef8a5d2017-10-09 02:32:28 -0400354 "$root_build_dir/WebRTC.framework",
kthelgasond3adbfb2017-01-26 01:14:04 -0800355 ]
356 outputs = [
357 "{{bundle_resources_dir}}/Frameworks/{{source_file_part}}",
358 ]
359 }
360
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200361 bundle_data("AppRTCMobile_ios_bundle_data") {
tkchin2ddfdba2016-08-07 21:37:45 -0700362 sources = [
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200363 "objc/AppRTCMobile/ios/resources/Roboto-Regular.ttf",
Daniela012b56b2017-11-15 13:15:24 +0100364
365 # Sample video taken from https://media.xiph.org/video/derf/
366 "objc/AppRTCMobile/ios/resources/foreman.mp4",
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200367 "objc/AppRTCMobile/ios/resources/iPhone5@2x.png",
368 "objc/AppRTCMobile/ios/resources/iPhone6@2x.png",
369 "objc/AppRTCMobile/ios/resources/iPhone6p@3x.png",
370 "objc/AppRTCMobile/ios/resources/ic_call_end_black_24dp.png",
371 "objc/AppRTCMobile/ios/resources/ic_call_end_black_24dp@2x.png",
372 "objc/AppRTCMobile/ios/resources/ic_clear_black_24dp.png",
373 "objc/AppRTCMobile/ios/resources/ic_clear_black_24dp@2x.png",
denicija6d6762c2016-10-28 04:53:16 -0700374 "objc/AppRTCMobile/ios/resources/ic_settings_black_24dp.png",
375 "objc/AppRTCMobile/ios/resources/ic_settings_black_24dp@2x.png",
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200376 "objc/AppRTCMobile/ios/resources/ic_surround_sound_black_24dp.png",
377 "objc/AppRTCMobile/ios/resources/ic_surround_sound_black_24dp@2x.png",
378 "objc/AppRTCMobile/ios/resources/ic_switch_video_black_24dp.png",
379 "objc/AppRTCMobile/ios/resources/ic_switch_video_black_24dp@2x.png",
380 "objc/AppRTCMobile/ios/resources/mozart.mp3",
anderscb5ed9052017-08-15 04:07:12 -0700381 "objc/Icon-120.png",
382 "objc/Icon-180.png",
tkchin2ddfdba2016-08-07 21:37:45 -0700383 "objc/Icon.png",
384 ]
385 outputs = [
386 "{{bundle_resources_dir}}/{{source_file_part}}",
387 ]
388 }
389 }
390
391 if (is_mac) {
denicija77bfd7c2016-11-15 00:41:26 -0800392 rtc_static_library("AppRTCMobile_lib") {
kjellander1993b1d2017-03-06 00:29:21 -0800393 testonly = true
tkchin2ddfdba2016-08-07 21:37:45 -0700394 sources = [
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200395 "objc/AppRTCMobile/mac/APPRTCAppDelegate.h",
396 "objc/AppRTCMobile/mac/APPRTCAppDelegate.m",
397 "objc/AppRTCMobile/mac/APPRTCViewController.h",
398 "objc/AppRTCMobile/mac/APPRTCViewController.m",
tkchin2ddfdba2016-08-07 21:37:45 -0700399 ]
jianjun.zhuc0247402017-07-11 06:20:45 -0700400 configs += [ "..:common_objc" ]
tkchin2ddfdba2016-08-07 21:37:45 -0700401 deps = [
402 ":apprtc_common",
403 ":apprtc_signaling",
Kári Tristan Helgason99bf77c2018-02-16 10:49:22 +0100404 "../sdk:default_codec_factory_objc",
Mirko Bonadei1a339c32017-12-14 13:06:10 +0100405 "../sdk:metal_objc",
Mirko Bonadeicbaaaed2018-02-19 15:14:04 +0100406 "../sdk:peerconnectionfactory_base_objc",
kthelgason36d658d2017-08-24 05:43:45 -0700407 "../sdk:ui_objc",
Mirko Bonadeicbaaaed2018-02-19 15:14:04 +0100408 "../sdk:videocapture_objc",
409 "../sdk:videocodec_objc",
Kári Tristan Helgason99bf77c2018-02-16 10:49:22 +0100410 "../sdk:videocodec_objc",
411 "../sdk:videotoolbox_objc",
tkchin2ddfdba2016-08-07 21:37:45 -0700412 ]
413 }
414
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200415 mac_app_bundle("AppRTCMobile") {
kjellander1993b1d2017-03-06 00:29:21 -0800416 testonly = true
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200417 output_name = "AppRTCMobile"
tkchin2ddfdba2016-08-07 21:37:45 -0700418
tkchin2ddfdba2016-08-07 21:37:45 -0700419 sources = [
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200420 "objc/AppRTCMobile/mac/main.m",
tkchin2ddfdba2016-08-07 21:37:45 -0700421 ]
422
423 public_configs = [ "..:common_inherited_config" ]
424
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200425 info_plist = "objc/AppRTCMobile/mac/Info.plist"
tkchin2ddfdba2016-08-07 21:37:45 -0700426
427 libs = [ "AppKit.framework" ]
428
429 deps = [
denicija77bfd7c2016-11-15 00:41:26 -0800430 ":AppRTCMobile_lib",
tkchin2ddfdba2016-08-07 21:37:45 -0700431 ]
432 }
433 }
434
435 config("socketrocket_include_config") {
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200436 include_dirs = [ "objc/AppRTCMobile/third_party/SocketRocket" ]
tkchin2ddfdba2016-08-07 21:37:45 -0700437 }
438
439 config("socketrocket_warning_config") {
440 # GN orders flags on a target before flags from configs. The default config
441 # adds these flags so to cancel them out they need to come from a config and
442 # cannot be on the target directly.
443 cflags = [
444 "-Wno-deprecated-declarations",
445 "-Wno-nonnull",
tkchin2ddfdba2016-08-07 21:37:45 -0700446 "-Wno-semicolon-before-method-body",
kthelgasone47de1a2017-02-24 01:56:01 -0800447 "-Wno-unused-variable",
tkchin2ddfdba2016-08-07 21:37:45 -0700448 ]
449
henrika27d8b612016-09-21 04:13:00 -0700450 cflags_objc = [
451 # Enabled for cflags_objc in build/config/compiler/BUILD.gn.
452 "-Wno-objc-missing-property-synthesis",
henrika27d8b612016-09-21 04:13:00 -0700453 ]
tkchin2ddfdba2016-08-07 21:37:45 -0700454 }
455
kjellanderb62dbbe2016-09-23 00:38:52 -0700456 rtc_static_library("socketrocket") {
kjellander1993b1d2017-03-06 00:29:21 -0800457 testonly = true
tkchin2ddfdba2016-08-07 21:37:45 -0700458 sources = [
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200459 "objc/AppRTCMobile/third_party/SocketRocket/SRWebSocket.h",
460 "objc/AppRTCMobile/third_party/SocketRocket/SRWebSocket.m",
tkchin2ddfdba2016-08-07 21:37:45 -0700461 ]
kthelgasonc0977102017-04-24 00:57:16 -0700462 configs += [ ":socketrocket_warning_config" ]
ehmaldonadoe9cc6862016-09-05 06:10:18 -0700463 public_configs = [ ":socketrocket_include_config" ]
tkchin2ddfdba2016-08-07 21:37:45 -0700464
465 libs = [
466 "CFNetwork.framework",
467 "icucore",
468 ]
469 }
adam.fedorbcc5d872016-11-07 14:53:28 -0800470
471 if (rtc_include_tests) {
kthelgason4065a572017-02-14 04:58:56 -0800472 # TODO(kthelgason): compile xctests on mac when chromium supports it.
473 if (is_ios) {
474 rtc_source_set("apprtcmobile_test_sources") {
Mirko Bonadeicbaaaed2018-02-19 15:14:04 +0100475 # iOS must use WebRTC.framework which is dynamically linked.
476 # 'gn check' is disabled in order to avoid confusion and
477 # errors caused by multiple implementations.
478 check_includes = false
kjellander1993b1d2017-03-06 00:29:21 -0800479 testonly = true
kthelgason4065a572017-02-14 04:58:56 -0800480 include_dirs = [
481 "objc/AppRTCMobile",
482 "objc/AppRTCMobile/ios",
483 ]
484 testonly = true
485 sources = [
486 "objc/AppRTCMobile/tests/ARDAppClient_xctest.mm",
Daniela012b56b2017-11-15 13:15:24 +0100487 "objc/AppRTCMobile/tests/ARDFileCaptureController_xctest.mm",
kthelgason4065a572017-02-14 04:58:56 -0800488 "objc/AppRTCMobile/tests/ARDSettingsModel_xctest.mm",
489 ]
kjellander1993b1d2017-03-06 00:29:21 -0800490 deps = [
kthelgason4065a572017-02-14 04:58:56 -0800491 ":AppRTCMobile_ios_frameworks",
492 ":AppRTCMobile_lib",
Mirko Bonadeicbaaaed2018-02-19 15:14:04 +0100493 ":apprtc_signaling",
Mirko Bonadei1a339c32017-12-14 13:06:10 +0100494 "../rtc_base:rtc_base",
495 "../sdk:framework_objc",
kthelgason4065a572017-02-14 04:58:56 -0800496 "//build/config/ios:xctest",
497 "//third_party/ocmock",
498 ]
adam.fedorbcc5d872016-11-07 14:53:28 -0800499 }
500
kthelgason4065a572017-02-14 04:58:56 -0800501 rtc_ios_xctest_test("apprtcmobile_tests") {
502 info_plist = "objc/AppRTCMobile/ios/Info.plist"
503 sources = [
504 "objc/AppRTCMobile/ios/main.m",
505 ]
506 deps = [
Mirko Bonadeicbaaaed2018-02-19 15:14:04 +0100507 ":AppRTCMobile_lib",
kthelgason4065a572017-02-14 04:58:56 -0800508 ":apprtcmobile_test_sources",
Mirko Bonadei1a339c32017-12-14 13:06:10 +0100509 "../sdk:framework_objc",
kthelgason4065a572017-02-14 04:58:56 -0800510 ]
511 ldflags = [ "-all_load" ]
512 }
adam.fedorbcc5d872016-11-07 14:53:28 -0800513 }
514 }
tkchin2ddfdba2016-08-07 21:37:45 -0700515}
kthelgason0727f152016-08-08 09:03:23 -0700516
517if (is_linux || is_win) {
ehmaldonadod02fe4b2016-08-26 13:31:24 -0700518 config("peerconnection_client_warnings_config") {
kjellander4a9abad2016-09-18 08:12:29 -0700519 cflags = []
ehmaldonadod02fe4b2016-08-26 13:31:24 -0700520 if (is_win && is_clang) {
kjellander4a9abad2016-09-18 08:12:29 -0700521 cflags += [
ehmaldonadod02fe4b2016-08-26 13:31:24 -0700522 # Disable warnings failing when compiling with Clang on Windows.
523 # https://bugs.chromium.org/p/webrtc/issues/detail?id=5366
524 "-Wno-format",
525
526 # See https://bugs.chromium.org/p/webrtc/issues/detail?id=6271
527 # for -Wno-reorder and -Wno-sign-compare
528 "-Wno-reorder",
529 "-Wno-sign-compare",
530 ]
531 }
kjellanderd4626e52016-09-07 02:33:01 -0700532 if (is_linux && target_cpu == "x86") {
kjellander4a9abad2016-09-18 08:12:29 -0700533 cflags += [
kjellanderd4626e52016-09-07 02:33:01 -0700534 # Needed to compile on Linux 32-bit.
535 "-Wno-sentinel",
536 ]
537 }
ehmaldonadod02fe4b2016-08-26 13:31:24 -0700538 }
539
ehmaldonado38a21322016-09-02 04:10:34 -0700540 rtc_executable("peerconnection_client") {
kjellander1993b1d2017-03-06 00:29:21 -0800541 testonly = true
kthelgason0727f152016-08-08 09:03:23 -0700542 sources = [
543 "peerconnection/client/conductor.cc",
544 "peerconnection/client/conductor.h",
545 "peerconnection/client/defaults.cc",
546 "peerconnection/client/defaults.h",
547 "peerconnection/client/peer_connection_client.cc",
548 "peerconnection/client/peer_connection_client.h",
549 ]
ehmaldonado7a2ce0b2016-09-05 01:35:44 -0700550
kjellandere40a7ee2016-10-16 23:56:12 -0700551 if (!build_with_chromium && is_clang) {
552 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
ehmaldonado38a21322016-09-02 04:10:34 -0700553 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
kthelgason0727f152016-08-08 09:03:23 -0700554 }
Patrik Höglundb5b5bce2017-11-13 10:19:58 +0100555 deps = [
Mirko Bonadei34814c72018-01-11 10:13:56 +0100556 "../api:libjingle_peerconnection_api",
Patrik Höglundb5b5bce2017-11-13 10:19:58 +0100557 "../api:video_frame_api_i420",
Patrik Höglunda8005cf2017-12-13 16:05:42 +0100558 "../rtc_base:checks",
Patrik Höglund3e113432017-12-15 14:40:10 +0100559 "../rtc_base:stringutils",
Patrik Höglundb5b5bce2017-11-13 10:19:58 +0100560 ]
kthelgason0727f152016-08-08 09:03:23 -0700561 if (is_win) {
562 sources += [
563 "peerconnection/client/flagdefs.h",
564 "peerconnection/client/main.cc",
565 "peerconnection/client/main_wnd.cc",
566 "peerconnection/client/main_wnd.h",
567 ]
568 cflags = [ "/wd4245" ]
569 configs += [ "//build/config/win:windowed" ]
jianjun.zhuc0247402017-07-11 06:20:45 -0700570 deps += [ "../media:rtc_media_base" ]
kthelgason0727f152016-08-08 09:03:23 -0700571 }
572 if (is_linux) {
573 sources += [
574 "peerconnection/client/linux/main.cc",
575 "peerconnection/client/linux/main_wnd.cc",
576 "peerconnection/client/linux/main_wnd.h",
577 ]
Henrik Kjellanderefbde2c2017-03-27 08:28:27 +0200578 cflags = [ "-Wno-deprecated-declarations" ]
kthelgason0727f152016-08-08 09:03:23 -0700579 libs = [
580 "X11",
581 "Xcomposite",
582 "Xext",
583 "Xrender",
584 ]
thomasandersonef16e992016-12-13 02:57:43 -0800585 deps += [ "//build/config/linux/gtk" ]
kthelgason0727f152016-08-08 09:03:23 -0700586 }
ehmaldonadod02fe4b2016-08-26 13:31:24 -0700587 configs += [ ":peerconnection_client_warnings_config" ]
kjellander1993b1d2017-03-06 00:29:21 -0800588
589 deps += [
Niels Möller8366e172018-02-14 12:20:13 +0100590 "../api:libjingle_peerconnection_api",
jianjun.zhuc0247402017-07-11 06:20:45 -0700591 "../api:libjingle_peerconnection_test_api",
592 "../api:video_frame_api",
Karl Wiberg1b0eae32017-10-17 14:48:54 +0200593 "../api/audio_codecs:builtin_audio_decoder_factory",
594 "../api/audio_codecs:builtin_audio_encoder_factory",
Mirko Bonadei75baa492018-01-11 17:07:30 +0100595 "../media:rtc_audio_video",
jianjun.zhuc0247402017-07-11 06:20:45 -0700596 "../modules/video_capture:video_capture_module",
597 "../pc:libjingle_peerconnection",
ehmaldonadof6a861a2017-07-19 10:40:47 -0700598 "../rtc_base:rtc_base",
599 "../rtc_base:rtc_base_approved",
600 "../rtc_base:rtc_json",
jianjun.zhuc0247402017-07-11 06:20:45 -0700601 "../system_wrappers:field_trial_default",
602 "../system_wrappers:metrics_default",
Ilya Nikolaevskiy2ffe3e82018-01-17 19:57:24 +0000603 "../system_wrappers:runtime_enabled_features_default",
kjellander1993b1d2017-03-06 00:29:21 -0800604 "//third_party/libyuv",
kjellander1993b1d2017-03-06 00:29:21 -0800605 ]
kthelgason0727f152016-08-08 09:03:23 -0700606 }
kjellanderd4626e52016-09-07 02:33:01 -0700607
ehmaldonado38a21322016-09-02 04:10:34 -0700608 rtc_executable("peerconnection_server") {
kjellander1993b1d2017-03-06 00:29:21 -0800609 testonly = true
kthelgason0727f152016-08-08 09:03:23 -0700610 sources = [
611 "peerconnection/server/data_socket.cc",
612 "peerconnection/server/data_socket.h",
613 "peerconnection/server/main.cc",
614 "peerconnection/server/peer_channel.cc",
615 "peerconnection/server/peer_channel.h",
616 "peerconnection/server/utils.cc",
617 "peerconnection/server/utils.h",
618 ]
619 deps = [
jianjun.zhuc0247402017-07-11 06:20:45 -0700620 "..:webrtc_common",
ehmaldonadof6a861a2017-07-19 10:40:47 -0700621 "../rtc_base:rtc_base_approved",
Patrik Höglund3e113432017-12-15 14:40:10 +0100622 "../rtc_base:stringutils",
jianjun.zhuc0247402017-07-11 06:20:45 -0700623 "../rtc_tools:command_line_parser",
kthelgason0727f152016-08-08 09:03:23 -0700624 ]
kjellandere40a7ee2016-10-16 23:56:12 -0700625 if (!build_with_chromium && is_clang) {
626 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
ehmaldonado38a21322016-09-02 04:10:34 -0700627 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
kthelgason0727f152016-08-08 09:03:23 -0700628 }
629 }
ehmaldonado38a21322016-09-02 04:10:34 -0700630 rtc_executable("relayserver") {
kjellander1993b1d2017-03-06 00:29:21 -0800631 testonly = true
kthelgason0727f152016-08-08 09:03:23 -0700632 sources = [
633 "relayserver/relayserver_main.cc",
634 ]
635 deps = [
jianjun.zhuc0247402017-07-11 06:20:45 -0700636 "../p2p:rtc_p2p",
637 "../pc:rtc_pc",
ehmaldonadof6a861a2017-07-19 10:40:47 -0700638 "../rtc_base:rtc_base",
639 "../rtc_base:rtc_base_approved",
jianjun.zhuc0247402017-07-11 06:20:45 -0700640 "../system_wrappers:field_trial_default",
641 "../system_wrappers:metrics_default",
Ilya Nikolaevskiy2ffe3e82018-01-17 19:57:24 +0000642 "../system_wrappers:runtime_enabled_features_default",
kthelgason0727f152016-08-08 09:03:23 -0700643 ]
kjellandere40a7ee2016-10-16 23:56:12 -0700644 if (!build_with_chromium && is_clang) {
645 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
ehmaldonado38a21322016-09-02 04:10:34 -0700646 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
kthelgason0727f152016-08-08 09:03:23 -0700647 }
648 }
ehmaldonado38a21322016-09-02 04:10:34 -0700649 rtc_executable("turnserver") {
kjellander1993b1d2017-03-06 00:29:21 -0800650 testonly = true
kthelgason0727f152016-08-08 09:03:23 -0700651 sources = [
652 "turnserver/turnserver_main.cc",
653 ]
654 deps = [
jianjun.zhuc0247402017-07-11 06:20:45 -0700655 "../p2p:rtc_p2p",
656 "../pc:rtc_pc",
ehmaldonadof6a861a2017-07-19 10:40:47 -0700657 "../rtc_base:rtc_base",
658 "../rtc_base:rtc_base_approved",
jianjun.zhuc0247402017-07-11 06:20:45 -0700659 "../system_wrappers:field_trial_default",
660 "../system_wrappers:metrics_default",
Ilya Nikolaevskiy2ffe3e82018-01-17 19:57:24 +0000661 "../system_wrappers:runtime_enabled_features_default",
kthelgason0727f152016-08-08 09:03:23 -0700662 ]
kjellandere40a7ee2016-10-16 23:56:12 -0700663 if (!build_with_chromium && is_clang) {
664 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
ehmaldonado38a21322016-09-02 04:10:34 -0700665 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
kthelgason0727f152016-08-08 09:03:23 -0700666 }
667 }
ehmaldonado38a21322016-09-02 04:10:34 -0700668 rtc_executable("stunserver") {
kjellander1993b1d2017-03-06 00:29:21 -0800669 testonly = true
kthelgason0727f152016-08-08 09:03:23 -0700670 sources = [
671 "stunserver/stunserver_main.cc",
672 ]
673 deps = [
jianjun.zhuc0247402017-07-11 06:20:45 -0700674 "../p2p:rtc_p2p",
675 "../pc:rtc_pc",
ehmaldonadof6a861a2017-07-19 10:40:47 -0700676 "../rtc_base:rtc_base",
677 "../rtc_base:rtc_base_approved",
jianjun.zhuc0247402017-07-11 06:20:45 -0700678 "../system_wrappers:field_trial_default",
679 "../system_wrappers:metrics_default",
Ilya Nikolaevskiy2ffe3e82018-01-17 19:57:24 +0000680 "../system_wrappers:runtime_enabled_features_default",
kthelgason0727f152016-08-08 09:03:23 -0700681 ]
kjellandere40a7ee2016-10-16 23:56:12 -0700682 if (!build_with_chromium && is_clang) {
683 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
ehmaldonado38a21322016-09-02 04:10:34 -0700684 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
kthelgason0727f152016-08-08 09:03:23 -0700685 }
686 }
687}
charujainaca3a242016-11-01 03:09:15 -0700688
qiangchen42f96d52017-08-08 17:08:03 -0700689if (is_win || is_android) {
gyzhouad7cad82017-05-11 16:10:03 -0700690 rtc_shared_library("webrtc_unity_plugin") {
691 testonly = true
692 sources = [
693 "unityplugin/simple_peer_connection.cc",
694 "unityplugin/simple_peer_connection.h",
695 "unityplugin/unity_plugin_apis.cc",
696 "unityplugin/unity_plugin_apis.h",
gyzhoub38f3862017-07-25 16:04:31 -0700697 "unityplugin/video_observer.cc",
698 "unityplugin/video_observer.h",
gyzhouad7cad82017-05-11 16:10:03 -0700699 ]
qiangchen42f96d52017-08-08 17:08:03 -0700700
701 if (is_android) {
702 sources += [
703 "unityplugin/classreferenceholder.cc",
704 "unityplugin/classreferenceholder.h",
705 "unityplugin/jni_onload.cc",
706 ]
Qiang Chen43fb9122017-12-20 10:47:36 -0800707 suppressed_configs += [ "//build/config/android:hide_all_but_jni_onload" ]
qiangchen42f96d52017-08-08 17:08:03 -0700708 }
709
gyzhouad7cad82017-05-11 16:10:03 -0700710 if (!build_with_chromium && is_clang) {
711 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
712 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
713 }
qiangchen42f96d52017-08-08 17:08:03 -0700714 if (is_win) {
715 cflags = [ "/wd4245" ]
716 configs += [
717 "//build/config/win:windowed",
718 ":peerconnection_client_warnings_config",
719 ]
720 }
gyzhouad7cad82017-05-11 16:10:03 -0700721 deps = [
Mirko Bonadei34814c72018-01-11 10:13:56 +0100722 "../api:libjingle_peerconnection_api",
jianjun.zhuc0247402017-07-11 06:20:45 -0700723 "../api:libjingle_peerconnection_test_api",
724 "../api:video_frame_api",
Qiang Chen51e20462017-12-05 11:11:21 -0800725 "../api/audio_codecs:builtin_audio_decoder_factory",
726 "../api/audio_codecs:builtin_audio_encoder_factory",
Mirko Bonadei75baa492018-01-11 17:07:30 +0100727 "../media:rtc_audio_video",
Anders Carlssona114c882018-01-04 15:10:22 +0100728 "../media:rtc_internal_video_codecs",
jianjun.zhuc0247402017-07-11 06:20:45 -0700729 "../media:rtc_media",
730 "../media:rtc_media_base",
Qiang Chen43fb9122017-12-20 10:47:36 -0800731 "../modules/audio_device:audio_device",
732 "../modules/audio_processing:audio_processing",
jianjun.zhuc0247402017-07-11 06:20:45 -0700733 "../modules/video_capture:video_capture_module",
734 "../pc:libjingle_peerconnection",
qiangchen42f96d52017-08-08 17:08:03 -0700735 "../rtc_base:rtc_base",
jianjun.zhuc0247402017-07-11 06:20:45 -0700736 "../system_wrappers:field_trial_default",
737 "../system_wrappers:metrics_default",
Ilya Nikolaevskiy2ffe3e82018-01-17 19:57:24 +0000738 "../system_wrappers:runtime_enabled_features_default",
gyzhouad7cad82017-05-11 16:10:03 -0700739 ]
qiangchen42f96d52017-08-08 17:08:03 -0700740 if (is_android) {
George Zhou2770c3d2018-03-07 09:58:54 -0800741 deps += [
742 "../modules/utility:utility",
743 "../sdk/android:libjingle_peerconnection_jni",
744 ]
qiangchen42f96d52017-08-08 17:08:03 -0700745 }
746 }
747}
748
749if (is_android) {
Mirko Bonadeifbb3b7d2017-11-07 15:36:33 +0000750 rtc_android_library("webrtc_unity_java") {
qiangchen42f96d52017-08-08 17:08:03 -0700751 java_files = [ "unityplugin/java/src/org/webrtc/UnityUtility.java" ]
752 deps = [
753 "../rtc_base:base_java",
754 "../sdk/android:libjingle_peerconnection_java",
755 ]
756 }
757
758 dist_jar("libwebrtc_unity") {
759 _target_dir_name = get_label_info(":$target_name", "dir")
760 output = "${root_out_dir}/lib.java${_target_dir_name}/${target_name}.jar"
George Zhou2770c3d2018-03-07 09:58:54 -0800761 direct_deps_only = false
qiangchen42f96d52017-08-08 17:08:03 -0700762 use_interface_jars = false
George Zhou2770c3d2018-03-07 09:58:54 -0800763 use_unprocessed_jars = false
Oleh Prypin86021d92017-09-24 22:29:06 +0200764 requires_android = true
qiangchen42f96d52017-08-08 17:08:03 -0700765 deps = [
766 ":webrtc_unity_java",
767 "../modules/audio_device:audio_device_java",
768 "../rtc_base:base_java",
769 "../sdk/android:libjingle_peerconnection_java",
770 "../sdk/android:libjingle_peerconnection_metrics_default_java",
771 ]
gyzhouad7cad82017-05-11 16:10:03 -0700772 }
773}
774
charujainaca3a242016-11-01 03:09:15 -0700775if (!build_with_chromium) {
776 # Doesn't build within Chrome on Win.
777 rtc_executable("stun_prober") {
kjellander1993b1d2017-03-06 00:29:21 -0800778 testonly = true
charujainaca3a242016-11-01 03:09:15 -0700779 sources = [
780 "stunprober/main.cc",
781 ]
782
783 if (!build_with_chromium && is_clang) {
784 # Suppress warnings from Chrome's Clang plugins.
785 # See http://code.google.com/p/webrtc/issues/detail?id=163 for details.
786 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
787 }
788
789 deps = [
790 "../p2p:libstunprober",
791 "../p2p:rtc_p2p",
Patrik Höglunda8005cf2017-12-13 16:05:42 +0100792 "../rtc_base:checks",
ehmaldonadof6a861a2017-07-19 10:40:47 -0700793 "../rtc_base:rtc_base",
794 "../rtc_base:rtc_base_approved",
Patrik Höglund3e113432017-12-15 14:40:10 +0100795 "../rtc_base:stringutils",
charujainaca3a242016-11-01 03:09:15 -0700796 "../system_wrappers:field_trial_default",
797 ]
798 }
799}