blob: 7c933f01221264d61ed230c281454efeb4ca653d [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 "//base:base_java_test_support",
129 "//third_party/android_support_test_runner:runner_java",
130 "//third_party/junit",
Sami Kalliomaki9c0c75b2016-06-29 14:55:00 +0200131 ]
charujain474acce2017-08-25 06:21:52 -0700132
133 # TODO(sakal): Fix build hooks crbug.com/webrtc/8148
134 no_build_hooks = true
Sami Kalliomaki9c0c75b2016-06-29 14:55:00 +0200135 }
mandermoa6069e82017-01-16 02:23:09 -0800136
137 instrumentation_test_apk("AppRTCMobileTestStubbedVideoIO") {
138 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 = [
Mirko Bonadei92ea95e2017-09-15 06:47:31 +0200156 "../resources/reference_video_640x360_30fps.y4m",
mandermoa6069e82017-01-16 02:23:09 -0800157 ]
charujain474acce2017-08-25 06:21:52 -0700158
159 # TODO(sakal): Fix build hooks crbug.com/webrtc/8148
160 no_build_hooks = true
mandermoa6069e82017-01-16 02:23:09 -0800161 }
Sami Kalliomaki9c0c75b2016-06-29 14:55:00 +0200162}
tkchin2ddfdba2016-08-07 21:37:45 -0700163
164if (is_ios || (is_mac && target_cpu != "x86")) {
tkchin2ddfdba2016-08-07 21:37:45 -0700165 config("apprtc_common_config") {
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200166 include_dirs = [ "objc/AppRTCMobile/common" ]
tkchin2ddfdba2016-08-07 21:37:45 -0700167 }
168
kjellanderb62dbbe2016-09-23 00:38:52 -0700169 rtc_static_library("apprtc_common") {
kjellander1993b1d2017-03-06 00:29:21 -0800170 testonly = true
tkchin2ddfdba2016-08-07 21:37:45 -0700171 sources = [
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200172 "objc/AppRTCMobile/common/ARDUtilities.h",
173 "objc/AppRTCMobile/common/ARDUtilities.m",
tkchin2ddfdba2016-08-07 21:37:45 -0700174 ]
ehmaldonadoe9cc6862016-09-05 06:10:18 -0700175 public_configs = [ ":apprtc_common_config" ]
tkchin2ddfdba2016-08-07 21:37:45 -0700176
Kári Tristan Helgason946923a2017-06-02 14:05:56 +0200177 if (is_ios) {
kthelgason5901d9d2017-08-16 07:28:03 -0700178 deps = [
179 ":AppRTCMobile_ios_frameworks",
180 ]
Kári Tristan Helgason946923a2017-06-02 14:05:56 +0200181 } else {
kthelgason5901d9d2017-08-16 07:28:03 -0700182 deps = [
kthelgason36d658d2017-08-24 05:43:45 -0700183 "../sdk:common_objc",
kthelgason5901d9d2017-08-16 07:28:03 -0700184 "../system_wrappers:field_trial_default",
185 "../system_wrappers:metrics_default",
186 ]
Kári Tristan Helgason946923a2017-06-02 14:05:56 +0200187 }
tkchin2ddfdba2016-08-07 21:37:45 -0700188 }
189
190 config("apprtc_signaling_config") {
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200191 include_dirs = [ "objc/AppRTCMobile" ]
tkchin2ddfdba2016-08-07 21:37:45 -0700192
193 # GN orders flags on a target before flags from configs. The default config
194 # adds these flags so to cancel them out they need to come from a config and
195 # cannot be on the target directly.
196 cflags = [
197 "-Wno-sign-compare",
198 "-Wno-unused-variable",
199 ]
tkchin2ddfdba2016-08-07 21:37:45 -0700200 }
201
kjellanderb62dbbe2016-09-23 00:38:52 -0700202 rtc_static_library("apprtc_signaling") {
kjellander1993b1d2017-03-06 00:29:21 -0800203 testonly = true
tkchin2ddfdba2016-08-07 21:37:45 -0700204 sources = [
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200205 "objc/AppRTCMobile/ARDAppClient+Internal.h",
206 "objc/AppRTCMobile/ARDAppClient.h",
207 "objc/AppRTCMobile/ARDAppClient.m",
208 "objc/AppRTCMobile/ARDAppEngineClient.h",
209 "objc/AppRTCMobile/ARDAppEngineClient.m",
210 "objc/AppRTCMobile/ARDBitrateTracker.h",
211 "objc/AppRTCMobile/ARDBitrateTracker.m",
sakalc522e752017-04-05 12:17:48 -0700212 "objc/AppRTCMobile/ARDCaptureController.h",
213 "objc/AppRTCMobile/ARDCaptureController.m",
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200214 "objc/AppRTCMobile/ARDJoinResponse+Internal.h",
215 "objc/AppRTCMobile/ARDJoinResponse.h",
216 "objc/AppRTCMobile/ARDJoinResponse.m",
217 "objc/AppRTCMobile/ARDMessageResponse+Internal.h",
218 "objc/AppRTCMobile/ARDMessageResponse.h",
219 "objc/AppRTCMobile/ARDMessageResponse.m",
220 "objc/AppRTCMobile/ARDRoomServerClient.h",
221 "objc/AppRTCMobile/ARDSDPUtils.h",
222 "objc/AppRTCMobile/ARDSDPUtils.m",
sakalc4adacf2017-03-28 01:22:48 -0700223 "objc/AppRTCMobile/ARDSettingsModel+Private.h",
224 "objc/AppRTCMobile/ARDSettingsModel.h",
225 "objc/AppRTCMobile/ARDSettingsModel.m",
226 "objc/AppRTCMobile/ARDSettingsStore.h",
227 "objc/AppRTCMobile/ARDSettingsStore.m",
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200228 "objc/AppRTCMobile/ARDSignalingChannel.h",
229 "objc/AppRTCMobile/ARDSignalingMessage.h",
230 "objc/AppRTCMobile/ARDSignalingMessage.m",
231 "objc/AppRTCMobile/ARDStatsBuilder.h",
232 "objc/AppRTCMobile/ARDStatsBuilder.m",
kthelgasoncc882af2017-01-13 05:59:46 -0800233 "objc/AppRTCMobile/ARDTURNClient+Internal.h",
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200234 "objc/AppRTCMobile/ARDTURNClient.h",
kthelgasoncc882af2017-01-13 05:59:46 -0800235 "objc/AppRTCMobile/ARDTURNClient.m",
Anders Carlsson7e042812017-10-05 16:55:38 +0200236 "objc/AppRTCMobile/ARDVideoDecoderFactory.h",
237 "objc/AppRTCMobile/ARDVideoDecoderFactory.m",
238 "objc/AppRTCMobile/ARDVideoEncoderFactory.h",
239 "objc/AppRTCMobile/ARDVideoEncoderFactory.m",
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200240 "objc/AppRTCMobile/ARDWebSocketChannel.h",
241 "objc/AppRTCMobile/ARDWebSocketChannel.m",
242 "objc/AppRTCMobile/RTCIceCandidate+JSON.h",
243 "objc/AppRTCMobile/RTCIceCandidate+JSON.m",
244 "objc/AppRTCMobile/RTCIceServer+JSON.h",
245 "objc/AppRTCMobile/RTCIceServer+JSON.m",
246 "objc/AppRTCMobile/RTCMediaConstraints+JSON.h",
247 "objc/AppRTCMobile/RTCMediaConstraints+JSON.m",
248 "objc/AppRTCMobile/RTCSessionDescription+JSON.h",
249 "objc/AppRTCMobile/RTCSessionDescription+JSON.m",
tkchin2ddfdba2016-08-07 21:37:45 -0700250 ]
ehmaldonadoe9cc6862016-09-05 06:10:18 -0700251 public_configs = [ ":apprtc_signaling_config" ]
tkchin2ddfdba2016-08-07 21:37:45 -0700252 deps = [
253 ":apprtc_common",
254 ":socketrocket",
255 ]
Kári Tristan Helgason946923a2017-06-02 14:05:56 +0200256 if (is_ios) {
257 deps += [ ":AppRTCMobile_ios_frameworks" ]
258 } else {
259 public_deps = [
kthelgason36d658d2017-08-24 05:43:45 -0700260 "../sdk:peerconnection_objc",
Kári Tristan Helgason946923a2017-06-02 14:05:56 +0200261 ]
262 }
tkchin2ddfdba2016-08-07 21:37:45 -0700263 libs = [ "QuartzCore.framework" ]
264 }
265
266 if (is_ios) {
denicija77bfd7c2016-11-15 00:41:26 -0800267 rtc_static_library("AppRTCMobile_lib") {
kjellander1993b1d2017-03-06 00:29:21 -0800268 testonly = true
tkchin2ddfdba2016-08-07 21:37:45 -0700269 sources = [
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200270 "objc/AppRTCMobile/ios/ARDAppDelegate.m",
271 "objc/AppRTCMobile/ios/ARDMainView.h",
272 "objc/AppRTCMobile/ios/ARDMainView.m",
273 "objc/AppRTCMobile/ios/ARDMainViewController.h",
274 "objc/AppRTCMobile/ios/ARDMainViewController.m",
denicijad17d5362016-11-02 02:56:09 -0700275 "objc/AppRTCMobile/ios/ARDSettingsViewController.h",
276 "objc/AppRTCMobile/ios/ARDSettingsViewController.m",
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200277 "objc/AppRTCMobile/ios/ARDStatsView.h",
278 "objc/AppRTCMobile/ios/ARDStatsView.m",
279 "objc/AppRTCMobile/ios/ARDVideoCallView.h",
280 "objc/AppRTCMobile/ios/ARDVideoCallView.m",
281 "objc/AppRTCMobile/ios/ARDVideoCallViewController.h",
282 "objc/AppRTCMobile/ios/ARDVideoCallViewController.m",
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200283 "objc/AppRTCMobile/ios/UIImage+ARDUtilities.h",
284 "objc/AppRTCMobile/ios/UIImage+ARDUtilities.m",
denicija77bfd7c2016-11-15 00:41:26 -0800285 ]
denicija77bfd7c2016-11-15 00:41:26 -0800286
287 deps = [
Kári Tristan Helgason946923a2017-06-02 14:05:56 +0200288 ":AppRTCMobile_ios_frameworks",
denicija77bfd7c2016-11-15 00:41:26 -0800289 ":apprtc_common",
290 ":apprtc_signaling",
291 ]
292 }
293
294 ios_app_bundle("AppRTCMobile") {
kjellander1993b1d2017-03-06 00:29:21 -0800295 testonly = true
denicija77bfd7c2016-11-15 00:41:26 -0800296 sources = [
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200297 "objc/AppRTCMobile/ios/main.m",
tkchin2ddfdba2016-08-07 21:37:45 -0700298 ]
299
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200300 info_plist = "objc/AppRTCMobile/ios/Info.plist"
tkchin2ddfdba2016-08-07 21:37:45 -0700301
denicija77bfd7c2016-11-15 00:41:26 -0800302 configs += [ "..:common_config" ]
tkchin2ddfdba2016-08-07 21:37:45 -0700303 public_configs = [ "..:common_inherited_config" ]
304
305 deps = [
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200306 ":AppRTCMobile_ios_bundle_data",
kthelgasond3adbfb2017-01-26 01:14:04 -0800307 ":AppRTCMobile_ios_frameworks",
denicija77bfd7c2016-11-15 00:41:26 -0800308 ":AppRTCMobile_lib",
tkchin2ddfdba2016-08-07 21:37:45 -0700309 ]
310
311 if (target_cpu == "x86") {
312 deps += [ "//testing/iossim:iossim" ]
313 }
314 }
315
kthelgasond3adbfb2017-01-26 01:14:04 -0800316 bundle_data("AppRTCMobile_ios_frameworks") {
317 public_deps = [
kthelgason36d658d2017-08-24 05:43:45 -0700318 "../sdk:framework_objc+link",
kthelgasond3adbfb2017-01-26 01:14:04 -0800319 ]
320 sources = [
wjywbsbef8a5d2017-10-09 02:32:28 -0400321 "$root_build_dir/WebRTC.framework",
kthelgasond3adbfb2017-01-26 01:14:04 -0800322 ]
323 outputs = [
324 "{{bundle_resources_dir}}/Frameworks/{{source_file_part}}",
325 ]
326 }
327
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200328 bundle_data("AppRTCMobile_ios_bundle_data") {
tkchin2ddfdba2016-08-07 21:37:45 -0700329 sources = [
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200330 "objc/AppRTCMobile/ios/resources/Roboto-Regular.ttf",
331 "objc/AppRTCMobile/ios/resources/iPhone5@2x.png",
332 "objc/AppRTCMobile/ios/resources/iPhone6@2x.png",
333 "objc/AppRTCMobile/ios/resources/iPhone6p@3x.png",
334 "objc/AppRTCMobile/ios/resources/ic_call_end_black_24dp.png",
335 "objc/AppRTCMobile/ios/resources/ic_call_end_black_24dp@2x.png",
336 "objc/AppRTCMobile/ios/resources/ic_clear_black_24dp.png",
337 "objc/AppRTCMobile/ios/resources/ic_clear_black_24dp@2x.png",
denicija6d6762c2016-10-28 04:53:16 -0700338 "objc/AppRTCMobile/ios/resources/ic_settings_black_24dp.png",
339 "objc/AppRTCMobile/ios/resources/ic_settings_black_24dp@2x.png",
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200340 "objc/AppRTCMobile/ios/resources/ic_surround_sound_black_24dp.png",
341 "objc/AppRTCMobile/ios/resources/ic_surround_sound_black_24dp@2x.png",
342 "objc/AppRTCMobile/ios/resources/ic_switch_video_black_24dp.png",
343 "objc/AppRTCMobile/ios/resources/ic_switch_video_black_24dp@2x.png",
344 "objc/AppRTCMobile/ios/resources/mozart.mp3",
anderscb5ed9052017-08-15 04:07:12 -0700345 "objc/Icon-120.png",
346 "objc/Icon-180.png",
tkchin2ddfdba2016-08-07 21:37:45 -0700347 "objc/Icon.png",
348 ]
349 outputs = [
350 "{{bundle_resources_dir}}/{{source_file_part}}",
351 ]
352 }
353 }
354
355 if (is_mac) {
denicija77bfd7c2016-11-15 00:41:26 -0800356 rtc_static_library("AppRTCMobile_lib") {
kjellander1993b1d2017-03-06 00:29:21 -0800357 testonly = true
tkchin2ddfdba2016-08-07 21:37:45 -0700358 sources = [
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200359 "objc/AppRTCMobile/mac/APPRTCAppDelegate.h",
360 "objc/AppRTCMobile/mac/APPRTCAppDelegate.m",
361 "objc/AppRTCMobile/mac/APPRTCViewController.h",
362 "objc/AppRTCMobile/mac/APPRTCViewController.m",
tkchin2ddfdba2016-08-07 21:37:45 -0700363 ]
jianjun.zhuc0247402017-07-11 06:20:45 -0700364 configs += [ "..:common_objc" ]
tkchin2ddfdba2016-08-07 21:37:45 -0700365 deps = [
366 ":apprtc_common",
367 ":apprtc_signaling",
kthelgason36d658d2017-08-24 05:43:45 -0700368 "../sdk:ui_objc",
tkchin2ddfdba2016-08-07 21:37:45 -0700369 ]
370 }
371
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200372 mac_app_bundle("AppRTCMobile") {
kjellander1993b1d2017-03-06 00:29:21 -0800373 testonly = true
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200374 output_name = "AppRTCMobile"
tkchin2ddfdba2016-08-07 21:37:45 -0700375
tkchin2ddfdba2016-08-07 21:37:45 -0700376 sources = [
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200377 "objc/AppRTCMobile/mac/main.m",
tkchin2ddfdba2016-08-07 21:37:45 -0700378 ]
379
380 public_configs = [ "..:common_inherited_config" ]
381
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200382 info_plist = "objc/AppRTCMobile/mac/Info.plist"
tkchin2ddfdba2016-08-07 21:37:45 -0700383
384 libs = [ "AppKit.framework" ]
385
386 deps = [
denicija77bfd7c2016-11-15 00:41:26 -0800387 ":AppRTCMobile_lib",
tkchin2ddfdba2016-08-07 21:37:45 -0700388 ]
389 }
390 }
391
392 config("socketrocket_include_config") {
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200393 include_dirs = [ "objc/AppRTCMobile/third_party/SocketRocket" ]
tkchin2ddfdba2016-08-07 21:37:45 -0700394 }
395
396 config("socketrocket_warning_config") {
397 # GN orders flags on a target before flags from configs. The default config
398 # adds these flags so to cancel them out they need to come from a config and
399 # cannot be on the target directly.
400 cflags = [
401 "-Wno-deprecated-declarations",
402 "-Wno-nonnull",
tkchin2ddfdba2016-08-07 21:37:45 -0700403 "-Wno-semicolon-before-method-body",
kthelgasone47de1a2017-02-24 01:56:01 -0800404 "-Wno-unused-variable",
tkchin2ddfdba2016-08-07 21:37:45 -0700405 ]
406
henrika27d8b612016-09-21 04:13:00 -0700407 cflags_objc = [
408 # Enabled for cflags_objc in build/config/compiler/BUILD.gn.
409 "-Wno-objc-missing-property-synthesis",
henrika27d8b612016-09-21 04:13:00 -0700410 ]
tkchin2ddfdba2016-08-07 21:37:45 -0700411 }
412
kjellanderb62dbbe2016-09-23 00:38:52 -0700413 rtc_static_library("socketrocket") {
kjellander1993b1d2017-03-06 00:29:21 -0800414 testonly = true
tkchin2ddfdba2016-08-07 21:37:45 -0700415 sources = [
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200416 "objc/AppRTCMobile/third_party/SocketRocket/SRWebSocket.h",
417 "objc/AppRTCMobile/third_party/SocketRocket/SRWebSocket.m",
tkchin2ddfdba2016-08-07 21:37:45 -0700418 ]
kthelgasonc0977102017-04-24 00:57:16 -0700419 configs += [ ":socketrocket_warning_config" ]
ehmaldonadoe9cc6862016-09-05 06:10:18 -0700420 public_configs = [ ":socketrocket_include_config" ]
tkchin2ddfdba2016-08-07 21:37:45 -0700421
422 libs = [
423 "CFNetwork.framework",
424 "icucore",
425 ]
426 }
adam.fedorbcc5d872016-11-07 14:53:28 -0800427
428 if (rtc_include_tests) {
kthelgason4065a572017-02-14 04:58:56 -0800429 # TODO(kthelgason): compile xctests on mac when chromium supports it.
430 if (is_ios) {
431 rtc_source_set("apprtcmobile_test_sources") {
kjellander1993b1d2017-03-06 00:29:21 -0800432 testonly = true
kthelgason4065a572017-02-14 04:58:56 -0800433 include_dirs = [
434 "objc/AppRTCMobile",
435 "objc/AppRTCMobile/ios",
436 ]
437 testonly = true
438 sources = [
439 "objc/AppRTCMobile/tests/ARDAppClient_xctest.mm",
440 "objc/AppRTCMobile/tests/ARDSDPUtils_xctest.mm",
441 "objc/AppRTCMobile/tests/ARDSettingsModel_xctest.mm",
442 ]
kjellander1993b1d2017-03-06 00:29:21 -0800443 deps = [
jianjun.zhuc0247402017-07-11 06:20:45 -0700444 "../rtc_base:rtc_base",
kjellander1993b1d2017-03-06 00:29:21 -0800445 ]
kthelgason4065a572017-02-14 04:58:56 -0800446 public_deps = [
447 ":AppRTCMobile_ios_frameworks",
448 ":AppRTCMobile_lib",
449 "//build/config/ios:xctest",
450 "//third_party/ocmock",
451 ]
adam.fedorbcc5d872016-11-07 14:53:28 -0800452 }
453
kthelgason4065a572017-02-14 04:58:56 -0800454 rtc_ios_xctest_test("apprtcmobile_tests") {
455 info_plist = "objc/AppRTCMobile/ios/Info.plist"
456 sources = [
457 "objc/AppRTCMobile/ios/main.m",
458 ]
459 deps = [
460 ":apprtcmobile_test_sources",
461 ]
462 ldflags = [ "-all_load" ]
463 }
adam.fedorbcc5d872016-11-07 14:53:28 -0800464 }
465 }
tkchin2ddfdba2016-08-07 21:37:45 -0700466}
kthelgason0727f152016-08-08 09:03:23 -0700467
468if (is_linux || is_win) {
ehmaldonadod02fe4b2016-08-26 13:31:24 -0700469 config("peerconnection_client_warnings_config") {
kjellander4a9abad2016-09-18 08:12:29 -0700470 cflags = []
ehmaldonadod02fe4b2016-08-26 13:31:24 -0700471 if (is_win && is_clang) {
kjellander4a9abad2016-09-18 08:12:29 -0700472 cflags += [
ehmaldonadod02fe4b2016-08-26 13:31:24 -0700473 # Disable warnings failing when compiling with Clang on Windows.
474 # https://bugs.chromium.org/p/webrtc/issues/detail?id=5366
475 "-Wno-format",
476
477 # See https://bugs.chromium.org/p/webrtc/issues/detail?id=6271
478 # for -Wno-reorder and -Wno-sign-compare
479 "-Wno-reorder",
480 "-Wno-sign-compare",
481 ]
482 }
kjellanderd4626e52016-09-07 02:33:01 -0700483 if (is_linux && target_cpu == "x86") {
kjellander4a9abad2016-09-18 08:12:29 -0700484 cflags += [
kjellanderd4626e52016-09-07 02:33:01 -0700485 # Needed to compile on Linux 32-bit.
486 "-Wno-sentinel",
487 ]
488 }
kjellander4a9abad2016-09-18 08:12:29 -0700489
490 if (is_clang) {
491 # TODO(ehmaldonado): Make peerconnection_client compile with the standard
492 # set of warnings.
493 # See https://bugs.chromium.org/p/webrtc/issues/detail?id=6306
494 cflags += [ "-Wno-inconsistent-missing-override" ]
495 }
ehmaldonadod02fe4b2016-08-26 13:31:24 -0700496 }
497
ehmaldonado38a21322016-09-02 04:10:34 -0700498 rtc_executable("peerconnection_client") {
kjellander1993b1d2017-03-06 00:29:21 -0800499 testonly = true
kthelgason0727f152016-08-08 09:03:23 -0700500 sources = [
501 "peerconnection/client/conductor.cc",
502 "peerconnection/client/conductor.h",
503 "peerconnection/client/defaults.cc",
504 "peerconnection/client/defaults.h",
505 "peerconnection/client/peer_connection_client.cc",
506 "peerconnection/client/peer_connection_client.h",
507 ]
ehmaldonado7a2ce0b2016-09-05 01:35:44 -0700508
kjellandere40a7ee2016-10-16 23:56:12 -0700509 if (!build_with_chromium && is_clang) {
510 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
ehmaldonado38a21322016-09-02 04:10:34 -0700511 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
kthelgason0727f152016-08-08 09:03:23 -0700512 }
kjellander1993b1d2017-03-06 00:29:21 -0800513 deps = []
kthelgason0727f152016-08-08 09:03:23 -0700514 if (is_win) {
515 sources += [
516 "peerconnection/client/flagdefs.h",
517 "peerconnection/client/main.cc",
518 "peerconnection/client/main_wnd.cc",
519 "peerconnection/client/main_wnd.h",
520 ]
521 cflags = [ "/wd4245" ]
522 configs += [ "//build/config/win:windowed" ]
jianjun.zhuc0247402017-07-11 06:20:45 -0700523 deps += [ "../media:rtc_media_base" ]
kthelgason0727f152016-08-08 09:03:23 -0700524 }
525 if (is_linux) {
526 sources += [
527 "peerconnection/client/linux/main.cc",
528 "peerconnection/client/linux/main_wnd.cc",
529 "peerconnection/client/linux/main_wnd.h",
530 ]
Henrik Kjellanderefbde2c2017-03-27 08:28:27 +0200531 cflags = [ "-Wno-deprecated-declarations" ]
kthelgason0727f152016-08-08 09:03:23 -0700532 libs = [
533 "X11",
534 "Xcomposite",
535 "Xext",
536 "Xrender",
537 ]
thomasandersonef16e992016-12-13 02:57:43 -0800538 deps += [ "//build/config/linux/gtk" ]
kthelgason0727f152016-08-08 09:03:23 -0700539 }
ehmaldonadod02fe4b2016-08-26 13:31:24 -0700540 configs += [ ":peerconnection_client_warnings_config" ]
kjellander1993b1d2017-03-06 00:29:21 -0800541
542 deps += [
jianjun.zhuc0247402017-07-11 06:20:45 -0700543 "../api:libjingle_peerconnection_test_api",
544 "../api:video_frame_api",
jianjun.zhuc0247402017-07-11 06:20:45 -0700545 "../media:rtc_media",
546 "../modules/video_capture:video_capture_module",
547 "../pc:libjingle_peerconnection",
ehmaldonadof6a861a2017-07-19 10:40:47 -0700548 "../rtc_base:rtc_base",
549 "../rtc_base:rtc_base_approved",
550 "../rtc_base:rtc_json",
jianjun.zhuc0247402017-07-11 06:20:45 -0700551 "../system_wrappers:field_trial_default",
552 "../system_wrappers:metrics_default",
kjellander1993b1d2017-03-06 00:29:21 -0800553 "//third_party/libyuv",
kjellander1993b1d2017-03-06 00:29:21 -0800554 ]
kthelgason0727f152016-08-08 09:03:23 -0700555 }
kjellanderd4626e52016-09-07 02:33:01 -0700556
ehmaldonado38a21322016-09-02 04:10:34 -0700557 rtc_executable("peerconnection_server") {
kjellander1993b1d2017-03-06 00:29:21 -0800558 testonly = true
kthelgason0727f152016-08-08 09:03:23 -0700559 sources = [
560 "peerconnection/server/data_socket.cc",
561 "peerconnection/server/data_socket.h",
562 "peerconnection/server/main.cc",
563 "peerconnection/server/peer_channel.cc",
564 "peerconnection/server/peer_channel.h",
565 "peerconnection/server/utils.cc",
566 "peerconnection/server/utils.h",
567 ]
568 deps = [
jianjun.zhuc0247402017-07-11 06:20:45 -0700569 "..:webrtc_common",
ehmaldonadof6a861a2017-07-19 10:40:47 -0700570 "../rtc_base:rtc_base_approved",
jianjun.zhuc0247402017-07-11 06:20:45 -0700571 "../rtc_tools:command_line_parser",
kthelgason0727f152016-08-08 09:03:23 -0700572 ]
kjellandere40a7ee2016-10-16 23:56:12 -0700573 if (!build_with_chromium && is_clang) {
574 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
ehmaldonado38a21322016-09-02 04:10:34 -0700575 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
kthelgason0727f152016-08-08 09:03:23 -0700576 }
577 }
ehmaldonado38a21322016-09-02 04:10:34 -0700578 rtc_executable("relayserver") {
kjellander1993b1d2017-03-06 00:29:21 -0800579 testonly = true
kthelgason0727f152016-08-08 09:03:23 -0700580 sources = [
581 "relayserver/relayserver_main.cc",
582 ]
583 deps = [
jianjun.zhuc0247402017-07-11 06:20:45 -0700584 "../p2p:rtc_p2p",
585 "../pc:rtc_pc",
ehmaldonadof6a861a2017-07-19 10:40:47 -0700586 "../rtc_base:rtc_base",
587 "../rtc_base:rtc_base_approved",
jianjun.zhuc0247402017-07-11 06:20:45 -0700588 "../system_wrappers:field_trial_default",
589 "../system_wrappers:metrics_default",
kthelgason0727f152016-08-08 09:03:23 -0700590 ]
kjellandere40a7ee2016-10-16 23:56:12 -0700591 if (!build_with_chromium && is_clang) {
592 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
ehmaldonado38a21322016-09-02 04:10:34 -0700593 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
kthelgason0727f152016-08-08 09:03:23 -0700594 }
595 }
ehmaldonado38a21322016-09-02 04:10:34 -0700596 rtc_executable("turnserver") {
kjellander1993b1d2017-03-06 00:29:21 -0800597 testonly = true
kthelgason0727f152016-08-08 09:03:23 -0700598 sources = [
599 "turnserver/turnserver_main.cc",
600 ]
601 deps = [
jianjun.zhuc0247402017-07-11 06:20:45 -0700602 "../p2p:rtc_p2p",
603 "../pc:rtc_pc",
ehmaldonadof6a861a2017-07-19 10:40:47 -0700604 "../rtc_base:rtc_base",
605 "../rtc_base:rtc_base_approved",
jianjun.zhuc0247402017-07-11 06:20:45 -0700606 "../system_wrappers:field_trial_default",
607 "../system_wrappers:metrics_default",
kthelgason0727f152016-08-08 09:03:23 -0700608 ]
kjellandere40a7ee2016-10-16 23:56:12 -0700609 if (!build_with_chromium && is_clang) {
610 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
ehmaldonado38a21322016-09-02 04:10:34 -0700611 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
kthelgason0727f152016-08-08 09:03:23 -0700612 }
613 }
ehmaldonado38a21322016-09-02 04:10:34 -0700614 rtc_executable("stunserver") {
kjellander1993b1d2017-03-06 00:29:21 -0800615 testonly = true
kthelgason0727f152016-08-08 09:03:23 -0700616 sources = [
617 "stunserver/stunserver_main.cc",
618 ]
619 deps = [
jianjun.zhuc0247402017-07-11 06:20:45 -0700620 "../p2p:rtc_p2p",
621 "../pc:rtc_pc",
ehmaldonadof6a861a2017-07-19 10:40:47 -0700622 "../rtc_base:rtc_base",
623 "../rtc_base:rtc_base_approved",
jianjun.zhuc0247402017-07-11 06:20:45 -0700624 "../system_wrappers:field_trial_default",
625 "../system_wrappers:metrics_default",
kthelgason0727f152016-08-08 09:03:23 -0700626 ]
kjellandere40a7ee2016-10-16 23:56:12 -0700627 if (!build_with_chromium && is_clang) {
628 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
ehmaldonado38a21322016-09-02 04:10:34 -0700629 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
kthelgason0727f152016-08-08 09:03:23 -0700630 }
631 }
632}
charujainaca3a242016-11-01 03:09:15 -0700633
qiangchen42f96d52017-08-08 17:08:03 -0700634if (is_win || is_android) {
gyzhouad7cad82017-05-11 16:10:03 -0700635 rtc_shared_library("webrtc_unity_plugin") {
636 testonly = true
637 sources = [
638 "unityplugin/simple_peer_connection.cc",
639 "unityplugin/simple_peer_connection.h",
640 "unityplugin/unity_plugin_apis.cc",
641 "unityplugin/unity_plugin_apis.h",
gyzhoub38f3862017-07-25 16:04:31 -0700642 "unityplugin/video_observer.cc",
643 "unityplugin/video_observer.h",
gyzhouad7cad82017-05-11 16:10:03 -0700644 ]
qiangchen42f96d52017-08-08 17:08:03 -0700645
646 if (is_android) {
647 sources += [
648 "unityplugin/classreferenceholder.cc",
649 "unityplugin/classreferenceholder.h",
650 "unityplugin/jni_onload.cc",
651 ]
652 }
653
gyzhouad7cad82017-05-11 16:10:03 -0700654 if (!build_with_chromium && is_clang) {
655 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
656 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
657 }
qiangchen42f96d52017-08-08 17:08:03 -0700658 if (is_win) {
659 cflags = [ "/wd4245" ]
660 configs += [
661 "//build/config/win:windowed",
662 ":peerconnection_client_warnings_config",
663 ]
664 }
gyzhouad7cad82017-05-11 16:10:03 -0700665 deps = [
jianjun.zhuc0247402017-07-11 06:20:45 -0700666 "../api:libjingle_peerconnection_test_api",
667 "../api:video_frame_api",
jianjun.zhuc0247402017-07-11 06:20:45 -0700668 "../media:rtc_media",
669 "../media:rtc_media_base",
670 "../modules/video_capture:video_capture_module",
671 "../pc:libjingle_peerconnection",
qiangchen42f96d52017-08-08 17:08:03 -0700672 "../rtc_base:rtc_base",
jianjun.zhuc0247402017-07-11 06:20:45 -0700673 "../system_wrappers:field_trial_default",
674 "../system_wrappers:metrics_default",
gyzhouad7cad82017-05-11 16:10:03 -0700675 ]
qiangchen42f96d52017-08-08 17:08:03 -0700676 if (is_android) {
677 deps += [ "../sdk/android:libjingle_peerconnection_jni" ]
678 }
679 }
680}
681
682if (is_android) {
683 android_library("webrtc_unity_java") {
684 java_files = [ "unityplugin/java/src/org/webrtc/UnityUtility.java" ]
685 deps = [
686 "../rtc_base:base_java",
687 "../sdk/android:libjingle_peerconnection_java",
688 ]
689 }
690
691 dist_jar("libwebrtc_unity") {
692 _target_dir_name = get_label_info(":$target_name", "dir")
693 output = "${root_out_dir}/lib.java${_target_dir_name}/${target_name}.jar"
694 direct_deps_only = true
695 use_interface_jars = false
Oleh Prypin86021d92017-09-24 22:29:06 +0200696 requires_android = true
qiangchen42f96d52017-08-08 17:08:03 -0700697 deps = [
698 ":webrtc_unity_java",
699 "../modules/audio_device:audio_device_java",
700 "../rtc_base:base_java",
701 "../sdk/android:libjingle_peerconnection_java",
702 "../sdk/android:libjingle_peerconnection_metrics_default_java",
703 ]
gyzhouad7cad82017-05-11 16:10:03 -0700704 }
705}
706
charujainaca3a242016-11-01 03:09:15 -0700707if (!build_with_chromium) {
708 # Doesn't build within Chrome on Win.
709 rtc_executable("stun_prober") {
kjellander1993b1d2017-03-06 00:29:21 -0800710 testonly = true
charujainaca3a242016-11-01 03:09:15 -0700711 sources = [
712 "stunprober/main.cc",
713 ]
714
715 if (!build_with_chromium && is_clang) {
716 # Suppress warnings from Chrome's Clang plugins.
717 # See http://code.google.com/p/webrtc/issues/detail?id=163 for details.
718 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
719 }
720
721 deps = [
722 "../p2p:libstunprober",
723 "../p2p:rtc_p2p",
ehmaldonadof6a861a2017-07-19 10:40:47 -0700724 "../rtc_base:rtc_base",
725 "../rtc_base:rtc_base_approved",
charujainaca3a242016-11-01 03:09:15 -0700726 "../system_wrappers:field_trial_default",
727 ]
728 }
729}