blob: 7bbd933b08e98209525bed39ef756cce65e85d02 [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
kjellander705ecc52016-09-15 00:53:26 -070022 public_deps = []
Sami Kalliomaki9c0c75b2016-06-29 14:55:00 +020023
tkchin2ddfdba2016-08-07 21:37:45 -070024 if (is_android) {
kjellander6ceab082016-10-28 05:44:03 -070025 public_deps += [
26 ":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) {
33 public_deps += [ ":stun_prober" ]
34 }
35
kjellander6ceab082016-10-28 05:44:03 -070036 if (is_ios || (is_mac && target_cpu != "x86")) {
Magnus Jedvertc1815cf2016-09-27 10:10:41 +020037 public_deps += [ ":AppRTCMobile" ]
Sami Kalliomaki9c0c75b2016-06-29 14:55:00 +020038 }
kjellander6ceab082016-10-28 05:44:03 -070039
40 if (is_linux || is_win) {
kjellander705ecc52016-09-15 00:53:26 -070041 public_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) {
Magnus Jedvertc1815cf2016-09-27 10:10:41 +020052 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" ]
charujain474acce2017-08-25 06:21:52 -070065
66 # TODO(sakal): Fix build hooks crbug.com/webrtc/8148
67 no_build_hooks = true
Sami Kalliomaki9c0c75b2016-06-29 14:55:00 +020068 }
69
Magnus Jedvertc1815cf2016-09-27 10:10:41 +020070 android_library("AppRTCMobile_javalib") {
kjellander1993b1d2017-03-06 00:29:21 -080071 testonly = true
sakal07a050f2017-02-13 05:58:27 -080072 android_manifest = "androidapp/AndroidManifest.xml"
73
Sami Kalliomaki9c0c75b2016-06-29 14:55:00 +020074 java_files = [
75 "androidapp/src/org/appspot/apprtc/AppRTCAudioManager.java",
henrikac3c2f312016-12-14 07:36:56 -080076 "androidapp/src/org/appspot/apprtc/AppRTCBluetoothManager.java",
Sami Kalliomaki9c0c75b2016-06-29 14:55:00 +020077 "androidapp/src/org/appspot/apprtc/AppRTCClient.java",
78 "androidapp/src/org/appspot/apprtc/AppRTCProximitySensor.java",
79 "androidapp/src/org/appspot/apprtc/CallActivity.java",
80 "androidapp/src/org/appspot/apprtc/CallFragment.java",
81 "androidapp/src/org/appspot/apprtc/CaptureQualityController.java",
82 "androidapp/src/org/appspot/apprtc/ConnectActivity.java",
83 "androidapp/src/org/appspot/apprtc/CpuMonitor.java",
84 "androidapp/src/org/appspot/apprtc/DirectRTCClient.java",
85 "androidapp/src/org/appspot/apprtc/HudFragment.java",
86 "androidapp/src/org/appspot/apprtc/PeerConnectionClient.java",
Sami Kalliomaki9c0c75b2016-06-29 14:55:00 +020087 "androidapp/src/org/appspot/apprtc/RoomParametersFetcher.java",
88 "androidapp/src/org/appspot/apprtc/SettingsActivity.java",
89 "androidapp/src/org/appspot/apprtc/SettingsFragment.java",
90 "androidapp/src/org/appspot/apprtc/TCPChannelClient.java",
91 "androidapp/src/org/appspot/apprtc/UnhandledExceptionHandler.java",
92 "androidapp/src/org/appspot/apprtc/WebSocketChannelClient.java",
93 "androidapp/src/org/appspot/apprtc/WebSocketRTCClient.java",
94 "androidapp/src/org/appspot/apprtc/util/AppRTCUtils.java",
95 "androidapp/src/org/appspot/apprtc/util/AsyncHttpURLConnection.java",
Sami Kalliomaki9c0c75b2016-06-29 14:55:00 +020096 ]
97
98 deps = [
Magnus Jedvertc1815cf2016-09-27 10:10:41 +020099 ":AppRTCMobile_resources",
jianjun.zhuc0247402017-07-11 06:20:45 -0700100 "../modules/audio_device:audio_device_java",
101 "../rtc_base:base_java",
102 "../sdk/android:libjingle_peerconnection_java",
103 "../sdk/android:libjingle_peerconnection_metrics_default_java",
104 "androidapp/third_party/autobanh:autobanh_java",
Sami Kalliomaki9c0c75b2016-06-29 14:55:00 +0200105 ]
charujain474acce2017-08-25 06:21:52 -0700106
107 # TODO(sakal): Fix build hooks crbug.com/webrtc/8148
108 no_build_hooks = true
Sami Kalliomaki9c0c75b2016-06-29 14:55:00 +0200109 }
110
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200111 android_resources("AppRTCMobile_resources") {
kjellander1993b1d2017-03-06 00:29:21 -0800112 testonly = true
Sami Kalliomaki9c0c75b2016-06-29 14:55:00 +0200113 resource_dirs = [ "androidapp/res" ]
114 custom_package = "org.appspot.apprtc"
115 }
116
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200117 instrumentation_test_apk("AppRTCMobileTest") {
118 apk_name = "AppRTCMobileTest"
Sami Kalliomaki9c0c75b2016-06-29 14:55:00 +0200119 android_manifest = "androidtests/AndroidManifest.xml"
120
sakale8aca242017-01-17 03:32:06 -0800121 java_files = [ "androidtests/src/org/appspot/apprtc/test/PeerConnectionClientTest.java" ]
Sami Kalliomaki9c0c75b2016-06-29 14:55:00 +0200122
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200123 apk_under_test = ":AppRTCMobile"
Sami Kalliomaki9c0c75b2016-06-29 14:55:00 +0200124
125 deps = [
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200126 ":AppRTCMobile_javalib",
jianjun.zhuc0247402017-07-11 06:20:45 -0700127 "../sdk/android:libjingle_peerconnection_java",
sakalcb79d512017-01-11 06:21:26 -0800128 "//third_party/android_support_test_runner:runner_java",
129 "//third_party/junit",
Sami Kalliomaki9c0c75b2016-06-29 14:55:00 +0200130 ]
charujain474acce2017-08-25 06:21:52 -0700131
132 # TODO(sakal): Fix build hooks crbug.com/webrtc/8148
133 no_build_hooks = true
Sami Kalliomaki9c0c75b2016-06-29 14:55:00 +0200134 }
mandermoa6069e82017-01-16 02:23:09 -0800135
136 instrumentation_test_apk("AppRTCMobileTestStubbedVideoIO") {
137 apk_name = "AppRTCMobileTestStubbedVideoIO"
138 android_manifest = "androidtests/AndroidManifest.xml"
139
oprypin30cda5e2017-04-24 04:15:13 -0700140 java_files = [ "androidtests/src/org/appspot/apprtc/test/CallActivityStubbedInputOutputTest.java" ]
mandermoa6069e82017-01-16 02:23:09 -0800141
142 apk_under_test = ":AppRTCMobile"
143
144 deps = [
145 ":AppRTCMobile_javalib",
jianjun.zhuc0247402017-07-11 06:20:45 -0700146 "../sdk/android:libjingle_peerconnection_java",
mandermoa6069e82017-01-16 02:23:09 -0800147 "//third_party/android_support_test_runner:rules_java",
148 "//third_party/android_support_test_runner:runner_java",
149 "//third_party/espresso:espresso_all_java",
150 "//third_party/hamcrest:hamcrest_java",
151 "//third_party/junit",
mandermoa6069e82017-01-16 02:23:09 -0800152 ]
153
154 data = [
Mirko Bonadei92ea95e2017-09-15 06:47:31 +0200155 "../resources/reference_video_640x360_30fps.y4m",
mandermoa6069e82017-01-16 02:23:09 -0800156 ]
charujain474acce2017-08-25 06:21:52 -0700157
158 # TODO(sakal): Fix build hooks crbug.com/webrtc/8148
159 no_build_hooks = true
mandermoa6069e82017-01-16 02:23:09 -0800160 }
Sami Kalliomaki9c0c75b2016-06-29 14:55:00 +0200161}
tkchin2ddfdba2016-08-07 21:37:45 -0700162
163if (is_ios || (is_mac && target_cpu != "x86")) {
tkchin2ddfdba2016-08-07 21:37:45 -0700164 config("apprtc_common_config") {
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200165 include_dirs = [ "objc/AppRTCMobile/common" ]
tkchin2ddfdba2016-08-07 21:37:45 -0700166 }
167
kjellanderb62dbbe2016-09-23 00:38:52 -0700168 rtc_static_library("apprtc_common") {
kjellander1993b1d2017-03-06 00:29:21 -0800169 testonly = true
tkchin2ddfdba2016-08-07 21:37:45 -0700170 sources = [
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200171 "objc/AppRTCMobile/common/ARDUtilities.h",
172 "objc/AppRTCMobile/common/ARDUtilities.m",
tkchin2ddfdba2016-08-07 21:37:45 -0700173 ]
ehmaldonadoe9cc6862016-09-05 06:10:18 -0700174 public_configs = [ ":apprtc_common_config" ]
tkchin2ddfdba2016-08-07 21:37:45 -0700175
Kári Tristan Helgason946923a2017-06-02 14:05:56 +0200176 if (is_ios) {
kthelgason5901d9d2017-08-16 07:28:03 -0700177 deps = [
178 ":AppRTCMobile_ios_frameworks",
179 ]
Kári Tristan Helgason946923a2017-06-02 14:05:56 +0200180 } else {
kthelgason5901d9d2017-08-16 07:28:03 -0700181 deps = [
kthelgason36d658d2017-08-24 05:43:45 -0700182 "../sdk:common_objc",
kthelgason5901d9d2017-08-16 07:28:03 -0700183 "../system_wrappers:field_trial_default",
184 "../system_wrappers:metrics_default",
185 ]
Kári Tristan Helgason946923a2017-06-02 14:05:56 +0200186 }
tkchin2ddfdba2016-08-07 21:37:45 -0700187 }
188
189 config("apprtc_signaling_config") {
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200190 include_dirs = [ "objc/AppRTCMobile" ]
tkchin2ddfdba2016-08-07 21:37:45 -0700191
192 # GN orders flags on a target before flags from configs. The default config
193 # adds these flags so to cancel them out they need to come from a config and
194 # cannot be on the target directly.
195 cflags = [
196 "-Wno-sign-compare",
197 "-Wno-unused-variable",
198 ]
tkchin2ddfdba2016-08-07 21:37:45 -0700199 }
200
kjellanderb62dbbe2016-09-23 00:38:52 -0700201 rtc_static_library("apprtc_signaling") {
kjellander1993b1d2017-03-06 00:29:21 -0800202 testonly = true
tkchin2ddfdba2016-08-07 21:37:45 -0700203 sources = [
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200204 "objc/AppRTCMobile/ARDAppClient+Internal.h",
205 "objc/AppRTCMobile/ARDAppClient.h",
206 "objc/AppRTCMobile/ARDAppClient.m",
207 "objc/AppRTCMobile/ARDAppEngineClient.h",
208 "objc/AppRTCMobile/ARDAppEngineClient.m",
209 "objc/AppRTCMobile/ARDBitrateTracker.h",
210 "objc/AppRTCMobile/ARDBitrateTracker.m",
sakalc522e752017-04-05 12:17:48 -0700211 "objc/AppRTCMobile/ARDCaptureController.h",
212 "objc/AppRTCMobile/ARDCaptureController.m",
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200213 "objc/AppRTCMobile/ARDJoinResponse+Internal.h",
214 "objc/AppRTCMobile/ARDJoinResponse.h",
215 "objc/AppRTCMobile/ARDJoinResponse.m",
216 "objc/AppRTCMobile/ARDMessageResponse+Internal.h",
217 "objc/AppRTCMobile/ARDMessageResponse.h",
218 "objc/AppRTCMobile/ARDMessageResponse.m",
219 "objc/AppRTCMobile/ARDRoomServerClient.h",
220 "objc/AppRTCMobile/ARDSDPUtils.h",
221 "objc/AppRTCMobile/ARDSDPUtils.m",
sakalc4adacf2017-03-28 01:22:48 -0700222 "objc/AppRTCMobile/ARDSettingsModel+Private.h",
223 "objc/AppRTCMobile/ARDSettingsModel.h",
224 "objc/AppRTCMobile/ARDSettingsModel.m",
225 "objc/AppRTCMobile/ARDSettingsStore.h",
226 "objc/AppRTCMobile/ARDSettingsStore.m",
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200227 "objc/AppRTCMobile/ARDSignalingChannel.h",
228 "objc/AppRTCMobile/ARDSignalingMessage.h",
229 "objc/AppRTCMobile/ARDSignalingMessage.m",
230 "objc/AppRTCMobile/ARDStatsBuilder.h",
231 "objc/AppRTCMobile/ARDStatsBuilder.m",
kthelgasoncc882af2017-01-13 05:59:46 -0800232 "objc/AppRTCMobile/ARDTURNClient+Internal.h",
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200233 "objc/AppRTCMobile/ARDTURNClient.h",
kthelgasoncc882af2017-01-13 05:59:46 -0800234 "objc/AppRTCMobile/ARDTURNClient.m",
Anders Carlsson7e042812017-10-05 16:55:38 +0200235 "objc/AppRTCMobile/ARDVideoDecoderFactory.h",
236 "objc/AppRTCMobile/ARDVideoDecoderFactory.m",
237 "objc/AppRTCMobile/ARDVideoEncoderFactory.h",
238 "objc/AppRTCMobile/ARDVideoEncoderFactory.m",
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200239 "objc/AppRTCMobile/ARDWebSocketChannel.h",
240 "objc/AppRTCMobile/ARDWebSocketChannel.m",
241 "objc/AppRTCMobile/RTCIceCandidate+JSON.h",
242 "objc/AppRTCMobile/RTCIceCandidate+JSON.m",
243 "objc/AppRTCMobile/RTCIceServer+JSON.h",
244 "objc/AppRTCMobile/RTCIceServer+JSON.m",
245 "objc/AppRTCMobile/RTCMediaConstraints+JSON.h",
246 "objc/AppRTCMobile/RTCMediaConstraints+JSON.m",
247 "objc/AppRTCMobile/RTCSessionDescription+JSON.h",
248 "objc/AppRTCMobile/RTCSessionDescription+JSON.m",
tkchin2ddfdba2016-08-07 21:37:45 -0700249 ]
ehmaldonadoe9cc6862016-09-05 06:10:18 -0700250 public_configs = [ ":apprtc_signaling_config" ]
tkchin2ddfdba2016-08-07 21:37:45 -0700251 deps = [
252 ":apprtc_common",
253 ":socketrocket",
254 ]
Kári Tristan Helgason946923a2017-06-02 14:05:56 +0200255 if (is_ios) {
256 deps += [ ":AppRTCMobile_ios_frameworks" ]
257 } else {
258 public_deps = [
kthelgason36d658d2017-08-24 05:43:45 -0700259 "../sdk:peerconnection_objc",
Kári Tristan Helgason946923a2017-06-02 14:05:56 +0200260 ]
261 }
tkchin2ddfdba2016-08-07 21:37:45 -0700262 libs = [ "QuartzCore.framework" ]
263 }
264
265 if (is_ios) {
denicija77bfd7c2016-11-15 00:41:26 -0800266 rtc_static_library("AppRTCMobile_lib") {
kjellander1993b1d2017-03-06 00:29:21 -0800267 testonly = true
tkchin2ddfdba2016-08-07 21:37:45 -0700268 sources = [
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200269 "objc/AppRTCMobile/ios/ARDAppDelegate.m",
270 "objc/AppRTCMobile/ios/ARDMainView.h",
271 "objc/AppRTCMobile/ios/ARDMainView.m",
272 "objc/AppRTCMobile/ios/ARDMainViewController.h",
273 "objc/AppRTCMobile/ios/ARDMainViewController.m",
denicijad17d5362016-11-02 02:56:09 -0700274 "objc/AppRTCMobile/ios/ARDSettingsViewController.h",
275 "objc/AppRTCMobile/ios/ARDSettingsViewController.m",
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200276 "objc/AppRTCMobile/ios/ARDStatsView.h",
277 "objc/AppRTCMobile/ios/ARDStatsView.m",
278 "objc/AppRTCMobile/ios/ARDVideoCallView.h",
279 "objc/AppRTCMobile/ios/ARDVideoCallView.m",
280 "objc/AppRTCMobile/ios/ARDVideoCallViewController.h",
281 "objc/AppRTCMobile/ios/ARDVideoCallViewController.m",
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200282 "objc/AppRTCMobile/ios/UIImage+ARDUtilities.h",
283 "objc/AppRTCMobile/ios/UIImage+ARDUtilities.m",
denicija77bfd7c2016-11-15 00:41:26 -0800284 ]
denicija77bfd7c2016-11-15 00:41:26 -0800285
286 deps = [
Kári Tristan Helgason946923a2017-06-02 14:05:56 +0200287 ":AppRTCMobile_ios_frameworks",
denicija77bfd7c2016-11-15 00:41:26 -0800288 ":apprtc_common",
289 ":apprtc_signaling",
290 ]
291 }
292
293 ios_app_bundle("AppRTCMobile") {
kjellander1993b1d2017-03-06 00:29:21 -0800294 testonly = true
denicija77bfd7c2016-11-15 00:41:26 -0800295 sources = [
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200296 "objc/AppRTCMobile/ios/main.m",
tkchin2ddfdba2016-08-07 21:37:45 -0700297 ]
298
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200299 info_plist = "objc/AppRTCMobile/ios/Info.plist"
tkchin2ddfdba2016-08-07 21:37:45 -0700300
denicija77bfd7c2016-11-15 00:41:26 -0800301 configs += [ "..:common_config" ]
tkchin2ddfdba2016-08-07 21:37:45 -0700302 public_configs = [ "..:common_inherited_config" ]
303
304 deps = [
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200305 ":AppRTCMobile_ios_bundle_data",
kthelgasond3adbfb2017-01-26 01:14:04 -0800306 ":AppRTCMobile_ios_frameworks",
denicija77bfd7c2016-11-15 00:41:26 -0800307 ":AppRTCMobile_lib",
tkchin2ddfdba2016-08-07 21:37:45 -0700308 ]
309
310 if (target_cpu == "x86") {
311 deps += [ "//testing/iossim:iossim" ]
312 }
313 }
314
kthelgasond3adbfb2017-01-26 01:14:04 -0800315 bundle_data("AppRTCMobile_ios_frameworks") {
316 public_deps = [
kthelgason36d658d2017-08-24 05:43:45 -0700317 "../sdk:framework_objc+link",
kthelgasond3adbfb2017-01-26 01:14:04 -0800318 ]
319 sources = [
wjywbsbef8a5d2017-10-09 02:32:28 -0400320 "$root_build_dir/WebRTC.framework",
kthelgasond3adbfb2017-01-26 01:14:04 -0800321 ]
322 outputs = [
323 "{{bundle_resources_dir}}/Frameworks/{{source_file_part}}",
324 ]
325 }
326
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200327 bundle_data("AppRTCMobile_ios_bundle_data") {
tkchin2ddfdba2016-08-07 21:37:45 -0700328 sources = [
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200329 "objc/AppRTCMobile/ios/resources/Roboto-Regular.ttf",
330 "objc/AppRTCMobile/ios/resources/iPhone5@2x.png",
331 "objc/AppRTCMobile/ios/resources/iPhone6@2x.png",
332 "objc/AppRTCMobile/ios/resources/iPhone6p@3x.png",
333 "objc/AppRTCMobile/ios/resources/ic_call_end_black_24dp.png",
334 "objc/AppRTCMobile/ios/resources/ic_call_end_black_24dp@2x.png",
335 "objc/AppRTCMobile/ios/resources/ic_clear_black_24dp.png",
336 "objc/AppRTCMobile/ios/resources/ic_clear_black_24dp@2x.png",
denicija6d6762c2016-10-28 04:53:16 -0700337 "objc/AppRTCMobile/ios/resources/ic_settings_black_24dp.png",
338 "objc/AppRTCMobile/ios/resources/ic_settings_black_24dp@2x.png",
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200339 "objc/AppRTCMobile/ios/resources/ic_surround_sound_black_24dp.png",
340 "objc/AppRTCMobile/ios/resources/ic_surround_sound_black_24dp@2x.png",
341 "objc/AppRTCMobile/ios/resources/ic_switch_video_black_24dp.png",
342 "objc/AppRTCMobile/ios/resources/ic_switch_video_black_24dp@2x.png",
343 "objc/AppRTCMobile/ios/resources/mozart.mp3",
anderscb5ed9052017-08-15 04:07:12 -0700344 "objc/Icon-120.png",
345 "objc/Icon-180.png",
tkchin2ddfdba2016-08-07 21:37:45 -0700346 "objc/Icon.png",
347 ]
348 outputs = [
349 "{{bundle_resources_dir}}/{{source_file_part}}",
350 ]
351 }
352 }
353
354 if (is_mac) {
denicija77bfd7c2016-11-15 00:41:26 -0800355 rtc_static_library("AppRTCMobile_lib") {
kjellander1993b1d2017-03-06 00:29:21 -0800356 testonly = true
tkchin2ddfdba2016-08-07 21:37:45 -0700357 sources = [
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200358 "objc/AppRTCMobile/mac/APPRTCAppDelegate.h",
359 "objc/AppRTCMobile/mac/APPRTCAppDelegate.m",
360 "objc/AppRTCMobile/mac/APPRTCViewController.h",
361 "objc/AppRTCMobile/mac/APPRTCViewController.m",
tkchin2ddfdba2016-08-07 21:37:45 -0700362 ]
jianjun.zhuc0247402017-07-11 06:20:45 -0700363 configs += [ "..:common_objc" ]
tkchin2ddfdba2016-08-07 21:37:45 -0700364 deps = [
365 ":apprtc_common",
366 ":apprtc_signaling",
kthelgason36d658d2017-08-24 05:43:45 -0700367 "../sdk:ui_objc",
tkchin2ddfdba2016-08-07 21:37:45 -0700368 ]
369 }
370
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200371 mac_app_bundle("AppRTCMobile") {
kjellander1993b1d2017-03-06 00:29:21 -0800372 testonly = true
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200373 output_name = "AppRTCMobile"
tkchin2ddfdba2016-08-07 21:37:45 -0700374
tkchin2ddfdba2016-08-07 21:37:45 -0700375 sources = [
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200376 "objc/AppRTCMobile/mac/main.m",
tkchin2ddfdba2016-08-07 21:37:45 -0700377 ]
378
379 public_configs = [ "..:common_inherited_config" ]
380
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200381 info_plist = "objc/AppRTCMobile/mac/Info.plist"
tkchin2ddfdba2016-08-07 21:37:45 -0700382
383 libs = [ "AppKit.framework" ]
384
385 deps = [
denicija77bfd7c2016-11-15 00:41:26 -0800386 ":AppRTCMobile_lib",
tkchin2ddfdba2016-08-07 21:37:45 -0700387 ]
388 }
389 }
390
391 config("socketrocket_include_config") {
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200392 include_dirs = [ "objc/AppRTCMobile/third_party/SocketRocket" ]
tkchin2ddfdba2016-08-07 21:37:45 -0700393 }
394
395 config("socketrocket_warning_config") {
396 # GN orders flags on a target before flags from configs. The default config
397 # adds these flags so to cancel them out they need to come from a config and
398 # cannot be on the target directly.
399 cflags = [
400 "-Wno-deprecated-declarations",
401 "-Wno-nonnull",
tkchin2ddfdba2016-08-07 21:37:45 -0700402 "-Wno-semicolon-before-method-body",
kthelgasone47de1a2017-02-24 01:56:01 -0800403 "-Wno-unused-variable",
tkchin2ddfdba2016-08-07 21:37:45 -0700404 ]
405
henrika27d8b612016-09-21 04:13:00 -0700406 cflags_objc = [
407 # Enabled for cflags_objc in build/config/compiler/BUILD.gn.
408 "-Wno-objc-missing-property-synthesis",
henrika27d8b612016-09-21 04:13:00 -0700409 ]
tkchin2ddfdba2016-08-07 21:37:45 -0700410 }
411
kjellanderb62dbbe2016-09-23 00:38:52 -0700412 rtc_static_library("socketrocket") {
kjellander1993b1d2017-03-06 00:29:21 -0800413 testonly = true
tkchin2ddfdba2016-08-07 21:37:45 -0700414 sources = [
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200415 "objc/AppRTCMobile/third_party/SocketRocket/SRWebSocket.h",
416 "objc/AppRTCMobile/third_party/SocketRocket/SRWebSocket.m",
tkchin2ddfdba2016-08-07 21:37:45 -0700417 ]
kthelgasonc0977102017-04-24 00:57:16 -0700418 configs += [ ":socketrocket_warning_config" ]
ehmaldonadoe9cc6862016-09-05 06:10:18 -0700419 public_configs = [ ":socketrocket_include_config" ]
tkchin2ddfdba2016-08-07 21:37:45 -0700420
421 libs = [
422 "CFNetwork.framework",
423 "icucore",
424 ]
425 }
adam.fedorbcc5d872016-11-07 14:53:28 -0800426
427 if (rtc_include_tests) {
kthelgason4065a572017-02-14 04:58:56 -0800428 # TODO(kthelgason): compile xctests on mac when chromium supports it.
429 if (is_ios) {
430 rtc_source_set("apprtcmobile_test_sources") {
kjellander1993b1d2017-03-06 00:29:21 -0800431 testonly = true
kthelgason4065a572017-02-14 04:58:56 -0800432 include_dirs = [
433 "objc/AppRTCMobile",
434 "objc/AppRTCMobile/ios",
435 ]
436 testonly = true
437 sources = [
438 "objc/AppRTCMobile/tests/ARDAppClient_xctest.mm",
439 "objc/AppRTCMobile/tests/ARDSDPUtils_xctest.mm",
440 "objc/AppRTCMobile/tests/ARDSettingsModel_xctest.mm",
441 ]
kjellander1993b1d2017-03-06 00:29:21 -0800442 deps = [
jianjun.zhuc0247402017-07-11 06:20:45 -0700443 "../rtc_base:rtc_base",
kjellander1993b1d2017-03-06 00:29:21 -0800444 ]
kthelgason4065a572017-02-14 04:58:56 -0800445 public_deps = [
446 ":AppRTCMobile_ios_frameworks",
447 ":AppRTCMobile_lib",
448 "//build/config/ios:xctest",
449 "//third_party/ocmock",
450 ]
adam.fedorbcc5d872016-11-07 14:53:28 -0800451 }
452
kthelgason4065a572017-02-14 04:58:56 -0800453 rtc_ios_xctest_test("apprtcmobile_tests") {
454 info_plist = "objc/AppRTCMobile/ios/Info.plist"
455 sources = [
456 "objc/AppRTCMobile/ios/main.m",
457 ]
458 deps = [
459 ":apprtcmobile_test_sources",
460 ]
461 ldflags = [ "-all_load" ]
462 }
adam.fedorbcc5d872016-11-07 14:53:28 -0800463 }
464 }
tkchin2ddfdba2016-08-07 21:37:45 -0700465}
kthelgason0727f152016-08-08 09:03:23 -0700466
467if (is_linux || is_win) {
ehmaldonadod02fe4b2016-08-26 13:31:24 -0700468 config("peerconnection_client_warnings_config") {
kjellander4a9abad2016-09-18 08:12:29 -0700469 cflags = []
ehmaldonadod02fe4b2016-08-26 13:31:24 -0700470 if (is_win && is_clang) {
kjellander4a9abad2016-09-18 08:12:29 -0700471 cflags += [
ehmaldonadod02fe4b2016-08-26 13:31:24 -0700472 # Disable warnings failing when compiling with Clang on Windows.
473 # https://bugs.chromium.org/p/webrtc/issues/detail?id=5366
474 "-Wno-format",
475
476 # See https://bugs.chromium.org/p/webrtc/issues/detail?id=6271
477 # for -Wno-reorder and -Wno-sign-compare
478 "-Wno-reorder",
479 "-Wno-sign-compare",
480 ]
481 }
kjellanderd4626e52016-09-07 02:33:01 -0700482 if (is_linux && target_cpu == "x86") {
kjellander4a9abad2016-09-18 08:12:29 -0700483 cflags += [
kjellanderd4626e52016-09-07 02:33:01 -0700484 # Needed to compile on Linux 32-bit.
485 "-Wno-sentinel",
486 ]
487 }
kjellander4a9abad2016-09-18 08:12:29 -0700488
489 if (is_clang) {
490 # TODO(ehmaldonado): Make peerconnection_client compile with the standard
491 # set of warnings.
492 # See https://bugs.chromium.org/p/webrtc/issues/detail?id=6306
493 cflags += [ "-Wno-inconsistent-missing-override" ]
494 }
ehmaldonadod02fe4b2016-08-26 13:31:24 -0700495 }
496
ehmaldonado38a21322016-09-02 04:10:34 -0700497 rtc_executable("peerconnection_client") {
kjellander1993b1d2017-03-06 00:29:21 -0800498 testonly = true
kthelgason0727f152016-08-08 09:03:23 -0700499 sources = [
500 "peerconnection/client/conductor.cc",
501 "peerconnection/client/conductor.h",
502 "peerconnection/client/defaults.cc",
503 "peerconnection/client/defaults.h",
504 "peerconnection/client/peer_connection_client.cc",
505 "peerconnection/client/peer_connection_client.h",
506 ]
ehmaldonado7a2ce0b2016-09-05 01:35:44 -0700507
kjellandere40a7ee2016-10-16 23:56:12 -0700508 if (!build_with_chromium && is_clang) {
509 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
ehmaldonado38a21322016-09-02 04:10:34 -0700510 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
kthelgason0727f152016-08-08 09:03:23 -0700511 }
kjellander1993b1d2017-03-06 00:29:21 -0800512 deps = []
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",
jianjun.zhuc0247402017-07-11 06:20:45 -0700544 "../media:rtc_media",
545 "../modules/video_capture:video_capture_module",
546 "../pc:libjingle_peerconnection",
ehmaldonadof6a861a2017-07-19 10:40:47 -0700547 "../rtc_base:rtc_base",
548 "../rtc_base:rtc_base_approved",
549 "../rtc_base:rtc_json",
jianjun.zhuc0247402017-07-11 06:20:45 -0700550 "../system_wrappers:field_trial_default",
551 "../system_wrappers:metrics_default",
kjellander1993b1d2017-03-06 00:29:21 -0800552 "//third_party/libyuv",
kjellander1993b1d2017-03-06 00:29:21 -0800553 ]
kthelgason0727f152016-08-08 09:03:23 -0700554 }
kjellanderd4626e52016-09-07 02:33:01 -0700555
ehmaldonado38a21322016-09-02 04:10:34 -0700556 rtc_executable("peerconnection_server") {
kjellander1993b1d2017-03-06 00:29:21 -0800557 testonly = true
kthelgason0727f152016-08-08 09:03:23 -0700558 sources = [
559 "peerconnection/server/data_socket.cc",
560 "peerconnection/server/data_socket.h",
561 "peerconnection/server/main.cc",
562 "peerconnection/server/peer_channel.cc",
563 "peerconnection/server/peer_channel.h",
564 "peerconnection/server/utils.cc",
565 "peerconnection/server/utils.h",
566 ]
567 deps = [
jianjun.zhuc0247402017-07-11 06:20:45 -0700568 "..:webrtc_common",
ehmaldonadof6a861a2017-07-19 10:40:47 -0700569 "../rtc_base:rtc_base_approved",
jianjun.zhuc0247402017-07-11 06:20:45 -0700570 "../rtc_tools:command_line_parser",
kthelgason0727f152016-08-08 09:03:23 -0700571 ]
kjellandere40a7ee2016-10-16 23:56:12 -0700572 if (!build_with_chromium && is_clang) {
573 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
ehmaldonado38a21322016-09-02 04:10:34 -0700574 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
kthelgason0727f152016-08-08 09:03:23 -0700575 }
576 }
ehmaldonado38a21322016-09-02 04:10:34 -0700577 rtc_executable("relayserver") {
kjellander1993b1d2017-03-06 00:29:21 -0800578 testonly = true
kthelgason0727f152016-08-08 09:03:23 -0700579 sources = [
580 "relayserver/relayserver_main.cc",
581 ]
582 deps = [
jianjun.zhuc0247402017-07-11 06:20:45 -0700583 "../p2p:rtc_p2p",
584 "../pc:rtc_pc",
ehmaldonadof6a861a2017-07-19 10:40:47 -0700585 "../rtc_base:rtc_base",
586 "../rtc_base:rtc_base_approved",
jianjun.zhuc0247402017-07-11 06:20:45 -0700587 "../system_wrappers:field_trial_default",
588 "../system_wrappers:metrics_default",
kthelgason0727f152016-08-08 09:03:23 -0700589 ]
kjellandere40a7ee2016-10-16 23:56:12 -0700590 if (!build_with_chromium && is_clang) {
591 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
ehmaldonado38a21322016-09-02 04:10:34 -0700592 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
kthelgason0727f152016-08-08 09:03:23 -0700593 }
594 }
ehmaldonado38a21322016-09-02 04:10:34 -0700595 rtc_executable("turnserver") {
kjellander1993b1d2017-03-06 00:29:21 -0800596 testonly = true
kthelgason0727f152016-08-08 09:03:23 -0700597 sources = [
598 "turnserver/turnserver_main.cc",
599 ]
600 deps = [
jianjun.zhuc0247402017-07-11 06:20:45 -0700601 "../p2p:rtc_p2p",
602 "../pc:rtc_pc",
ehmaldonadof6a861a2017-07-19 10:40:47 -0700603 "../rtc_base:rtc_base",
604 "../rtc_base:rtc_base_approved",
jianjun.zhuc0247402017-07-11 06:20:45 -0700605 "../system_wrappers:field_trial_default",
606 "../system_wrappers:metrics_default",
kthelgason0727f152016-08-08 09:03:23 -0700607 ]
kjellandere40a7ee2016-10-16 23:56:12 -0700608 if (!build_with_chromium && is_clang) {
609 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
ehmaldonado38a21322016-09-02 04:10:34 -0700610 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
kthelgason0727f152016-08-08 09:03:23 -0700611 }
612 }
ehmaldonado38a21322016-09-02 04:10:34 -0700613 rtc_executable("stunserver") {
kjellander1993b1d2017-03-06 00:29:21 -0800614 testonly = true
kthelgason0727f152016-08-08 09:03:23 -0700615 sources = [
616 "stunserver/stunserver_main.cc",
617 ]
618 deps = [
jianjun.zhuc0247402017-07-11 06:20:45 -0700619 "../p2p:rtc_p2p",
620 "../pc:rtc_pc",
ehmaldonadof6a861a2017-07-19 10:40:47 -0700621 "../rtc_base:rtc_base",
622 "../rtc_base:rtc_base_approved",
jianjun.zhuc0247402017-07-11 06:20:45 -0700623 "../system_wrappers:field_trial_default",
624 "../system_wrappers:metrics_default",
kthelgason0727f152016-08-08 09:03:23 -0700625 ]
kjellandere40a7ee2016-10-16 23:56:12 -0700626 if (!build_with_chromium && is_clang) {
627 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
ehmaldonado38a21322016-09-02 04:10:34 -0700628 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
kthelgason0727f152016-08-08 09:03:23 -0700629 }
630 }
631}
charujainaca3a242016-11-01 03:09:15 -0700632
qiangchen42f96d52017-08-08 17:08:03 -0700633if (is_win || is_android) {
gyzhouad7cad82017-05-11 16:10:03 -0700634 rtc_shared_library("webrtc_unity_plugin") {
635 testonly = true
636 sources = [
637 "unityplugin/simple_peer_connection.cc",
638 "unityplugin/simple_peer_connection.h",
639 "unityplugin/unity_plugin_apis.cc",
640 "unityplugin/unity_plugin_apis.h",
gyzhoub38f3862017-07-25 16:04:31 -0700641 "unityplugin/video_observer.cc",
642 "unityplugin/video_observer.h",
gyzhouad7cad82017-05-11 16:10:03 -0700643 ]
qiangchen42f96d52017-08-08 17:08:03 -0700644
645 if (is_android) {
646 sources += [
647 "unityplugin/classreferenceholder.cc",
648 "unityplugin/classreferenceholder.h",
649 "unityplugin/jni_onload.cc",
650 ]
651 }
652
gyzhouad7cad82017-05-11 16:10:03 -0700653 if (!build_with_chromium && is_clang) {
654 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
655 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
656 }
qiangchen42f96d52017-08-08 17:08:03 -0700657 if (is_win) {
658 cflags = [ "/wd4245" ]
659 configs += [
660 "//build/config/win:windowed",
661 ":peerconnection_client_warnings_config",
662 ]
663 }
gyzhouad7cad82017-05-11 16:10:03 -0700664 deps = [
jianjun.zhuc0247402017-07-11 06:20:45 -0700665 "../api:libjingle_peerconnection_test_api",
666 "../api:video_frame_api",
jianjun.zhuc0247402017-07-11 06:20:45 -0700667 "../media:rtc_media",
668 "../media:rtc_media_base",
669 "../modules/video_capture:video_capture_module",
670 "../pc:libjingle_peerconnection",
qiangchen42f96d52017-08-08 17:08:03 -0700671 "../rtc_base:rtc_base",
jianjun.zhuc0247402017-07-11 06:20:45 -0700672 "../system_wrappers:field_trial_default",
673 "../system_wrappers:metrics_default",
gyzhouad7cad82017-05-11 16:10:03 -0700674 ]
qiangchen42f96d52017-08-08 17:08:03 -0700675 if (is_android) {
676 deps += [ "../sdk/android:libjingle_peerconnection_jni" ]
677 }
678 }
679}
680
681if (is_android) {
682 android_library("webrtc_unity_java") {
683 java_files = [ "unityplugin/java/src/org/webrtc/UnityUtility.java" ]
684 deps = [
685 "../rtc_base:base_java",
686 "../sdk/android:libjingle_peerconnection_java",
687 ]
688 }
689
690 dist_jar("libwebrtc_unity") {
691 _target_dir_name = get_label_info(":$target_name", "dir")
692 output = "${root_out_dir}/lib.java${_target_dir_name}/${target_name}.jar"
693 direct_deps_only = true
694 use_interface_jars = false
Oleh Prypin86021d92017-09-24 22:29:06 +0200695 requires_android = true
qiangchen42f96d52017-08-08 17:08:03 -0700696 deps = [
697 ":webrtc_unity_java",
698 "../modules/audio_device:audio_device_java",
699 "../rtc_base:base_java",
700 "../sdk/android:libjingle_peerconnection_java",
701 "../sdk/android:libjingle_peerconnection_metrics_default_java",
702 ]
gyzhouad7cad82017-05-11 16:10:03 -0700703 }
704}
705
charujainaca3a242016-11-01 03:09:15 -0700706if (!build_with_chromium) {
707 # Doesn't build within Chrome on Win.
708 rtc_executable("stun_prober") {
kjellander1993b1d2017-03-06 00:29:21 -0800709 testonly = true
charujainaca3a242016-11-01 03:09:15 -0700710 sources = [
711 "stunprober/main.cc",
712 ]
713
714 if (!build_with_chromium && is_clang) {
715 # Suppress warnings from Chrome's Clang plugins.
716 # See http://code.google.com/p/webrtc/issues/detail?id=163 for details.
717 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
718 }
719
720 deps = [
721 "../p2p:libstunprober",
722 "../p2p:rtc_p2p",
ehmaldonadof6a861a2017-07-19 10:40:47 -0700723 "../rtc_base:rtc_base",
724 "../rtc_base:rtc_base_approved",
charujainaca3a242016-11-01 03:09:15 -0700725 "../system_wrappers:field_trial_default",
726 ]
727 }
728}