blob: b7474d6c8dfd8e0a4c4a2564bbf542f028f7c135 [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",
Alex Naresta5fbc232017-10-18 18:31:07 +0200179 "../rtc_base:rtc_base",
kthelgason5901d9d2017-08-16 07:28:03 -0700180 ]
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",
Alex Naresta5fbc232017-10-18 18:31:07 +0200210 "objc/AppRTCMobile/ARDBitrateAllocationStrategy.h",
211 "objc/AppRTCMobile/ARDBitrateAllocationStrategy.mm",
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200212 "objc/AppRTCMobile/ARDBitrateTracker.h",
213 "objc/AppRTCMobile/ARDBitrateTracker.m",
sakalc522e752017-04-05 12:17:48 -0700214 "objc/AppRTCMobile/ARDCaptureController.h",
215 "objc/AppRTCMobile/ARDCaptureController.m",
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200216 "objc/AppRTCMobile/ARDJoinResponse+Internal.h",
217 "objc/AppRTCMobile/ARDJoinResponse.h",
218 "objc/AppRTCMobile/ARDJoinResponse.m",
219 "objc/AppRTCMobile/ARDMessageResponse+Internal.h",
220 "objc/AppRTCMobile/ARDMessageResponse.h",
221 "objc/AppRTCMobile/ARDMessageResponse.m",
222 "objc/AppRTCMobile/ARDRoomServerClient.h",
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",
Alex Naresta5fbc232017-10-18 18:31:07 +0200255 "../rtc_base:rtc_base",
tkchin2ddfdba2016-08-07 21:37:45 -0700256 ]
Kári Tristan Helgason946923a2017-06-02 14:05:56 +0200257 if (is_ios) {
258 deps += [ ":AppRTCMobile_ios_frameworks" ]
259 } else {
260 public_deps = [
kthelgason36d658d2017-08-24 05:43:45 -0700261 "../sdk:peerconnection_objc",
Kári Tristan Helgason946923a2017-06-02 14:05:56 +0200262 ]
263 }
tkchin2ddfdba2016-08-07 21:37:45 -0700264 libs = [ "QuartzCore.framework" ]
265 }
266
267 if (is_ios) {
denicija77bfd7c2016-11-15 00:41:26 -0800268 rtc_static_library("AppRTCMobile_lib") {
kjellander1993b1d2017-03-06 00:29:21 -0800269 testonly = true
tkchin2ddfdba2016-08-07 21:37:45 -0700270 sources = [
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200271 "objc/AppRTCMobile/ios/ARDAppDelegate.m",
272 "objc/AppRTCMobile/ios/ARDMainView.h",
273 "objc/AppRTCMobile/ios/ARDMainView.m",
274 "objc/AppRTCMobile/ios/ARDMainViewController.h",
275 "objc/AppRTCMobile/ios/ARDMainViewController.m",
denicijad17d5362016-11-02 02:56:09 -0700276 "objc/AppRTCMobile/ios/ARDSettingsViewController.h",
277 "objc/AppRTCMobile/ios/ARDSettingsViewController.m",
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200278 "objc/AppRTCMobile/ios/ARDStatsView.h",
279 "objc/AppRTCMobile/ios/ARDStatsView.m",
280 "objc/AppRTCMobile/ios/ARDVideoCallView.h",
281 "objc/AppRTCMobile/ios/ARDVideoCallView.m",
282 "objc/AppRTCMobile/ios/ARDVideoCallViewController.h",
283 "objc/AppRTCMobile/ios/ARDVideoCallViewController.m",
Anders Carlsson6bf43d22017-10-16 13:51:43 +0200284 "objc/AppRTCMobile/ios/RTCVideoCodecInfo+HumanReadable.h",
285 "objc/AppRTCMobile/ios/RTCVideoCodecInfo+HumanReadable.m",
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200286 "objc/AppRTCMobile/ios/UIImage+ARDUtilities.h",
287 "objc/AppRTCMobile/ios/UIImage+ARDUtilities.m",
denicija77bfd7c2016-11-15 00:41:26 -0800288 ]
denicija77bfd7c2016-11-15 00:41:26 -0800289
290 deps = [
Kári Tristan Helgason946923a2017-06-02 14:05:56 +0200291 ":AppRTCMobile_ios_frameworks",
denicija77bfd7c2016-11-15 00:41:26 -0800292 ":apprtc_common",
293 ":apprtc_signaling",
294 ]
295 }
296
297 ios_app_bundle("AppRTCMobile") {
kjellander1993b1d2017-03-06 00:29:21 -0800298 testonly = true
denicija77bfd7c2016-11-15 00:41:26 -0800299 sources = [
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200300 "objc/AppRTCMobile/ios/main.m",
tkchin2ddfdba2016-08-07 21:37:45 -0700301 ]
302
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200303 info_plist = "objc/AppRTCMobile/ios/Info.plist"
tkchin2ddfdba2016-08-07 21:37:45 -0700304
denicija77bfd7c2016-11-15 00:41:26 -0800305 configs += [ "..:common_config" ]
tkchin2ddfdba2016-08-07 21:37:45 -0700306 public_configs = [ "..:common_inherited_config" ]
307
308 deps = [
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200309 ":AppRTCMobile_ios_bundle_data",
kthelgasond3adbfb2017-01-26 01:14:04 -0800310 ":AppRTCMobile_ios_frameworks",
denicija77bfd7c2016-11-15 00:41:26 -0800311 ":AppRTCMobile_lib",
tkchin2ddfdba2016-08-07 21:37:45 -0700312 ]
313
314 if (target_cpu == "x86") {
315 deps += [ "//testing/iossim:iossim" ]
316 }
317 }
318
kthelgasond3adbfb2017-01-26 01:14:04 -0800319 bundle_data("AppRTCMobile_ios_frameworks") {
320 public_deps = [
kthelgason36d658d2017-08-24 05:43:45 -0700321 "../sdk:framework_objc+link",
kthelgasond3adbfb2017-01-26 01:14:04 -0800322 ]
323 sources = [
wjywbsbef8a5d2017-10-09 02:32:28 -0400324 "$root_build_dir/WebRTC.framework",
kthelgasond3adbfb2017-01-26 01:14:04 -0800325 ]
326 outputs = [
327 "{{bundle_resources_dir}}/Frameworks/{{source_file_part}}",
328 ]
329 }
330
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200331 bundle_data("AppRTCMobile_ios_bundle_data") {
tkchin2ddfdba2016-08-07 21:37:45 -0700332 sources = [
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200333 "objc/AppRTCMobile/ios/resources/Roboto-Regular.ttf",
334 "objc/AppRTCMobile/ios/resources/iPhone5@2x.png",
335 "objc/AppRTCMobile/ios/resources/iPhone6@2x.png",
336 "objc/AppRTCMobile/ios/resources/iPhone6p@3x.png",
337 "objc/AppRTCMobile/ios/resources/ic_call_end_black_24dp.png",
338 "objc/AppRTCMobile/ios/resources/ic_call_end_black_24dp@2x.png",
339 "objc/AppRTCMobile/ios/resources/ic_clear_black_24dp.png",
340 "objc/AppRTCMobile/ios/resources/ic_clear_black_24dp@2x.png",
denicija6d6762c2016-10-28 04:53:16 -0700341 "objc/AppRTCMobile/ios/resources/ic_settings_black_24dp.png",
342 "objc/AppRTCMobile/ios/resources/ic_settings_black_24dp@2x.png",
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200343 "objc/AppRTCMobile/ios/resources/ic_surround_sound_black_24dp.png",
344 "objc/AppRTCMobile/ios/resources/ic_surround_sound_black_24dp@2x.png",
345 "objc/AppRTCMobile/ios/resources/ic_switch_video_black_24dp.png",
346 "objc/AppRTCMobile/ios/resources/ic_switch_video_black_24dp@2x.png",
347 "objc/AppRTCMobile/ios/resources/mozart.mp3",
anderscb5ed9052017-08-15 04:07:12 -0700348 "objc/Icon-120.png",
349 "objc/Icon-180.png",
tkchin2ddfdba2016-08-07 21:37:45 -0700350 "objc/Icon.png",
351 ]
352 outputs = [
353 "{{bundle_resources_dir}}/{{source_file_part}}",
354 ]
355 }
356 }
357
358 if (is_mac) {
denicija77bfd7c2016-11-15 00:41:26 -0800359 rtc_static_library("AppRTCMobile_lib") {
kjellander1993b1d2017-03-06 00:29:21 -0800360 testonly = true
tkchin2ddfdba2016-08-07 21:37:45 -0700361 sources = [
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200362 "objc/AppRTCMobile/mac/APPRTCAppDelegate.h",
363 "objc/AppRTCMobile/mac/APPRTCAppDelegate.m",
364 "objc/AppRTCMobile/mac/APPRTCViewController.h",
365 "objc/AppRTCMobile/mac/APPRTCViewController.m",
tkchin2ddfdba2016-08-07 21:37:45 -0700366 ]
jianjun.zhuc0247402017-07-11 06:20:45 -0700367 configs += [ "..:common_objc" ]
tkchin2ddfdba2016-08-07 21:37:45 -0700368 deps = [
369 ":apprtc_common",
370 ":apprtc_signaling",
kthelgason36d658d2017-08-24 05:43:45 -0700371 "../sdk:ui_objc",
tkchin2ddfdba2016-08-07 21:37:45 -0700372 ]
373 }
374
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200375 mac_app_bundle("AppRTCMobile") {
kjellander1993b1d2017-03-06 00:29:21 -0800376 testonly = true
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200377 output_name = "AppRTCMobile"
tkchin2ddfdba2016-08-07 21:37:45 -0700378
tkchin2ddfdba2016-08-07 21:37:45 -0700379 sources = [
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200380 "objc/AppRTCMobile/mac/main.m",
tkchin2ddfdba2016-08-07 21:37:45 -0700381 ]
382
383 public_configs = [ "..:common_inherited_config" ]
384
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200385 info_plist = "objc/AppRTCMobile/mac/Info.plist"
tkchin2ddfdba2016-08-07 21:37:45 -0700386
387 libs = [ "AppKit.framework" ]
388
389 deps = [
denicija77bfd7c2016-11-15 00:41:26 -0800390 ":AppRTCMobile_lib",
tkchin2ddfdba2016-08-07 21:37:45 -0700391 ]
392 }
393 }
394
395 config("socketrocket_include_config") {
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200396 include_dirs = [ "objc/AppRTCMobile/third_party/SocketRocket" ]
tkchin2ddfdba2016-08-07 21:37:45 -0700397 }
398
399 config("socketrocket_warning_config") {
400 # GN orders flags on a target before flags from configs. The default config
401 # adds these flags so to cancel them out they need to come from a config and
402 # cannot be on the target directly.
403 cflags = [
404 "-Wno-deprecated-declarations",
405 "-Wno-nonnull",
tkchin2ddfdba2016-08-07 21:37:45 -0700406 "-Wno-semicolon-before-method-body",
kthelgasone47de1a2017-02-24 01:56:01 -0800407 "-Wno-unused-variable",
tkchin2ddfdba2016-08-07 21:37:45 -0700408 ]
409
henrika27d8b612016-09-21 04:13:00 -0700410 cflags_objc = [
411 # Enabled for cflags_objc in build/config/compiler/BUILD.gn.
412 "-Wno-objc-missing-property-synthesis",
henrika27d8b612016-09-21 04:13:00 -0700413 ]
tkchin2ddfdba2016-08-07 21:37:45 -0700414 }
415
kjellanderb62dbbe2016-09-23 00:38:52 -0700416 rtc_static_library("socketrocket") {
kjellander1993b1d2017-03-06 00:29:21 -0800417 testonly = true
tkchin2ddfdba2016-08-07 21:37:45 -0700418 sources = [
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200419 "objc/AppRTCMobile/third_party/SocketRocket/SRWebSocket.h",
420 "objc/AppRTCMobile/third_party/SocketRocket/SRWebSocket.m",
tkchin2ddfdba2016-08-07 21:37:45 -0700421 ]
kthelgasonc0977102017-04-24 00:57:16 -0700422 configs += [ ":socketrocket_warning_config" ]
ehmaldonadoe9cc6862016-09-05 06:10:18 -0700423 public_configs = [ ":socketrocket_include_config" ]
tkchin2ddfdba2016-08-07 21:37:45 -0700424
425 libs = [
426 "CFNetwork.framework",
427 "icucore",
428 ]
429 }
adam.fedorbcc5d872016-11-07 14:53:28 -0800430
431 if (rtc_include_tests) {
kthelgason4065a572017-02-14 04:58:56 -0800432 # TODO(kthelgason): compile xctests on mac when chromium supports it.
433 if (is_ios) {
434 rtc_source_set("apprtcmobile_test_sources") {
kjellander1993b1d2017-03-06 00:29:21 -0800435 testonly = true
kthelgason4065a572017-02-14 04:58:56 -0800436 include_dirs = [
437 "objc/AppRTCMobile",
438 "objc/AppRTCMobile/ios",
439 ]
440 testonly = true
441 sources = [
442 "objc/AppRTCMobile/tests/ARDAppClient_xctest.mm",
kthelgason4065a572017-02-14 04:58:56 -0800443 "objc/AppRTCMobile/tests/ARDSettingsModel_xctest.mm",
444 ]
kjellander1993b1d2017-03-06 00:29:21 -0800445 deps = [
jianjun.zhuc0247402017-07-11 06:20:45 -0700446 "../rtc_base:rtc_base",
kjellander1993b1d2017-03-06 00:29:21 -0800447 ]
kthelgason4065a572017-02-14 04:58:56 -0800448 public_deps = [
449 ":AppRTCMobile_ios_frameworks",
450 ":AppRTCMobile_lib",
451 "//build/config/ios:xctest",
452 "//third_party/ocmock",
453 ]
adam.fedorbcc5d872016-11-07 14:53:28 -0800454 }
455
kthelgason4065a572017-02-14 04:58:56 -0800456 rtc_ios_xctest_test("apprtcmobile_tests") {
457 info_plist = "objc/AppRTCMobile/ios/Info.plist"
458 sources = [
459 "objc/AppRTCMobile/ios/main.m",
460 ]
461 deps = [
462 ":apprtcmobile_test_sources",
463 ]
464 ldflags = [ "-all_load" ]
465 }
adam.fedorbcc5d872016-11-07 14:53:28 -0800466 }
467 }
tkchin2ddfdba2016-08-07 21:37:45 -0700468}
kthelgason0727f152016-08-08 09:03:23 -0700469
470if (is_linux || is_win) {
ehmaldonadod02fe4b2016-08-26 13:31:24 -0700471 config("peerconnection_client_warnings_config") {
kjellander4a9abad2016-09-18 08:12:29 -0700472 cflags = []
ehmaldonadod02fe4b2016-08-26 13:31:24 -0700473 if (is_win && is_clang) {
kjellander4a9abad2016-09-18 08:12:29 -0700474 cflags += [
ehmaldonadod02fe4b2016-08-26 13:31:24 -0700475 # Disable warnings failing when compiling with Clang on Windows.
476 # https://bugs.chromium.org/p/webrtc/issues/detail?id=5366
477 "-Wno-format",
478
479 # See https://bugs.chromium.org/p/webrtc/issues/detail?id=6271
480 # for -Wno-reorder and -Wno-sign-compare
481 "-Wno-reorder",
482 "-Wno-sign-compare",
483 ]
484 }
kjellanderd4626e52016-09-07 02:33:01 -0700485 if (is_linux && target_cpu == "x86") {
kjellander4a9abad2016-09-18 08:12:29 -0700486 cflags += [
kjellanderd4626e52016-09-07 02:33:01 -0700487 # Needed to compile on Linux 32-bit.
488 "-Wno-sentinel",
489 ]
490 }
kjellander4a9abad2016-09-18 08:12:29 -0700491
492 if (is_clang) {
493 # TODO(ehmaldonado): Make peerconnection_client compile with the standard
494 # set of warnings.
495 # See https://bugs.chromium.org/p/webrtc/issues/detail?id=6306
496 cflags += [ "-Wno-inconsistent-missing-override" ]
497 }
ehmaldonadod02fe4b2016-08-26 13:31:24 -0700498 }
499
ehmaldonado38a21322016-09-02 04:10:34 -0700500 rtc_executable("peerconnection_client") {
kjellander1993b1d2017-03-06 00:29:21 -0800501 testonly = true
kthelgason0727f152016-08-08 09:03:23 -0700502 sources = [
503 "peerconnection/client/conductor.cc",
504 "peerconnection/client/conductor.h",
505 "peerconnection/client/defaults.cc",
506 "peerconnection/client/defaults.h",
507 "peerconnection/client/peer_connection_client.cc",
508 "peerconnection/client/peer_connection_client.h",
509 ]
ehmaldonado7a2ce0b2016-09-05 01:35:44 -0700510
kjellandere40a7ee2016-10-16 23:56:12 -0700511 if (!build_with_chromium && is_clang) {
512 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
ehmaldonado38a21322016-09-02 04:10:34 -0700513 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
kthelgason0727f152016-08-08 09:03:23 -0700514 }
kjellander1993b1d2017-03-06 00:29:21 -0800515 deps = []
kthelgason0727f152016-08-08 09:03:23 -0700516 if (is_win) {
517 sources += [
518 "peerconnection/client/flagdefs.h",
519 "peerconnection/client/main.cc",
520 "peerconnection/client/main_wnd.cc",
521 "peerconnection/client/main_wnd.h",
522 ]
523 cflags = [ "/wd4245" ]
524 configs += [ "//build/config/win:windowed" ]
jianjun.zhuc0247402017-07-11 06:20:45 -0700525 deps += [ "../media:rtc_media_base" ]
kthelgason0727f152016-08-08 09:03:23 -0700526 }
527 if (is_linux) {
528 sources += [
529 "peerconnection/client/linux/main.cc",
530 "peerconnection/client/linux/main_wnd.cc",
531 "peerconnection/client/linux/main_wnd.h",
532 ]
Henrik Kjellanderefbde2c2017-03-27 08:28:27 +0200533 cflags = [ "-Wno-deprecated-declarations" ]
kthelgason0727f152016-08-08 09:03:23 -0700534 libs = [
535 "X11",
536 "Xcomposite",
537 "Xext",
538 "Xrender",
539 ]
thomasandersonef16e992016-12-13 02:57:43 -0800540 deps += [ "//build/config/linux/gtk" ]
kthelgason0727f152016-08-08 09:03:23 -0700541 }
ehmaldonadod02fe4b2016-08-26 13:31:24 -0700542 configs += [ ":peerconnection_client_warnings_config" ]
kjellander1993b1d2017-03-06 00:29:21 -0800543
544 deps += [
jianjun.zhuc0247402017-07-11 06:20:45 -0700545 "../api:libjingle_peerconnection_test_api",
546 "../api:video_frame_api",
Karl Wiberg1b0eae32017-10-17 14:48:54 +0200547 "../api/audio_codecs:builtin_audio_decoder_factory",
548 "../api/audio_codecs:builtin_audio_encoder_factory",
jianjun.zhuc0247402017-07-11 06:20:45 -0700549 "../media:rtc_media",
550 "../modules/video_capture:video_capture_module",
551 "../pc:libjingle_peerconnection",
ehmaldonadof6a861a2017-07-19 10:40:47 -0700552 "../rtc_base:rtc_base",
553 "../rtc_base:rtc_base_approved",
554 "../rtc_base:rtc_json",
jianjun.zhuc0247402017-07-11 06:20:45 -0700555 "../system_wrappers:field_trial_default",
556 "../system_wrappers:metrics_default",
kjellander1993b1d2017-03-06 00:29:21 -0800557 "//third_party/libyuv",
kjellander1993b1d2017-03-06 00:29:21 -0800558 ]
kthelgason0727f152016-08-08 09:03:23 -0700559 }
kjellanderd4626e52016-09-07 02:33:01 -0700560
ehmaldonado38a21322016-09-02 04:10:34 -0700561 rtc_executable("peerconnection_server") {
kjellander1993b1d2017-03-06 00:29:21 -0800562 testonly = true
kthelgason0727f152016-08-08 09:03:23 -0700563 sources = [
564 "peerconnection/server/data_socket.cc",
565 "peerconnection/server/data_socket.h",
566 "peerconnection/server/main.cc",
567 "peerconnection/server/peer_channel.cc",
568 "peerconnection/server/peer_channel.h",
569 "peerconnection/server/utils.cc",
570 "peerconnection/server/utils.h",
571 ]
572 deps = [
jianjun.zhuc0247402017-07-11 06:20:45 -0700573 "..:webrtc_common",
ehmaldonadof6a861a2017-07-19 10:40:47 -0700574 "../rtc_base:rtc_base_approved",
jianjun.zhuc0247402017-07-11 06:20:45 -0700575 "../rtc_tools:command_line_parser",
kthelgason0727f152016-08-08 09:03:23 -0700576 ]
kjellandere40a7ee2016-10-16 23:56:12 -0700577 if (!build_with_chromium && is_clang) {
578 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
ehmaldonado38a21322016-09-02 04:10:34 -0700579 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
kthelgason0727f152016-08-08 09:03:23 -0700580 }
581 }
ehmaldonado38a21322016-09-02 04:10:34 -0700582 rtc_executable("relayserver") {
kjellander1993b1d2017-03-06 00:29:21 -0800583 testonly = true
kthelgason0727f152016-08-08 09:03:23 -0700584 sources = [
585 "relayserver/relayserver_main.cc",
586 ]
587 deps = [
jianjun.zhuc0247402017-07-11 06:20:45 -0700588 "../p2p:rtc_p2p",
589 "../pc:rtc_pc",
ehmaldonadof6a861a2017-07-19 10:40:47 -0700590 "../rtc_base:rtc_base",
591 "../rtc_base:rtc_base_approved",
jianjun.zhuc0247402017-07-11 06:20:45 -0700592 "../system_wrappers:field_trial_default",
593 "../system_wrappers:metrics_default",
kthelgason0727f152016-08-08 09:03:23 -0700594 ]
kjellandere40a7ee2016-10-16 23:56:12 -0700595 if (!build_with_chromium && is_clang) {
596 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
ehmaldonado38a21322016-09-02 04:10:34 -0700597 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
kthelgason0727f152016-08-08 09:03:23 -0700598 }
599 }
ehmaldonado38a21322016-09-02 04:10:34 -0700600 rtc_executable("turnserver") {
kjellander1993b1d2017-03-06 00:29:21 -0800601 testonly = true
kthelgason0727f152016-08-08 09:03:23 -0700602 sources = [
603 "turnserver/turnserver_main.cc",
604 ]
605 deps = [
jianjun.zhuc0247402017-07-11 06:20:45 -0700606 "../p2p:rtc_p2p",
607 "../pc:rtc_pc",
ehmaldonadof6a861a2017-07-19 10:40:47 -0700608 "../rtc_base:rtc_base",
609 "../rtc_base:rtc_base_approved",
jianjun.zhuc0247402017-07-11 06:20:45 -0700610 "../system_wrappers:field_trial_default",
611 "../system_wrappers:metrics_default",
kthelgason0727f152016-08-08 09:03:23 -0700612 ]
kjellandere40a7ee2016-10-16 23:56:12 -0700613 if (!build_with_chromium && is_clang) {
614 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
ehmaldonado38a21322016-09-02 04:10:34 -0700615 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
kthelgason0727f152016-08-08 09:03:23 -0700616 }
617 }
ehmaldonado38a21322016-09-02 04:10:34 -0700618 rtc_executable("stunserver") {
kjellander1993b1d2017-03-06 00:29:21 -0800619 testonly = true
kthelgason0727f152016-08-08 09:03:23 -0700620 sources = [
621 "stunserver/stunserver_main.cc",
622 ]
623 deps = [
jianjun.zhuc0247402017-07-11 06:20:45 -0700624 "../p2p:rtc_p2p",
625 "../pc:rtc_pc",
ehmaldonadof6a861a2017-07-19 10:40:47 -0700626 "../rtc_base:rtc_base",
627 "../rtc_base:rtc_base_approved",
jianjun.zhuc0247402017-07-11 06:20:45 -0700628 "../system_wrappers:field_trial_default",
629 "../system_wrappers:metrics_default",
kthelgason0727f152016-08-08 09:03:23 -0700630 ]
kjellandere40a7ee2016-10-16 23:56:12 -0700631 if (!build_with_chromium && is_clang) {
632 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
ehmaldonado38a21322016-09-02 04:10:34 -0700633 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
kthelgason0727f152016-08-08 09:03:23 -0700634 }
635 }
636}
charujainaca3a242016-11-01 03:09:15 -0700637
qiangchen42f96d52017-08-08 17:08:03 -0700638if (is_win || is_android) {
gyzhouad7cad82017-05-11 16:10:03 -0700639 rtc_shared_library("webrtc_unity_plugin") {
640 testonly = true
641 sources = [
642 "unityplugin/simple_peer_connection.cc",
643 "unityplugin/simple_peer_connection.h",
644 "unityplugin/unity_plugin_apis.cc",
645 "unityplugin/unity_plugin_apis.h",
gyzhoub38f3862017-07-25 16:04:31 -0700646 "unityplugin/video_observer.cc",
647 "unityplugin/video_observer.h",
gyzhouad7cad82017-05-11 16:10:03 -0700648 ]
qiangchen42f96d52017-08-08 17:08:03 -0700649
650 if (is_android) {
651 sources += [
652 "unityplugin/classreferenceholder.cc",
653 "unityplugin/classreferenceholder.h",
654 "unityplugin/jni_onload.cc",
655 ]
656 }
657
gyzhouad7cad82017-05-11 16:10:03 -0700658 if (!build_with_chromium && is_clang) {
659 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
660 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
661 }
qiangchen42f96d52017-08-08 17:08:03 -0700662 if (is_win) {
663 cflags = [ "/wd4245" ]
664 configs += [
665 "//build/config/win:windowed",
666 ":peerconnection_client_warnings_config",
667 ]
668 }
gyzhouad7cad82017-05-11 16:10:03 -0700669 deps = [
jianjun.zhuc0247402017-07-11 06:20:45 -0700670 "../api:libjingle_peerconnection_test_api",
671 "../api:video_frame_api",
jianjun.zhuc0247402017-07-11 06:20:45 -0700672 "../media:rtc_media",
673 "../media:rtc_media_base",
674 "../modules/video_capture:video_capture_module",
675 "../pc:libjingle_peerconnection",
qiangchen42f96d52017-08-08 17:08:03 -0700676 "../rtc_base:rtc_base",
jianjun.zhuc0247402017-07-11 06:20:45 -0700677 "../system_wrappers:field_trial_default",
678 "../system_wrappers:metrics_default",
gyzhouad7cad82017-05-11 16:10:03 -0700679 ]
qiangchen42f96d52017-08-08 17:08:03 -0700680 if (is_android) {
681 deps += [ "../sdk/android:libjingle_peerconnection_jni" ]
682 }
683 }
684}
685
686if (is_android) {
687 android_library("webrtc_unity_java") {
688 java_files = [ "unityplugin/java/src/org/webrtc/UnityUtility.java" ]
689 deps = [
690 "../rtc_base:base_java",
691 "../sdk/android:libjingle_peerconnection_java",
692 ]
693 }
694
695 dist_jar("libwebrtc_unity") {
696 _target_dir_name = get_label_info(":$target_name", "dir")
697 output = "${root_out_dir}/lib.java${_target_dir_name}/${target_name}.jar"
698 direct_deps_only = true
699 use_interface_jars = false
Oleh Prypin86021d92017-09-24 22:29:06 +0200700 requires_android = true
qiangchen42f96d52017-08-08 17:08:03 -0700701 deps = [
702 ":webrtc_unity_java",
703 "../modules/audio_device:audio_device_java",
704 "../rtc_base:base_java",
705 "../sdk/android:libjingle_peerconnection_java",
706 "../sdk/android:libjingle_peerconnection_metrics_default_java",
707 ]
gyzhouad7cad82017-05-11 16:10:03 -0700708 }
709}
710
charujainaca3a242016-11-01 03:09:15 -0700711if (!build_with_chromium) {
712 # Doesn't build within Chrome on Win.
713 rtc_executable("stun_prober") {
kjellander1993b1d2017-03-06 00:29:21 -0800714 testonly = true
charujainaca3a242016-11-01 03:09:15 -0700715 sources = [
716 "stunprober/main.cc",
717 ]
718
719 if (!build_with_chromium && is_clang) {
720 # Suppress warnings from Chrome's Clang plugins.
721 # See http://code.google.com/p/webrtc/issues/detail?id=163 for details.
722 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
723 }
724
725 deps = [
726 "../p2p:libstunprober",
727 "../p2p:rtc_p2p",
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}