blob: 0ab9bc8859282fcdf43afa6e8fe172bc882a5c79 [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")
Sami Kalliomaki9c0c75b2016-06-29 14:55:00 +020010if (is_android) {
11 import("//build/config/android/config.gni")
12 import("//build/config/android/rules.gni")
tkchin2ddfdba2016-08-07 21:37:45 -070013} else if (is_mac) {
14 import("//build/config/mac/rules.gni")
15} else if (is_ios) {
16 import("//build/config/ios/rules.gni")
Sami Kalliomaki9c0c75b2016-06-29 14:55:00 +020017}
18
19group("examples") {
kjellander6ceab082016-10-28 05:44:03 -070020 # This target shall build all targets in examples.
21 testonly = true
Mirko Bonadei1a339c32017-12-14 13:06:10 +010022 deps = []
Sami Kalliomaki9c0c75b2016-06-29 14:55:00 +020023
tkchin2ddfdba2016-08-07 21:37:45 -070024 if (is_android) {
Mirko Bonadei1a339c32017-12-14 13:06:10 +010025 deps += [
kjellander6ceab082016-10-28 05:44:03 -070026 ":AppRTCMobile",
27 ":AppRTCMobileTest",
mandermoa6069e82017-01-16 02:23:09 -080028 ":AppRTCMobileTestStubbedVideoIO",
kjellander6ceab082016-10-28 05:44:03 -070029 ]
30 }
31
charujainaca3a242016-11-01 03:09:15 -070032 if (!build_with_chromium) {
Mirko Bonadei1a339c32017-12-14 13:06:10 +010033 deps += [ ":stun_prober" ]
charujainaca3a242016-11-01 03:09:15 -070034 }
35
kjellander6ceab082016-10-28 05:44:03 -070036 if (is_ios || (is_mac && target_cpu != "x86")) {
Mirko Bonadei1a339c32017-12-14 13:06:10 +010037 deps += [ ":AppRTCMobile" ]
Sami Kalliomaki9c0c75b2016-06-29 14:55:00 +020038 }
kjellander6ceab082016-10-28 05:44:03 -070039
40 if (is_linux || is_win) {
Mirko Bonadei1a339c32017-12-14 13:06:10 +010041 deps += [
kthelgason0727f152016-08-08 09:03:23 -070042 ":peerconnection_client",
43 ":peerconnection_server",
44 ":relayserver",
45 ":stunserver",
46 ":turnserver",
47 ]
48 }
Sami Kalliomaki9c0c75b2016-06-29 14:55:00 +020049}
50
tkchin2ddfdba2016-08-07 21:37:45 -070051if (is_android) {
Mirko Bonadeifbb3b7d2017-11-07 15:36:33 +000052 rtc_android_apk("AppRTCMobile") {
kjellander1993b1d2017-03-06 00:29:21 -080053 testonly = true
Magnus Jedvertc1815cf2016-09-27 10:10:41 +020054 apk_name = "AppRTCMobile"
Sami Kalliomaki9c0c75b2016-06-29 14:55:00 +020055 android_manifest = "androidapp/AndroidManifest.xml"
56
57 deps = [
Magnus Jedvertc1815cf2016-09-27 10:10:41 +020058 ":AppRTCMobile_javalib",
59 ":AppRTCMobile_resources",
jianjun.zhuc0247402017-07-11 06:20:45 -070060 "../rtc_base:base_java",
Sami Kalliomaki9c0c75b2016-06-29 14:55:00 +020061 "//base:base_java",
Sami Kalliomaki9c0c75b2016-06-29 14:55:00 +020062 ]
63
jianjun.zhuc0247402017-07-11 06:20:45 -070064 shared_libraries = [ "../sdk/android:libjingle_peerconnection_so" ]
Sami Kalliomaki9c0c75b2016-06-29 14:55:00 +020065 }
66
Mirko Bonadeifbb3b7d2017-11-07 15:36:33 +000067 rtc_android_library("AppRTCMobile_javalib") {
kjellander1993b1d2017-03-06 00:29:21 -080068 testonly = true
sakal07a050f2017-02-13 05:58:27 -080069 android_manifest = "androidapp/AndroidManifest.xml"
70
Sami Kalliomaki9c0c75b2016-06-29 14:55:00 +020071 java_files = [
72 "androidapp/src/org/appspot/apprtc/AppRTCAudioManager.java",
henrikac3c2f312016-12-14 07:36:56 -080073 "androidapp/src/org/appspot/apprtc/AppRTCBluetoothManager.java",
Sami Kalliomaki9c0c75b2016-06-29 14:55:00 +020074 "androidapp/src/org/appspot/apprtc/AppRTCClient.java",
75 "androidapp/src/org/appspot/apprtc/AppRTCProximitySensor.java",
76 "androidapp/src/org/appspot/apprtc/CallActivity.java",
77 "androidapp/src/org/appspot/apprtc/CallFragment.java",
78 "androidapp/src/org/appspot/apprtc/CaptureQualityController.java",
79 "androidapp/src/org/appspot/apprtc/ConnectActivity.java",
80 "androidapp/src/org/appspot/apprtc/CpuMonitor.java",
81 "androidapp/src/org/appspot/apprtc/DirectRTCClient.java",
82 "androidapp/src/org/appspot/apprtc/HudFragment.java",
83 "androidapp/src/org/appspot/apprtc/PeerConnectionClient.java",
Sami Kalliomaki9c0c75b2016-06-29 14:55:00 +020084 "androidapp/src/org/appspot/apprtc/RoomParametersFetcher.java",
85 "androidapp/src/org/appspot/apprtc/SettingsActivity.java",
86 "androidapp/src/org/appspot/apprtc/SettingsFragment.java",
87 "androidapp/src/org/appspot/apprtc/TCPChannelClient.java",
88 "androidapp/src/org/appspot/apprtc/UnhandledExceptionHandler.java",
89 "androidapp/src/org/appspot/apprtc/WebSocketChannelClient.java",
90 "androidapp/src/org/appspot/apprtc/WebSocketRTCClient.java",
91 "androidapp/src/org/appspot/apprtc/util/AppRTCUtils.java",
92 "androidapp/src/org/appspot/apprtc/util/AsyncHttpURLConnection.java",
Sami Kalliomaki9c0c75b2016-06-29 14:55:00 +020093 ]
94
95 deps = [
Magnus Jedvertc1815cf2016-09-27 10:10:41 +020096 ":AppRTCMobile_resources",
jianjun.zhuc0247402017-07-11 06:20:45 -070097 "../modules/audio_device:audio_device_java",
98 "../rtc_base:base_java",
99 "../sdk/android:libjingle_peerconnection_java",
100 "../sdk/android:libjingle_peerconnection_metrics_default_java",
101 "androidapp/third_party/autobanh:autobanh_java",
Sami Kalliomaki9c0c75b2016-06-29 14:55:00 +0200102 ]
103 }
104
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200105 android_resources("AppRTCMobile_resources") {
kjellander1993b1d2017-03-06 00:29:21 -0800106 testonly = true
Sami Kalliomaki9c0c75b2016-06-29 14:55:00 +0200107 resource_dirs = [ "androidapp/res" ]
108 custom_package = "org.appspot.apprtc"
109 }
110
Mirko Bonadeifbb3b7d2017-11-07 15:36:33 +0000111 rtc_instrumentation_test_apk("AppRTCMobileTest") {
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200112 apk_name = "AppRTCMobileTest"
Sami Kalliomaki9c0c75b2016-06-29 14:55:00 +0200113 android_manifest = "androidtests/AndroidManifest.xml"
114
Patrik Höglunda8005cf2017-12-13 16:05:42 +0100115 java_files = [
116 "androidtests/src/org/appspot/apprtc/test/PeerConnectionClientTest.java",
117 ]
Sami Kalliomaki9c0c75b2016-06-29 14:55:00 +0200118
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200119 apk_under_test = ":AppRTCMobile"
Sami Kalliomaki9c0c75b2016-06-29 14:55:00 +0200120
121 deps = [
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200122 ":AppRTCMobile_javalib",
jianjun.zhuc0247402017-07-11 06:20:45 -0700123 "../sdk/android:libjingle_peerconnection_java",
sakalcb79d512017-01-11 06:21:26 -0800124 "//third_party/android_support_test_runner:runner_java",
125 "//third_party/junit",
Sami Kalliomaki9c0c75b2016-06-29 14:55:00 +0200126 ]
127 }
mandermoa6069e82017-01-16 02:23:09 -0800128
Mirko Bonadeifbb3b7d2017-11-07 15:36:33 +0000129 rtc_instrumentation_test_apk("AppRTCMobileTestStubbedVideoIO") {
mandermoa6069e82017-01-16 02:23:09 -0800130 apk_name = "AppRTCMobileTestStubbedVideoIO"
131 android_manifest = "androidtests/AndroidManifest.xml"
132
oprypin30cda5e2017-04-24 04:15:13 -0700133 java_files = [ "androidtests/src/org/appspot/apprtc/test/CallActivityStubbedInputOutputTest.java" ]
mandermoa6069e82017-01-16 02:23:09 -0800134
135 apk_under_test = ":AppRTCMobile"
136
137 deps = [
138 ":AppRTCMobile_javalib",
jianjun.zhuc0247402017-07-11 06:20:45 -0700139 "../sdk/android:libjingle_peerconnection_java",
mandermoa6069e82017-01-16 02:23:09 -0800140 "//third_party/android_support_test_runner:rules_java",
141 "//third_party/android_support_test_runner:runner_java",
142 "//third_party/espresso:espresso_all_java",
143 "//third_party/hamcrest:hamcrest_java",
144 "//third_party/junit",
mandermoa6069e82017-01-16 02:23:09 -0800145 ]
146
147 data = [
Mirko Bonadei92ea95e2017-09-15 06:47:31 +0200148 "../resources/reference_video_640x360_30fps.y4m",
mandermoa6069e82017-01-16 02:23:09 -0800149 ]
150 }
Sami Kalliomaki9c0c75b2016-06-29 14:55:00 +0200151}
tkchin2ddfdba2016-08-07 21:37:45 -0700152
153if (is_ios || (is_mac && target_cpu != "x86")) {
tkchin2ddfdba2016-08-07 21:37:45 -0700154 config("apprtc_common_config") {
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200155 include_dirs = [ "objc/AppRTCMobile/common" ]
tkchin2ddfdba2016-08-07 21:37:45 -0700156 }
157
kjellanderb62dbbe2016-09-23 00:38:52 -0700158 rtc_static_library("apprtc_common") {
kjellander1993b1d2017-03-06 00:29:21 -0800159 testonly = true
tkchin2ddfdba2016-08-07 21:37:45 -0700160 sources = [
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200161 "objc/AppRTCMobile/common/ARDUtilities.h",
162 "objc/AppRTCMobile/common/ARDUtilities.m",
tkchin2ddfdba2016-08-07 21:37:45 -0700163 ]
ehmaldonadoe9cc6862016-09-05 06:10:18 -0700164 public_configs = [ ":apprtc_common_config" ]
tkchin2ddfdba2016-08-07 21:37:45 -0700165
Kári Tristan Helgason946923a2017-06-02 14:05:56 +0200166 if (is_ios) {
kthelgason5901d9d2017-08-16 07:28:03 -0700167 deps = [
168 ":AppRTCMobile_ios_frameworks",
Mirko Bonadei1a339c32017-12-14 13:06:10 +0100169 "../sdk:common_objc",
170 "../system_wrappers:field_trial_default",
kthelgason5901d9d2017-08-16 07:28:03 -0700171 ]
Kári Tristan Helgason946923a2017-06-02 14:05:56 +0200172 } else {
kthelgason5901d9d2017-08-16 07:28:03 -0700173 deps = [
kthelgason36d658d2017-08-24 05:43:45 -0700174 "../sdk:common_objc",
kthelgason5901d9d2017-08-16 07:28:03 -0700175 "../system_wrappers:field_trial_default",
176 "../system_wrappers:metrics_default",
177 ]
Kári Tristan Helgason946923a2017-06-02 14:05:56 +0200178 }
tkchin2ddfdba2016-08-07 21:37:45 -0700179 }
180
181 config("apprtc_signaling_config") {
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200182 include_dirs = [ "objc/AppRTCMobile" ]
tkchin2ddfdba2016-08-07 21:37:45 -0700183
184 # GN orders flags on a target before flags from configs. The default config
185 # adds these flags so to cancel them out they need to come from a config and
186 # cannot be on the target directly.
187 cflags = [
188 "-Wno-sign-compare",
189 "-Wno-unused-variable",
190 ]
tkchin2ddfdba2016-08-07 21:37:45 -0700191 }
192
kjellanderb62dbbe2016-09-23 00:38:52 -0700193 rtc_static_library("apprtc_signaling") {
kjellander1993b1d2017-03-06 00:29:21 -0800194 testonly = true
tkchin2ddfdba2016-08-07 21:37:45 -0700195 sources = [
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200196 "objc/AppRTCMobile/ARDAppClient+Internal.h",
197 "objc/AppRTCMobile/ARDAppClient.h",
198 "objc/AppRTCMobile/ARDAppClient.m",
199 "objc/AppRTCMobile/ARDAppEngineClient.h",
200 "objc/AppRTCMobile/ARDAppEngineClient.m",
201 "objc/AppRTCMobile/ARDBitrateTracker.h",
202 "objc/AppRTCMobile/ARDBitrateTracker.m",
sakalc522e752017-04-05 12:17:48 -0700203 "objc/AppRTCMobile/ARDCaptureController.h",
204 "objc/AppRTCMobile/ARDCaptureController.m",
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200205 "objc/AppRTCMobile/ARDJoinResponse+Internal.h",
206 "objc/AppRTCMobile/ARDJoinResponse.h",
207 "objc/AppRTCMobile/ARDJoinResponse.m",
208 "objc/AppRTCMobile/ARDMessageResponse+Internal.h",
209 "objc/AppRTCMobile/ARDMessageResponse.h",
210 "objc/AppRTCMobile/ARDMessageResponse.m",
211 "objc/AppRTCMobile/ARDRoomServerClient.h",
sakalc4adacf2017-03-28 01:22:48 -0700212 "objc/AppRTCMobile/ARDSettingsModel+Private.h",
213 "objc/AppRTCMobile/ARDSettingsModel.h",
214 "objc/AppRTCMobile/ARDSettingsModel.m",
215 "objc/AppRTCMobile/ARDSettingsStore.h",
216 "objc/AppRTCMobile/ARDSettingsStore.m",
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200217 "objc/AppRTCMobile/ARDSignalingChannel.h",
218 "objc/AppRTCMobile/ARDSignalingMessage.h",
219 "objc/AppRTCMobile/ARDSignalingMessage.m",
220 "objc/AppRTCMobile/ARDStatsBuilder.h",
221 "objc/AppRTCMobile/ARDStatsBuilder.m",
kthelgasoncc882af2017-01-13 05:59:46 -0800222 "objc/AppRTCMobile/ARDTURNClient+Internal.h",
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200223 "objc/AppRTCMobile/ARDTURNClient.h",
kthelgasoncc882af2017-01-13 05:59:46 -0800224 "objc/AppRTCMobile/ARDTURNClient.m",
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200225 "objc/AppRTCMobile/ARDWebSocketChannel.h",
226 "objc/AppRTCMobile/ARDWebSocketChannel.m",
227 "objc/AppRTCMobile/RTCIceCandidate+JSON.h",
228 "objc/AppRTCMobile/RTCIceCandidate+JSON.m",
229 "objc/AppRTCMobile/RTCIceServer+JSON.h",
230 "objc/AppRTCMobile/RTCIceServer+JSON.m",
231 "objc/AppRTCMobile/RTCMediaConstraints+JSON.h",
232 "objc/AppRTCMobile/RTCMediaConstraints+JSON.m",
233 "objc/AppRTCMobile/RTCSessionDescription+JSON.h",
234 "objc/AppRTCMobile/RTCSessionDescription+JSON.m",
tkchin2ddfdba2016-08-07 21:37:45 -0700235 ]
ehmaldonadoe9cc6862016-09-05 06:10:18 -0700236 public_configs = [ ":apprtc_signaling_config" ]
tkchin2ddfdba2016-08-07 21:37:45 -0700237 deps = [
238 ":apprtc_common",
239 ":socketrocket",
240 ]
Kári Tristan Helgason946923a2017-06-02 14:05:56 +0200241 if (is_ios) {
Mirko Bonadei1a339c32017-12-14 13:06:10 +0100242 deps += [
243 ":AppRTCMobile_ios_frameworks",
244 "../sdk:framework_objc",
Kári Tristan Helgason946923a2017-06-02 14:05:56 +0200245 ]
Mirko Bonadei1a339c32017-12-14 13:06:10 +0100246 } else {
247 deps += [ "../sdk:peerconnection_objc" ]
Kári Tristan Helgason946923a2017-06-02 14:05:56 +0200248 }
tkchin2ddfdba2016-08-07 21:37:45 -0700249 libs = [ "QuartzCore.framework" ]
250 }
251
252 if (is_ios) {
denicija77bfd7c2016-11-15 00:41:26 -0800253 rtc_static_library("AppRTCMobile_lib") {
kjellander1993b1d2017-03-06 00:29:21 -0800254 testonly = true
tkchin2ddfdba2016-08-07 21:37:45 -0700255 sources = [
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200256 "objc/AppRTCMobile/ios/ARDAppDelegate.m",
Daniela012b56b2017-11-15 13:15:24 +0100257 "objc/AppRTCMobile/ios/ARDFileCaptureController.h",
258 "objc/AppRTCMobile/ios/ARDFileCaptureController.m",
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200259 "objc/AppRTCMobile/ios/ARDMainView.h",
260 "objc/AppRTCMobile/ios/ARDMainView.m",
261 "objc/AppRTCMobile/ios/ARDMainViewController.h",
262 "objc/AppRTCMobile/ios/ARDMainViewController.m",
denicijad17d5362016-11-02 02:56:09 -0700263 "objc/AppRTCMobile/ios/ARDSettingsViewController.h",
264 "objc/AppRTCMobile/ios/ARDSettingsViewController.m",
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200265 "objc/AppRTCMobile/ios/ARDStatsView.h",
266 "objc/AppRTCMobile/ios/ARDStatsView.m",
267 "objc/AppRTCMobile/ios/ARDVideoCallView.h",
268 "objc/AppRTCMobile/ios/ARDVideoCallView.m",
269 "objc/AppRTCMobile/ios/ARDVideoCallViewController.h",
270 "objc/AppRTCMobile/ios/ARDVideoCallViewController.m",
Anders Carlsson6bf43d22017-10-16 13:51:43 +0200271 "objc/AppRTCMobile/ios/RTCVideoCodecInfo+HumanReadable.h",
272 "objc/AppRTCMobile/ios/RTCVideoCodecInfo+HumanReadable.m",
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200273 "objc/AppRTCMobile/ios/UIImage+ARDUtilities.h",
274 "objc/AppRTCMobile/ios/UIImage+ARDUtilities.m",
denicija77bfd7c2016-11-15 00:41:26 -0800275 ]
denicija77bfd7c2016-11-15 00:41:26 -0800276
277 deps = [
Kári Tristan Helgason946923a2017-06-02 14:05:56 +0200278 ":AppRTCMobile_ios_frameworks",
denicija77bfd7c2016-11-15 00:41:26 -0800279 ":apprtc_common",
280 ":apprtc_signaling",
Mirko Bonadei1a339c32017-12-14 13:06:10 +0100281 "../sdk:framework_objc",
denicija77bfd7c2016-11-15 00:41:26 -0800282 ]
283 }
284
285 ios_app_bundle("AppRTCMobile") {
kjellander1993b1d2017-03-06 00:29:21 -0800286 testonly = true
denicija77bfd7c2016-11-15 00:41:26 -0800287 sources = [
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200288 "objc/AppRTCMobile/ios/main.m",
tkchin2ddfdba2016-08-07 21:37:45 -0700289 ]
290
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200291 info_plist = "objc/AppRTCMobile/ios/Info.plist"
tkchin2ddfdba2016-08-07 21:37:45 -0700292
denicija77bfd7c2016-11-15 00:41:26 -0800293 configs += [ "..:common_config" ]
tkchin2ddfdba2016-08-07 21:37:45 -0700294 public_configs = [ "..:common_inherited_config" ]
295
296 deps = [
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200297 ":AppRTCMobile_ios_bundle_data",
kthelgasond3adbfb2017-01-26 01:14:04 -0800298 ":AppRTCMobile_ios_frameworks",
denicija77bfd7c2016-11-15 00:41:26 -0800299 ":AppRTCMobile_lib",
Mirko Bonadei1a339c32017-12-14 13:06:10 +0100300 "../sdk:framework_objc",
tkchin2ddfdba2016-08-07 21:37:45 -0700301 ]
302
303 if (target_cpu == "x86") {
304 deps += [ "//testing/iossim:iossim" ]
305 }
306 }
307
kthelgasond3adbfb2017-01-26 01:14:04 -0800308 bundle_data("AppRTCMobile_ios_frameworks") {
Mirko Bonadei1a339c32017-12-14 13:06:10 +0100309 deps = [
kthelgason36d658d2017-08-24 05:43:45 -0700310 "../sdk:framework_objc+link",
kthelgasond3adbfb2017-01-26 01:14:04 -0800311 ]
312 sources = [
wjywbsbef8a5d2017-10-09 02:32:28 -0400313 "$root_build_dir/WebRTC.framework",
kthelgasond3adbfb2017-01-26 01:14:04 -0800314 ]
315 outputs = [
316 "{{bundle_resources_dir}}/Frameworks/{{source_file_part}}",
317 ]
318 }
319
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200320 bundle_data("AppRTCMobile_ios_bundle_data") {
tkchin2ddfdba2016-08-07 21:37:45 -0700321 sources = [
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200322 "objc/AppRTCMobile/ios/resources/Roboto-Regular.ttf",
Daniela012b56b2017-11-15 13:15:24 +0100323
324 # Sample video taken from https://media.xiph.org/video/derf/
325 "objc/AppRTCMobile/ios/resources/foreman.mp4",
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200326 "objc/AppRTCMobile/ios/resources/iPhone5@2x.png",
327 "objc/AppRTCMobile/ios/resources/iPhone6@2x.png",
328 "objc/AppRTCMobile/ios/resources/iPhone6p@3x.png",
329 "objc/AppRTCMobile/ios/resources/ic_call_end_black_24dp.png",
330 "objc/AppRTCMobile/ios/resources/ic_call_end_black_24dp@2x.png",
331 "objc/AppRTCMobile/ios/resources/ic_clear_black_24dp.png",
332 "objc/AppRTCMobile/ios/resources/ic_clear_black_24dp@2x.png",
denicija6d6762c2016-10-28 04:53:16 -0700333 "objc/AppRTCMobile/ios/resources/ic_settings_black_24dp.png",
334 "objc/AppRTCMobile/ios/resources/ic_settings_black_24dp@2x.png",
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200335 "objc/AppRTCMobile/ios/resources/ic_surround_sound_black_24dp.png",
336 "objc/AppRTCMobile/ios/resources/ic_surround_sound_black_24dp@2x.png",
337 "objc/AppRTCMobile/ios/resources/ic_switch_video_black_24dp.png",
338 "objc/AppRTCMobile/ios/resources/ic_switch_video_black_24dp@2x.png",
339 "objc/AppRTCMobile/ios/resources/mozart.mp3",
anderscb5ed9052017-08-15 04:07:12 -0700340 "objc/Icon-120.png",
341 "objc/Icon-180.png",
tkchin2ddfdba2016-08-07 21:37:45 -0700342 "objc/Icon.png",
343 ]
344 outputs = [
345 "{{bundle_resources_dir}}/{{source_file_part}}",
346 ]
347 }
348 }
349
350 if (is_mac) {
denicija77bfd7c2016-11-15 00:41:26 -0800351 rtc_static_library("AppRTCMobile_lib") {
kjellander1993b1d2017-03-06 00:29:21 -0800352 testonly = true
tkchin2ddfdba2016-08-07 21:37:45 -0700353 sources = [
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200354 "objc/AppRTCMobile/mac/APPRTCAppDelegate.h",
355 "objc/AppRTCMobile/mac/APPRTCAppDelegate.m",
356 "objc/AppRTCMobile/mac/APPRTCViewController.h",
357 "objc/AppRTCMobile/mac/APPRTCViewController.m",
tkchin2ddfdba2016-08-07 21:37:45 -0700358 ]
jianjun.zhuc0247402017-07-11 06:20:45 -0700359 configs += [ "..:common_objc" ]
tkchin2ddfdba2016-08-07 21:37:45 -0700360 deps = [
361 ":apprtc_common",
362 ":apprtc_signaling",
Mirko Bonadei1a339c32017-12-14 13:06:10 +0100363 "../sdk:metal_objc",
kthelgason36d658d2017-08-24 05:43:45 -0700364 "../sdk:ui_objc",
tkchin2ddfdba2016-08-07 21:37:45 -0700365 ]
366 }
367
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200368 mac_app_bundle("AppRTCMobile") {
kjellander1993b1d2017-03-06 00:29:21 -0800369 testonly = true
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200370 output_name = "AppRTCMobile"
tkchin2ddfdba2016-08-07 21:37:45 -0700371
tkchin2ddfdba2016-08-07 21:37:45 -0700372 sources = [
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200373 "objc/AppRTCMobile/mac/main.m",
tkchin2ddfdba2016-08-07 21:37:45 -0700374 ]
375
376 public_configs = [ "..:common_inherited_config" ]
377
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200378 info_plist = "objc/AppRTCMobile/mac/Info.plist"
tkchin2ddfdba2016-08-07 21:37:45 -0700379
380 libs = [ "AppKit.framework" ]
381
382 deps = [
denicija77bfd7c2016-11-15 00:41:26 -0800383 ":AppRTCMobile_lib",
tkchin2ddfdba2016-08-07 21:37:45 -0700384 ]
385 }
386 }
387
388 config("socketrocket_include_config") {
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200389 include_dirs = [ "objc/AppRTCMobile/third_party/SocketRocket" ]
tkchin2ddfdba2016-08-07 21:37:45 -0700390 }
391
392 config("socketrocket_warning_config") {
393 # GN orders flags on a target before flags from configs. The default config
394 # adds these flags so to cancel them out they need to come from a config and
395 # cannot be on the target directly.
396 cflags = [
397 "-Wno-deprecated-declarations",
398 "-Wno-nonnull",
tkchin2ddfdba2016-08-07 21:37:45 -0700399 "-Wno-semicolon-before-method-body",
kthelgasone47de1a2017-02-24 01:56:01 -0800400 "-Wno-unused-variable",
tkchin2ddfdba2016-08-07 21:37:45 -0700401 ]
402
henrika27d8b612016-09-21 04:13:00 -0700403 cflags_objc = [
404 # Enabled for cflags_objc in build/config/compiler/BUILD.gn.
405 "-Wno-objc-missing-property-synthesis",
henrika27d8b612016-09-21 04:13:00 -0700406 ]
tkchin2ddfdba2016-08-07 21:37:45 -0700407 }
408
kjellanderb62dbbe2016-09-23 00:38:52 -0700409 rtc_static_library("socketrocket") {
kjellander1993b1d2017-03-06 00:29:21 -0800410 testonly = true
tkchin2ddfdba2016-08-07 21:37:45 -0700411 sources = [
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200412 "objc/AppRTCMobile/third_party/SocketRocket/SRWebSocket.h",
413 "objc/AppRTCMobile/third_party/SocketRocket/SRWebSocket.m",
tkchin2ddfdba2016-08-07 21:37:45 -0700414 ]
kthelgasonc0977102017-04-24 00:57:16 -0700415 configs += [ ":socketrocket_warning_config" ]
ehmaldonadoe9cc6862016-09-05 06:10:18 -0700416 public_configs = [ ":socketrocket_include_config" ]
tkchin2ddfdba2016-08-07 21:37:45 -0700417
418 libs = [
419 "CFNetwork.framework",
420 "icucore",
421 ]
422 }
adam.fedorbcc5d872016-11-07 14:53:28 -0800423
424 if (rtc_include_tests) {
kthelgason4065a572017-02-14 04:58:56 -0800425 # TODO(kthelgason): compile xctests on mac when chromium supports it.
426 if (is_ios) {
427 rtc_source_set("apprtcmobile_test_sources") {
kjellander1993b1d2017-03-06 00:29:21 -0800428 testonly = true
kthelgason4065a572017-02-14 04:58:56 -0800429 include_dirs = [
430 "objc/AppRTCMobile",
431 "objc/AppRTCMobile/ios",
432 ]
433 testonly = true
434 sources = [
435 "objc/AppRTCMobile/tests/ARDAppClient_xctest.mm",
Daniela012b56b2017-11-15 13:15:24 +0100436 "objc/AppRTCMobile/tests/ARDFileCaptureController_xctest.mm",
kthelgason4065a572017-02-14 04:58:56 -0800437 "objc/AppRTCMobile/tests/ARDSettingsModel_xctest.mm",
438 ]
kjellander1993b1d2017-03-06 00:29:21 -0800439 deps = [
kthelgason4065a572017-02-14 04:58:56 -0800440 ":AppRTCMobile_ios_frameworks",
441 ":AppRTCMobile_lib",
Mirko Bonadei1a339c32017-12-14 13:06:10 +0100442 "../rtc_base:rtc_base",
443 "../sdk:framework_objc",
kthelgason4065a572017-02-14 04:58:56 -0800444 "//build/config/ios:xctest",
445 "//third_party/ocmock",
446 ]
adam.fedorbcc5d872016-11-07 14:53:28 -0800447 }
448
kthelgason4065a572017-02-14 04:58:56 -0800449 rtc_ios_xctest_test("apprtcmobile_tests") {
450 info_plist = "objc/AppRTCMobile/ios/Info.plist"
451 sources = [
452 "objc/AppRTCMobile/ios/main.m",
453 ]
454 deps = [
455 ":apprtcmobile_test_sources",
Mirko Bonadei1a339c32017-12-14 13:06:10 +0100456 "../sdk:framework_objc",
kthelgason4065a572017-02-14 04:58:56 -0800457 ]
458 ldflags = [ "-all_load" ]
459 }
adam.fedorbcc5d872016-11-07 14:53:28 -0800460 }
461 }
tkchin2ddfdba2016-08-07 21:37:45 -0700462}
kthelgason0727f152016-08-08 09:03:23 -0700463
464if (is_linux || is_win) {
ehmaldonadod02fe4b2016-08-26 13:31:24 -0700465 config("peerconnection_client_warnings_config") {
kjellander4a9abad2016-09-18 08:12:29 -0700466 cflags = []
ehmaldonadod02fe4b2016-08-26 13:31:24 -0700467 if (is_win && is_clang) {
kjellander4a9abad2016-09-18 08:12:29 -0700468 cflags += [
ehmaldonadod02fe4b2016-08-26 13:31:24 -0700469 # Disable warnings failing when compiling with Clang on Windows.
470 # https://bugs.chromium.org/p/webrtc/issues/detail?id=5366
471 "-Wno-format",
472
473 # See https://bugs.chromium.org/p/webrtc/issues/detail?id=6271
474 # for -Wno-reorder and -Wno-sign-compare
475 "-Wno-reorder",
476 "-Wno-sign-compare",
477 ]
478 }
kjellanderd4626e52016-09-07 02:33:01 -0700479 if (is_linux && target_cpu == "x86") {
kjellander4a9abad2016-09-18 08:12:29 -0700480 cflags += [
kjellanderd4626e52016-09-07 02:33:01 -0700481 # Needed to compile on Linux 32-bit.
482 "-Wno-sentinel",
483 ]
484 }
kjellander4a9abad2016-09-18 08:12:29 -0700485
486 if (is_clang) {
487 # TODO(ehmaldonado): Make peerconnection_client compile with the standard
488 # set of warnings.
489 # See https://bugs.chromium.org/p/webrtc/issues/detail?id=6306
490 cflags += [ "-Wno-inconsistent-missing-override" ]
491 }
ehmaldonadod02fe4b2016-08-26 13:31:24 -0700492 }
493
ehmaldonado38a21322016-09-02 04:10:34 -0700494 rtc_executable("peerconnection_client") {
kjellander1993b1d2017-03-06 00:29:21 -0800495 testonly = true
kthelgason0727f152016-08-08 09:03:23 -0700496 sources = [
497 "peerconnection/client/conductor.cc",
498 "peerconnection/client/conductor.h",
499 "peerconnection/client/defaults.cc",
500 "peerconnection/client/defaults.h",
501 "peerconnection/client/peer_connection_client.cc",
502 "peerconnection/client/peer_connection_client.h",
503 ]
ehmaldonado7a2ce0b2016-09-05 01:35:44 -0700504
kjellandere40a7ee2016-10-16 23:56:12 -0700505 if (!build_with_chromium && is_clang) {
506 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
ehmaldonado38a21322016-09-02 04:10:34 -0700507 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
kthelgason0727f152016-08-08 09:03:23 -0700508 }
Patrik Höglundb5b5bce2017-11-13 10:19:58 +0100509 deps = [
510 "../api:video_frame_api_i420",
Patrik Höglunda8005cf2017-12-13 16:05:42 +0100511 "../rtc_base:checks",
Patrik Höglundb5b5bce2017-11-13 10:19:58 +0100512 ]
kthelgason0727f152016-08-08 09:03:23 -0700513 if (is_win) {
514 sources += [
515 "peerconnection/client/flagdefs.h",
516 "peerconnection/client/main.cc",
517 "peerconnection/client/main_wnd.cc",
518 "peerconnection/client/main_wnd.h",
519 ]
520 cflags = [ "/wd4245" ]
521 configs += [ "//build/config/win:windowed" ]
jianjun.zhuc0247402017-07-11 06:20:45 -0700522 deps += [ "../media:rtc_media_base" ]
kthelgason0727f152016-08-08 09:03:23 -0700523 }
524 if (is_linux) {
525 sources += [
526 "peerconnection/client/linux/main.cc",
527 "peerconnection/client/linux/main_wnd.cc",
528 "peerconnection/client/linux/main_wnd.h",
529 ]
Henrik Kjellanderefbde2c2017-03-27 08:28:27 +0200530 cflags = [ "-Wno-deprecated-declarations" ]
kthelgason0727f152016-08-08 09:03:23 -0700531 libs = [
532 "X11",
533 "Xcomposite",
534 "Xext",
535 "Xrender",
536 ]
thomasandersonef16e992016-12-13 02:57:43 -0800537 deps += [ "//build/config/linux/gtk" ]
kthelgason0727f152016-08-08 09:03:23 -0700538 }
ehmaldonadod02fe4b2016-08-26 13:31:24 -0700539 configs += [ ":peerconnection_client_warnings_config" ]
kjellander1993b1d2017-03-06 00:29:21 -0800540
541 deps += [
jianjun.zhuc0247402017-07-11 06:20:45 -0700542 "../api:libjingle_peerconnection_test_api",
543 "../api:video_frame_api",
Karl Wiberg1b0eae32017-10-17 14:48:54 +0200544 "../api/audio_codecs:builtin_audio_decoder_factory",
545 "../api/audio_codecs:builtin_audio_encoder_factory",
jianjun.zhuc0247402017-07-11 06:20:45 -0700546 "../media:rtc_media",
547 "../modules/video_capture:video_capture_module",
548 "../pc:libjingle_peerconnection",
ehmaldonadof6a861a2017-07-19 10:40:47 -0700549 "../rtc_base:rtc_base",
550 "../rtc_base:rtc_base_approved",
551 "../rtc_base:rtc_json",
jianjun.zhuc0247402017-07-11 06:20:45 -0700552 "../system_wrappers:field_trial_default",
553 "../system_wrappers:metrics_default",
kjellander1993b1d2017-03-06 00:29:21 -0800554 "//third_party/libyuv",
kjellander1993b1d2017-03-06 00:29:21 -0800555 ]
kthelgason0727f152016-08-08 09:03:23 -0700556 }
kjellanderd4626e52016-09-07 02:33:01 -0700557
ehmaldonado38a21322016-09-02 04:10:34 -0700558 rtc_executable("peerconnection_server") {
kjellander1993b1d2017-03-06 00:29:21 -0800559 testonly = true
kthelgason0727f152016-08-08 09:03:23 -0700560 sources = [
561 "peerconnection/server/data_socket.cc",
562 "peerconnection/server/data_socket.h",
563 "peerconnection/server/main.cc",
564 "peerconnection/server/peer_channel.cc",
565 "peerconnection/server/peer_channel.h",
566 "peerconnection/server/utils.cc",
567 "peerconnection/server/utils.h",
568 ]
569 deps = [
jianjun.zhuc0247402017-07-11 06:20:45 -0700570 "..:webrtc_common",
ehmaldonadof6a861a2017-07-19 10:40:47 -0700571 "../rtc_base:rtc_base_approved",
jianjun.zhuc0247402017-07-11 06:20:45 -0700572 "../rtc_tools:command_line_parser",
kthelgason0727f152016-08-08 09:03:23 -0700573 ]
kjellandere40a7ee2016-10-16 23:56:12 -0700574 if (!build_with_chromium && is_clang) {
575 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
ehmaldonado38a21322016-09-02 04:10:34 -0700576 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
kthelgason0727f152016-08-08 09:03:23 -0700577 }
578 }
ehmaldonado38a21322016-09-02 04:10:34 -0700579 rtc_executable("relayserver") {
kjellander1993b1d2017-03-06 00:29:21 -0800580 testonly = true
kthelgason0727f152016-08-08 09:03:23 -0700581 sources = [
582 "relayserver/relayserver_main.cc",
583 ]
584 deps = [
jianjun.zhuc0247402017-07-11 06:20:45 -0700585 "../p2p:rtc_p2p",
586 "../pc:rtc_pc",
ehmaldonadof6a861a2017-07-19 10:40:47 -0700587 "../rtc_base:rtc_base",
588 "../rtc_base:rtc_base_approved",
jianjun.zhuc0247402017-07-11 06:20:45 -0700589 "../system_wrappers:field_trial_default",
590 "../system_wrappers:metrics_default",
kthelgason0727f152016-08-08 09:03:23 -0700591 ]
kjellandere40a7ee2016-10-16 23:56:12 -0700592 if (!build_with_chromium && is_clang) {
593 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
ehmaldonado38a21322016-09-02 04:10:34 -0700594 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
kthelgason0727f152016-08-08 09:03:23 -0700595 }
596 }
ehmaldonado38a21322016-09-02 04:10:34 -0700597 rtc_executable("turnserver") {
kjellander1993b1d2017-03-06 00:29:21 -0800598 testonly = true
kthelgason0727f152016-08-08 09:03:23 -0700599 sources = [
600 "turnserver/turnserver_main.cc",
601 ]
602 deps = [
jianjun.zhuc0247402017-07-11 06:20:45 -0700603 "../p2p:rtc_p2p",
604 "../pc:rtc_pc",
ehmaldonadof6a861a2017-07-19 10:40:47 -0700605 "../rtc_base:rtc_base",
606 "../rtc_base:rtc_base_approved",
jianjun.zhuc0247402017-07-11 06:20:45 -0700607 "../system_wrappers:field_trial_default",
608 "../system_wrappers:metrics_default",
kthelgason0727f152016-08-08 09:03:23 -0700609 ]
kjellandere40a7ee2016-10-16 23:56:12 -0700610 if (!build_with_chromium && is_clang) {
611 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
ehmaldonado38a21322016-09-02 04:10:34 -0700612 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
kthelgason0727f152016-08-08 09:03:23 -0700613 }
614 }
ehmaldonado38a21322016-09-02 04:10:34 -0700615 rtc_executable("stunserver") {
kjellander1993b1d2017-03-06 00:29:21 -0800616 testonly = true
kthelgason0727f152016-08-08 09:03:23 -0700617 sources = [
618 "stunserver/stunserver_main.cc",
619 ]
620 deps = [
jianjun.zhuc0247402017-07-11 06:20:45 -0700621 "../p2p:rtc_p2p",
622 "../pc:rtc_pc",
ehmaldonadof6a861a2017-07-19 10:40:47 -0700623 "../rtc_base:rtc_base",
624 "../rtc_base:rtc_base_approved",
jianjun.zhuc0247402017-07-11 06:20:45 -0700625 "../system_wrappers:field_trial_default",
626 "../system_wrappers:metrics_default",
kthelgason0727f152016-08-08 09:03:23 -0700627 ]
kjellandere40a7ee2016-10-16 23:56:12 -0700628 if (!build_with_chromium && is_clang) {
629 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
ehmaldonado38a21322016-09-02 04:10:34 -0700630 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
kthelgason0727f152016-08-08 09:03:23 -0700631 }
632 }
633}
charujainaca3a242016-11-01 03:09:15 -0700634
qiangchen42f96d52017-08-08 17:08:03 -0700635if (is_win || is_android) {
gyzhouad7cad82017-05-11 16:10:03 -0700636 rtc_shared_library("webrtc_unity_plugin") {
637 testonly = true
638 sources = [
639 "unityplugin/simple_peer_connection.cc",
640 "unityplugin/simple_peer_connection.h",
641 "unityplugin/unity_plugin_apis.cc",
642 "unityplugin/unity_plugin_apis.h",
gyzhoub38f3862017-07-25 16:04:31 -0700643 "unityplugin/video_observer.cc",
644 "unityplugin/video_observer.h",
gyzhouad7cad82017-05-11 16:10:03 -0700645 ]
qiangchen42f96d52017-08-08 17:08:03 -0700646
647 if (is_android) {
648 sources += [
649 "unityplugin/classreferenceholder.cc",
650 "unityplugin/classreferenceholder.h",
651 "unityplugin/jni_onload.cc",
652 ]
653 }
654
gyzhouad7cad82017-05-11 16:10:03 -0700655 if (!build_with_chromium && is_clang) {
656 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
657 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
658 }
qiangchen42f96d52017-08-08 17:08:03 -0700659 if (is_win) {
660 cflags = [ "/wd4245" ]
661 configs += [
662 "//build/config/win:windowed",
663 ":peerconnection_client_warnings_config",
664 ]
665 }
gyzhouad7cad82017-05-11 16:10:03 -0700666 deps = [
jianjun.zhuc0247402017-07-11 06:20:45 -0700667 "../api:libjingle_peerconnection_test_api",
668 "../api:video_frame_api",
Qiang Chen51e20462017-12-05 11:11:21 -0800669 "../api/audio_codecs:builtin_audio_decoder_factory",
670 "../api/audio_codecs:builtin_audio_encoder_factory",
jianjun.zhuc0247402017-07-11 06:20:45 -0700671 "../media:rtc_media",
672 "../media:rtc_media_base",
673 "../modules/video_capture:video_capture_module",
674 "../pc:libjingle_peerconnection",
qiangchen42f96d52017-08-08 17:08:03 -0700675 "../rtc_base:rtc_base",
jianjun.zhuc0247402017-07-11 06:20:45 -0700676 "../system_wrappers:field_trial_default",
677 "../system_wrappers:metrics_default",
gyzhouad7cad82017-05-11 16:10:03 -0700678 ]
qiangchen42f96d52017-08-08 17:08:03 -0700679 if (is_android) {
680 deps += [ "../sdk/android:libjingle_peerconnection_jni" ]
681 }
682 }
683}
684
685if (is_android) {
Mirko Bonadeifbb3b7d2017-11-07 15:36:33 +0000686 rtc_android_library("webrtc_unity_java") {
qiangchen42f96d52017-08-08 17:08:03 -0700687 java_files = [ "unityplugin/java/src/org/webrtc/UnityUtility.java" ]
688 deps = [
689 "../rtc_base:base_java",
690 "../sdk/android:libjingle_peerconnection_java",
691 ]
692 }
693
694 dist_jar("libwebrtc_unity") {
695 _target_dir_name = get_label_info(":$target_name", "dir")
696 output = "${root_out_dir}/lib.java${_target_dir_name}/${target_name}.jar"
697 direct_deps_only = true
698 use_interface_jars = false
Oleh Prypin86021d92017-09-24 22:29:06 +0200699 requires_android = true
qiangchen42f96d52017-08-08 17:08:03 -0700700 deps = [
701 ":webrtc_unity_java",
702 "../modules/audio_device:audio_device_java",
703 "../rtc_base:base_java",
704 "../sdk/android:libjingle_peerconnection_java",
705 "../sdk/android:libjingle_peerconnection_metrics_default_java",
706 ]
gyzhouad7cad82017-05-11 16:10:03 -0700707 }
708}
709
charujainaca3a242016-11-01 03:09:15 -0700710if (!build_with_chromium) {
711 # Doesn't build within Chrome on Win.
712 rtc_executable("stun_prober") {
kjellander1993b1d2017-03-06 00:29:21 -0800713 testonly = true
charujainaca3a242016-11-01 03:09:15 -0700714 sources = [
715 "stunprober/main.cc",
716 ]
717
718 if (!build_with_chromium && is_clang) {
719 # Suppress warnings from Chrome's Clang plugins.
720 # See http://code.google.com/p/webrtc/issues/detail?id=163 for details.
721 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
722 }
723
724 deps = [
725 "../p2p:libstunprober",
726 "../p2p:rtc_p2p",
Patrik Höglunda8005cf2017-12-13 16:05:42 +0100727 "../rtc_base:checks",
ehmaldonadof6a861a2017-07-19 10:40:47 -0700728 "../rtc_base:rtc_base",
729 "../rtc_base:rtc_base_approved",
charujainaca3a242016-11-01 03:09:15 -0700730 "../system_wrappers:field_trial_default",
731 ]
732 }
733}