blob: 3d49bc3b99d72156e6ce5bc49a4aa4a37e78a0f4 [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 = [
jianjun.zhuc0247402017-07-11 06:20:45 -0700156 "../../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",
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200236 "objc/AppRTCMobile/ARDWebSocketChannel.h",
237 "objc/AppRTCMobile/ARDWebSocketChannel.m",
238 "objc/AppRTCMobile/RTCIceCandidate+JSON.h",
239 "objc/AppRTCMobile/RTCIceCandidate+JSON.m",
240 "objc/AppRTCMobile/RTCIceServer+JSON.h",
241 "objc/AppRTCMobile/RTCIceServer+JSON.m",
242 "objc/AppRTCMobile/RTCMediaConstraints+JSON.h",
243 "objc/AppRTCMobile/RTCMediaConstraints+JSON.m",
244 "objc/AppRTCMobile/RTCSessionDescription+JSON.h",
245 "objc/AppRTCMobile/RTCSessionDescription+JSON.m",
tkchin2ddfdba2016-08-07 21:37:45 -0700246 ]
ehmaldonadoe9cc6862016-09-05 06:10:18 -0700247 public_configs = [ ":apprtc_signaling_config" ]
tkchin2ddfdba2016-08-07 21:37:45 -0700248 deps = [
249 ":apprtc_common",
250 ":socketrocket",
251 ]
Kári Tristan Helgason946923a2017-06-02 14:05:56 +0200252 if (is_ios) {
253 deps += [ ":AppRTCMobile_ios_frameworks" ]
254 } else {
255 public_deps = [
kthelgason36d658d2017-08-24 05:43:45 -0700256 "../sdk:peerconnection_objc",
Kári Tristan Helgason946923a2017-06-02 14:05:56 +0200257 ]
258 }
tkchin2ddfdba2016-08-07 21:37:45 -0700259 libs = [ "QuartzCore.framework" ]
260 }
261
262 if (is_ios) {
denicija77bfd7c2016-11-15 00:41:26 -0800263 rtc_static_library("AppRTCMobile_lib") {
kjellander1993b1d2017-03-06 00:29:21 -0800264 testonly = true
tkchin2ddfdba2016-08-07 21:37:45 -0700265 sources = [
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200266 "objc/AppRTCMobile/ios/ARDAppDelegate.m",
267 "objc/AppRTCMobile/ios/ARDMainView.h",
268 "objc/AppRTCMobile/ios/ARDMainView.m",
269 "objc/AppRTCMobile/ios/ARDMainViewController.h",
270 "objc/AppRTCMobile/ios/ARDMainViewController.m",
denicijad17d5362016-11-02 02:56:09 -0700271 "objc/AppRTCMobile/ios/ARDSettingsViewController.h",
272 "objc/AppRTCMobile/ios/ARDSettingsViewController.m",
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200273 "objc/AppRTCMobile/ios/ARDStatsView.h",
274 "objc/AppRTCMobile/ios/ARDStatsView.m",
275 "objc/AppRTCMobile/ios/ARDVideoCallView.h",
276 "objc/AppRTCMobile/ios/ARDVideoCallView.m",
277 "objc/AppRTCMobile/ios/ARDVideoCallViewController.h",
278 "objc/AppRTCMobile/ios/ARDVideoCallViewController.m",
279 "objc/AppRTCMobile/ios/AppRTCMobile-Prefix.pch",
280 "objc/AppRTCMobile/ios/UIImage+ARDUtilities.h",
281 "objc/AppRTCMobile/ios/UIImage+ARDUtilities.m",
denicija77bfd7c2016-11-15 00:41:26 -0800282 ]
denicija77bfd7c2016-11-15 00:41:26 -0800283
284 deps = [
Kári Tristan Helgason946923a2017-06-02 14:05:56 +0200285 ":AppRTCMobile_ios_frameworks",
denicija77bfd7c2016-11-15 00:41:26 -0800286 ":apprtc_common",
287 ":apprtc_signaling",
288 ]
289 }
290
291 ios_app_bundle("AppRTCMobile") {
kjellander1993b1d2017-03-06 00:29:21 -0800292 testonly = true
denicija77bfd7c2016-11-15 00:41:26 -0800293 sources = [
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200294 "objc/AppRTCMobile/ios/main.m",
tkchin2ddfdba2016-08-07 21:37:45 -0700295 ]
296
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200297 info_plist = "objc/AppRTCMobile/ios/Info.plist"
tkchin2ddfdba2016-08-07 21:37:45 -0700298
denicija77bfd7c2016-11-15 00:41:26 -0800299 configs += [ "..:common_config" ]
tkchin2ddfdba2016-08-07 21:37:45 -0700300 public_configs = [ "..:common_inherited_config" ]
301
302 deps = [
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200303 ":AppRTCMobile_ios_bundle_data",
kthelgasond3adbfb2017-01-26 01:14:04 -0800304 ":AppRTCMobile_ios_frameworks",
denicija77bfd7c2016-11-15 00:41:26 -0800305 ":AppRTCMobile_lib",
tkchin2ddfdba2016-08-07 21:37:45 -0700306 ]
307
308 if (target_cpu == "x86") {
309 deps += [ "//testing/iossim:iossim" ]
310 }
311 }
312
kthelgasond3adbfb2017-01-26 01:14:04 -0800313 bundle_data("AppRTCMobile_ios_frameworks") {
314 public_deps = [
kthelgason36d658d2017-08-24 05:43:45 -0700315 "../sdk:framework_objc+link",
kthelgasond3adbfb2017-01-26 01:14:04 -0800316 ]
317 sources = [
318 "$root_out_dir/WebRTC.framework",
319 ]
320 outputs = [
321 "{{bundle_resources_dir}}/Frameworks/{{source_file_part}}",
322 ]
323 }
324
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200325 bundle_data("AppRTCMobile_ios_bundle_data") {
tkchin2ddfdba2016-08-07 21:37:45 -0700326 sources = [
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200327 "objc/AppRTCMobile/ios/resources/Roboto-Regular.ttf",
328 "objc/AppRTCMobile/ios/resources/iPhone5@2x.png",
329 "objc/AppRTCMobile/ios/resources/iPhone6@2x.png",
330 "objc/AppRTCMobile/ios/resources/iPhone6p@3x.png",
331 "objc/AppRTCMobile/ios/resources/ic_call_end_black_24dp.png",
332 "objc/AppRTCMobile/ios/resources/ic_call_end_black_24dp@2x.png",
333 "objc/AppRTCMobile/ios/resources/ic_clear_black_24dp.png",
334 "objc/AppRTCMobile/ios/resources/ic_clear_black_24dp@2x.png",
denicija6d6762c2016-10-28 04:53:16 -0700335 "objc/AppRTCMobile/ios/resources/ic_settings_black_24dp.png",
336 "objc/AppRTCMobile/ios/resources/ic_settings_black_24dp@2x.png",
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200337 "objc/AppRTCMobile/ios/resources/ic_surround_sound_black_24dp.png",
338 "objc/AppRTCMobile/ios/resources/ic_surround_sound_black_24dp@2x.png",
339 "objc/AppRTCMobile/ios/resources/ic_switch_video_black_24dp.png",
340 "objc/AppRTCMobile/ios/resources/ic_switch_video_black_24dp@2x.png",
341 "objc/AppRTCMobile/ios/resources/mozart.mp3",
anderscb5ed9052017-08-15 04:07:12 -0700342 "objc/Icon-120.png",
343 "objc/Icon-180.png",
tkchin2ddfdba2016-08-07 21:37:45 -0700344 "objc/Icon.png",
345 ]
346 outputs = [
347 "{{bundle_resources_dir}}/{{source_file_part}}",
348 ]
349 }
350 }
351
352 if (is_mac) {
denicija77bfd7c2016-11-15 00:41:26 -0800353 rtc_static_library("AppRTCMobile_lib") {
kjellander1993b1d2017-03-06 00:29:21 -0800354 testonly = true
tkchin2ddfdba2016-08-07 21:37:45 -0700355 sources = [
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200356 "objc/AppRTCMobile/mac/APPRTCAppDelegate.h",
357 "objc/AppRTCMobile/mac/APPRTCAppDelegate.m",
358 "objc/AppRTCMobile/mac/APPRTCViewController.h",
359 "objc/AppRTCMobile/mac/APPRTCViewController.m",
tkchin2ddfdba2016-08-07 21:37:45 -0700360 ]
jianjun.zhuc0247402017-07-11 06:20:45 -0700361 configs += [ "..:common_objc" ]
tkchin2ddfdba2016-08-07 21:37:45 -0700362 deps = [
363 ":apprtc_common",
364 ":apprtc_signaling",
kthelgason36d658d2017-08-24 05:43:45 -0700365 "../sdk:ui_objc",
tkchin2ddfdba2016-08-07 21:37:45 -0700366 ]
367 }
368
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200369 mac_app_bundle("AppRTCMobile") {
kjellander1993b1d2017-03-06 00:29:21 -0800370 testonly = true
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200371 output_name = "AppRTCMobile"
tkchin2ddfdba2016-08-07 21:37:45 -0700372
tkchin2ddfdba2016-08-07 21:37:45 -0700373 sources = [
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200374 "objc/AppRTCMobile/mac/main.m",
tkchin2ddfdba2016-08-07 21:37:45 -0700375 ]
376
377 public_configs = [ "..:common_inherited_config" ]
378
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200379 info_plist = "objc/AppRTCMobile/mac/Info.plist"
tkchin2ddfdba2016-08-07 21:37:45 -0700380
381 libs = [ "AppKit.framework" ]
382
383 deps = [
denicija77bfd7c2016-11-15 00:41:26 -0800384 ":AppRTCMobile_lib",
tkchin2ddfdba2016-08-07 21:37:45 -0700385 ]
386 }
387 }
388
389 config("socketrocket_include_config") {
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200390 include_dirs = [ "objc/AppRTCMobile/third_party/SocketRocket" ]
tkchin2ddfdba2016-08-07 21:37:45 -0700391 }
392
393 config("socketrocket_warning_config") {
394 # GN orders flags on a target before flags from configs. The default config
395 # adds these flags so to cancel them out they need to come from a config and
396 # cannot be on the target directly.
397 cflags = [
398 "-Wno-deprecated-declarations",
399 "-Wno-nonnull",
tkchin2ddfdba2016-08-07 21:37:45 -0700400 "-Wno-semicolon-before-method-body",
kthelgasone47de1a2017-02-24 01:56:01 -0800401 "-Wno-unused-variable",
tkchin2ddfdba2016-08-07 21:37:45 -0700402 ]
403
henrika27d8b612016-09-21 04:13:00 -0700404 cflags_objc = [
405 # Enabled for cflags_objc in build/config/compiler/BUILD.gn.
406 "-Wno-objc-missing-property-synthesis",
henrika27d8b612016-09-21 04:13:00 -0700407 ]
tkchin2ddfdba2016-08-07 21:37:45 -0700408 }
409
kjellanderb62dbbe2016-09-23 00:38:52 -0700410 rtc_static_library("socketrocket") {
kjellander1993b1d2017-03-06 00:29:21 -0800411 testonly = true
tkchin2ddfdba2016-08-07 21:37:45 -0700412 sources = [
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200413 "objc/AppRTCMobile/third_party/SocketRocket/SRWebSocket.h",
414 "objc/AppRTCMobile/third_party/SocketRocket/SRWebSocket.m",
tkchin2ddfdba2016-08-07 21:37:45 -0700415 ]
kthelgasonc0977102017-04-24 00:57:16 -0700416 configs += [ ":socketrocket_warning_config" ]
ehmaldonadoe9cc6862016-09-05 06:10:18 -0700417 public_configs = [ ":socketrocket_include_config" ]
tkchin2ddfdba2016-08-07 21:37:45 -0700418
419 libs = [
420 "CFNetwork.framework",
421 "icucore",
422 ]
423 }
adam.fedorbcc5d872016-11-07 14:53:28 -0800424
425 if (rtc_include_tests) {
kthelgason4065a572017-02-14 04:58:56 -0800426 # TODO(kthelgason): compile xctests on mac when chromium supports it.
427 if (is_ios) {
428 rtc_source_set("apprtcmobile_test_sources") {
kjellander1993b1d2017-03-06 00:29:21 -0800429 testonly = true
kthelgason4065a572017-02-14 04:58:56 -0800430 include_dirs = [
431 "objc/AppRTCMobile",
432 "objc/AppRTCMobile/ios",
433 ]
434 testonly = true
435 sources = [
436 "objc/AppRTCMobile/tests/ARDAppClient_xctest.mm",
437 "objc/AppRTCMobile/tests/ARDSDPUtils_xctest.mm",
438 "objc/AppRTCMobile/tests/ARDSettingsModel_xctest.mm",
439 ]
kjellander1993b1d2017-03-06 00:29:21 -0800440 deps = [
jianjun.zhuc0247402017-07-11 06:20:45 -0700441 "../rtc_base:rtc_base",
kjellander1993b1d2017-03-06 00:29:21 -0800442 ]
kthelgason4065a572017-02-14 04:58:56 -0800443 public_deps = [
444 ":AppRTCMobile_ios_frameworks",
445 ":AppRTCMobile_lib",
446 "//build/config/ios:xctest",
447 "//third_party/ocmock",
448 ]
adam.fedorbcc5d872016-11-07 14:53:28 -0800449 }
450
kthelgason4065a572017-02-14 04:58:56 -0800451 rtc_ios_xctest_test("apprtcmobile_tests") {
452 info_plist = "objc/AppRTCMobile/ios/Info.plist"
453 sources = [
454 "objc/AppRTCMobile/ios/main.m",
455 ]
456 deps = [
457 ":apprtcmobile_test_sources",
458 ]
459 ldflags = [ "-all_load" ]
460 }
adam.fedorbcc5d872016-11-07 14:53:28 -0800461 }
462 }
tkchin2ddfdba2016-08-07 21:37:45 -0700463}
kthelgason0727f152016-08-08 09:03:23 -0700464
465if (is_linux || is_win) {
ehmaldonadod02fe4b2016-08-26 13:31:24 -0700466 config("peerconnection_client_warnings_config") {
kjellander4a9abad2016-09-18 08:12:29 -0700467 cflags = []
ehmaldonadod02fe4b2016-08-26 13:31:24 -0700468 if (is_win && is_clang) {
kjellander4a9abad2016-09-18 08:12:29 -0700469 cflags += [
ehmaldonadod02fe4b2016-08-26 13:31:24 -0700470 # Disable warnings failing when compiling with Clang on Windows.
471 # https://bugs.chromium.org/p/webrtc/issues/detail?id=5366
472 "-Wno-format",
473
474 # See https://bugs.chromium.org/p/webrtc/issues/detail?id=6271
475 # for -Wno-reorder and -Wno-sign-compare
476 "-Wno-reorder",
477 "-Wno-sign-compare",
478 ]
479 }
kjellanderd4626e52016-09-07 02:33:01 -0700480 if (is_linux && target_cpu == "x86") {
kjellander4a9abad2016-09-18 08:12:29 -0700481 cflags += [
kjellanderd4626e52016-09-07 02:33:01 -0700482 # Needed to compile on Linux 32-bit.
483 "-Wno-sentinel",
484 ]
485 }
kjellander4a9abad2016-09-18 08:12:29 -0700486
487 if (is_clang) {
488 # TODO(ehmaldonado): Make peerconnection_client compile with the standard
489 # set of warnings.
490 # See https://bugs.chromium.org/p/webrtc/issues/detail?id=6306
491 cflags += [ "-Wno-inconsistent-missing-override" ]
492 }
ehmaldonadod02fe4b2016-08-26 13:31:24 -0700493 }
494
ehmaldonado38a21322016-09-02 04:10:34 -0700495 rtc_executable("peerconnection_client") {
kjellander1993b1d2017-03-06 00:29:21 -0800496 testonly = true
kthelgason0727f152016-08-08 09:03:23 -0700497 sources = [
498 "peerconnection/client/conductor.cc",
499 "peerconnection/client/conductor.h",
500 "peerconnection/client/defaults.cc",
501 "peerconnection/client/defaults.h",
502 "peerconnection/client/peer_connection_client.cc",
503 "peerconnection/client/peer_connection_client.h",
504 ]
ehmaldonado7a2ce0b2016-09-05 01:35:44 -0700505
kjellandere40a7ee2016-10-16 23:56:12 -0700506 if (!build_with_chromium && is_clang) {
507 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
ehmaldonado38a21322016-09-02 04:10:34 -0700508 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
kthelgason0727f152016-08-08 09:03:23 -0700509 }
kjellander1993b1d2017-03-06 00:29:21 -0800510 deps = []
kthelgason0727f152016-08-08 09:03:23 -0700511 if (is_win) {
512 sources += [
513 "peerconnection/client/flagdefs.h",
514 "peerconnection/client/main.cc",
515 "peerconnection/client/main_wnd.cc",
516 "peerconnection/client/main_wnd.h",
517 ]
518 cflags = [ "/wd4245" ]
519 configs += [ "//build/config/win:windowed" ]
jianjun.zhuc0247402017-07-11 06:20:45 -0700520 deps += [ "../media:rtc_media_base" ]
kthelgason0727f152016-08-08 09:03:23 -0700521 }
522 if (is_linux) {
523 sources += [
524 "peerconnection/client/linux/main.cc",
525 "peerconnection/client/linux/main_wnd.cc",
526 "peerconnection/client/linux/main_wnd.h",
527 ]
Henrik Kjellanderefbde2c2017-03-27 08:28:27 +0200528 cflags = [ "-Wno-deprecated-declarations" ]
kthelgason0727f152016-08-08 09:03:23 -0700529 libs = [
530 "X11",
531 "Xcomposite",
532 "Xext",
533 "Xrender",
534 ]
thomasandersonef16e992016-12-13 02:57:43 -0800535 deps += [ "//build/config/linux/gtk" ]
kthelgason0727f152016-08-08 09:03:23 -0700536 }
ehmaldonadod02fe4b2016-08-26 13:31:24 -0700537 configs += [ ":peerconnection_client_warnings_config" ]
kjellander1993b1d2017-03-06 00:29:21 -0800538
539 deps += [
jianjun.zhuc0247402017-07-11 06:20:45 -0700540 "../api:libjingle_peerconnection_test_api",
541 "../api:video_frame_api",
jianjun.zhuc0247402017-07-11 06:20:45 -0700542 "../media:rtc_media",
543 "../modules/video_capture:video_capture_module",
544 "../pc:libjingle_peerconnection",
ehmaldonadof6a861a2017-07-19 10:40:47 -0700545 "../rtc_base:rtc_base",
546 "../rtc_base:rtc_base_approved",
547 "../rtc_base:rtc_json",
jianjun.zhuc0247402017-07-11 06:20:45 -0700548 "../system_wrappers:field_trial_default",
549 "../system_wrappers:metrics_default",
kjellander1993b1d2017-03-06 00:29:21 -0800550 "//third_party/libyuv",
kjellander1993b1d2017-03-06 00:29:21 -0800551 ]
kthelgason0727f152016-08-08 09:03:23 -0700552 }
kjellanderd4626e52016-09-07 02:33:01 -0700553
ehmaldonado38a21322016-09-02 04:10:34 -0700554 rtc_executable("peerconnection_server") {
kjellander1993b1d2017-03-06 00:29:21 -0800555 testonly = true
kthelgason0727f152016-08-08 09:03:23 -0700556 sources = [
557 "peerconnection/server/data_socket.cc",
558 "peerconnection/server/data_socket.h",
559 "peerconnection/server/main.cc",
560 "peerconnection/server/peer_channel.cc",
561 "peerconnection/server/peer_channel.h",
562 "peerconnection/server/utils.cc",
563 "peerconnection/server/utils.h",
564 ]
565 deps = [
jianjun.zhuc0247402017-07-11 06:20:45 -0700566 "..:webrtc_common",
ehmaldonadof6a861a2017-07-19 10:40:47 -0700567 "../rtc_base:rtc_base_approved",
jianjun.zhuc0247402017-07-11 06:20:45 -0700568 "../rtc_tools:command_line_parser",
kthelgason0727f152016-08-08 09:03:23 -0700569 ]
kjellandere40a7ee2016-10-16 23:56:12 -0700570 if (!build_with_chromium && is_clang) {
571 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
ehmaldonado38a21322016-09-02 04:10:34 -0700572 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
kthelgason0727f152016-08-08 09:03:23 -0700573 }
574 }
ehmaldonado38a21322016-09-02 04:10:34 -0700575 rtc_executable("relayserver") {
kjellander1993b1d2017-03-06 00:29:21 -0800576 testonly = true
kthelgason0727f152016-08-08 09:03:23 -0700577 sources = [
578 "relayserver/relayserver_main.cc",
579 ]
580 deps = [
jianjun.zhuc0247402017-07-11 06:20:45 -0700581 "../p2p:rtc_p2p",
582 "../pc:rtc_pc",
ehmaldonadof6a861a2017-07-19 10:40:47 -0700583 "../rtc_base:rtc_base",
584 "../rtc_base:rtc_base_approved",
jianjun.zhuc0247402017-07-11 06:20:45 -0700585 "../system_wrappers:field_trial_default",
586 "../system_wrappers:metrics_default",
kthelgason0727f152016-08-08 09:03:23 -0700587 ]
kjellandere40a7ee2016-10-16 23:56:12 -0700588 if (!build_with_chromium && is_clang) {
589 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
ehmaldonado38a21322016-09-02 04:10:34 -0700590 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
kthelgason0727f152016-08-08 09:03:23 -0700591 }
592 }
ehmaldonado38a21322016-09-02 04:10:34 -0700593 rtc_executable("turnserver") {
kjellander1993b1d2017-03-06 00:29:21 -0800594 testonly = true
kthelgason0727f152016-08-08 09:03:23 -0700595 sources = [
596 "turnserver/turnserver_main.cc",
597 ]
598 deps = [
jianjun.zhuc0247402017-07-11 06:20:45 -0700599 "../p2p:rtc_p2p",
600 "../pc:rtc_pc",
ehmaldonadof6a861a2017-07-19 10:40:47 -0700601 "../rtc_base:rtc_base",
602 "../rtc_base:rtc_base_approved",
jianjun.zhuc0247402017-07-11 06:20:45 -0700603 "../system_wrappers:field_trial_default",
604 "../system_wrappers:metrics_default",
kthelgason0727f152016-08-08 09:03:23 -0700605 ]
kjellandere40a7ee2016-10-16 23:56:12 -0700606 if (!build_with_chromium && is_clang) {
607 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
ehmaldonado38a21322016-09-02 04:10:34 -0700608 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
kthelgason0727f152016-08-08 09:03:23 -0700609 }
610 }
ehmaldonado38a21322016-09-02 04:10:34 -0700611 rtc_executable("stunserver") {
kjellander1993b1d2017-03-06 00:29:21 -0800612 testonly = true
kthelgason0727f152016-08-08 09:03:23 -0700613 sources = [
614 "stunserver/stunserver_main.cc",
615 ]
616 deps = [
jianjun.zhuc0247402017-07-11 06:20:45 -0700617 "../p2p:rtc_p2p",
618 "../pc:rtc_pc",
ehmaldonadof6a861a2017-07-19 10:40:47 -0700619 "../rtc_base:rtc_base",
620 "../rtc_base:rtc_base_approved",
jianjun.zhuc0247402017-07-11 06:20:45 -0700621 "../system_wrappers:field_trial_default",
622 "../system_wrappers:metrics_default",
kthelgason0727f152016-08-08 09:03:23 -0700623 ]
kjellandere40a7ee2016-10-16 23:56:12 -0700624 if (!build_with_chromium && is_clang) {
625 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
ehmaldonado38a21322016-09-02 04:10:34 -0700626 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
kthelgason0727f152016-08-08 09:03:23 -0700627 }
628 }
629}
charujainaca3a242016-11-01 03:09:15 -0700630
qiangchen42f96d52017-08-08 17:08:03 -0700631if (is_win || is_android) {
gyzhouad7cad82017-05-11 16:10:03 -0700632 rtc_shared_library("webrtc_unity_plugin") {
633 testonly = true
634 sources = [
635 "unityplugin/simple_peer_connection.cc",
636 "unityplugin/simple_peer_connection.h",
637 "unityplugin/unity_plugin_apis.cc",
638 "unityplugin/unity_plugin_apis.h",
gyzhoub38f3862017-07-25 16:04:31 -0700639 "unityplugin/video_observer.cc",
640 "unityplugin/video_observer.h",
gyzhouad7cad82017-05-11 16:10:03 -0700641 ]
qiangchen42f96d52017-08-08 17:08:03 -0700642
643 if (is_android) {
644 sources += [
645 "unityplugin/classreferenceholder.cc",
646 "unityplugin/classreferenceholder.h",
647 "unityplugin/jni_onload.cc",
648 ]
649 }
650
gyzhouad7cad82017-05-11 16:10:03 -0700651 if (!build_with_chromium && is_clang) {
652 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
653 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
654 }
qiangchen42f96d52017-08-08 17:08:03 -0700655 if (is_win) {
656 cflags = [ "/wd4245" ]
657 configs += [
658 "//build/config/win:windowed",
659 ":peerconnection_client_warnings_config",
660 ]
661 }
gyzhouad7cad82017-05-11 16:10:03 -0700662 deps = [
jianjun.zhuc0247402017-07-11 06:20:45 -0700663 "../api:libjingle_peerconnection_test_api",
664 "../api:video_frame_api",
jianjun.zhuc0247402017-07-11 06:20:45 -0700665 "../media:rtc_media",
666 "../media:rtc_media_base",
667 "../modules/video_capture:video_capture_module",
668 "../pc:libjingle_peerconnection",
qiangchen42f96d52017-08-08 17:08:03 -0700669 "../rtc_base:rtc_base",
jianjun.zhuc0247402017-07-11 06:20:45 -0700670 "../system_wrappers:field_trial_default",
671 "../system_wrappers:metrics_default",
gyzhouad7cad82017-05-11 16:10:03 -0700672 ]
qiangchen42f96d52017-08-08 17:08:03 -0700673 if (is_android) {
674 deps += [ "../sdk/android:libjingle_peerconnection_jni" ]
675 }
676 }
677}
678
679if (is_android) {
680 android_library("webrtc_unity_java") {
681 java_files = [ "unityplugin/java/src/org/webrtc/UnityUtility.java" ]
682 deps = [
683 "../rtc_base:base_java",
684 "../sdk/android:libjingle_peerconnection_java",
685 ]
686 }
687
688 dist_jar("libwebrtc_unity") {
689 _target_dir_name = get_label_info(":$target_name", "dir")
690 output = "${root_out_dir}/lib.java${_target_dir_name}/${target_name}.jar"
691 direct_deps_only = true
692 use_interface_jars = false
693 deps = [
694 ":webrtc_unity_java",
695 "../modules/audio_device:audio_device_java",
696 "../rtc_base:base_java",
697 "../sdk/android:libjingle_peerconnection_java",
698 "../sdk/android:libjingle_peerconnection_metrics_default_java",
699 ]
gyzhouad7cad82017-05-11 16:10:03 -0700700 }
701}
702
charujainaca3a242016-11-01 03:09:15 -0700703if (!build_with_chromium) {
704 # Doesn't build within Chrome on Win.
705 rtc_executable("stun_prober") {
kjellander1993b1d2017-03-06 00:29:21 -0800706 testonly = true
charujainaca3a242016-11-01 03:09:15 -0700707 sources = [
708 "stunprober/main.cc",
709 ]
710
711 if (!build_with_chromium && is_clang) {
712 # Suppress warnings from Chrome's Clang plugins.
713 # See http://code.google.com/p/webrtc/issues/detail?id=163 for details.
714 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
715 }
716
717 deps = [
718 "../p2p:libstunprober",
719 "../p2p:rtc_p2p",
ehmaldonadof6a861a2017-07-19 10:40:47 -0700720 "../rtc_base:rtc_base",
721 "../rtc_base:rtc_base_approved",
charujainaca3a242016-11-01 03:09:15 -0700722 "../system_wrappers:field_trial_default",
723 ]
724 }
725}