blob: 70d3600ceaa3d05b3767b978dcfe9ba6fc888d0a [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) {
Mirko Bonadeifbb3b7d2017-11-07 15:36:33 +000052 rtc_android_apk("AppRTCMobile") {
kjellander1993b1d2017-03-06 00:29:21 -080053 testonly = true
Magnus Jedvertc1815cf2016-09-27 10:10:41 +020054 apk_name = "AppRTCMobile"
Sami Kalliomaki9c0c75b2016-06-29 14:55:00 +020055 android_manifest = "androidapp/AndroidManifest.xml"
56
57 deps = [
Magnus Jedvertc1815cf2016-09-27 10:10:41 +020058 ":AppRTCMobile_javalib",
59 ":AppRTCMobile_resources",
jianjun.zhuc0247402017-07-11 06:20:45 -070060 "../rtc_base:base_java",
Sami Kalliomaki9c0c75b2016-06-29 14:55:00 +020061 "//base:base_java",
Sami Kalliomaki9c0c75b2016-06-29 14:55:00 +020062 ]
63
jianjun.zhuc0247402017-07-11 06:20:45 -070064 shared_libraries = [ "../sdk/android:libjingle_peerconnection_so" ]
Sami Kalliomaki9c0c75b2016-06-29 14:55:00 +020065 }
66
Mirko Bonadeifbb3b7d2017-11-07 15:36:33 +000067 rtc_android_library("AppRTCMobile_javalib") {
kjellander1993b1d2017-03-06 00:29:21 -080068 testonly = true
sakal07a050f2017-02-13 05:58:27 -080069 android_manifest = "androidapp/AndroidManifest.xml"
70
Sami Kalliomaki9c0c75b2016-06-29 14:55:00 +020071 java_files = [
72 "androidapp/src/org/appspot/apprtc/AppRTCAudioManager.java",
henrikac3c2f312016-12-14 07:36:56 -080073 "androidapp/src/org/appspot/apprtc/AppRTCBluetoothManager.java",
Sami Kalliomaki9c0c75b2016-06-29 14:55:00 +020074 "androidapp/src/org/appspot/apprtc/AppRTCClient.java",
75 "androidapp/src/org/appspot/apprtc/AppRTCProximitySensor.java",
76 "androidapp/src/org/appspot/apprtc/CallActivity.java",
77 "androidapp/src/org/appspot/apprtc/CallFragment.java",
78 "androidapp/src/org/appspot/apprtc/CaptureQualityController.java",
79 "androidapp/src/org/appspot/apprtc/ConnectActivity.java",
80 "androidapp/src/org/appspot/apprtc/CpuMonitor.java",
81 "androidapp/src/org/appspot/apprtc/DirectRTCClient.java",
82 "androidapp/src/org/appspot/apprtc/HudFragment.java",
83 "androidapp/src/org/appspot/apprtc/PeerConnectionClient.java",
Sami Kalliomaki9c0c75b2016-06-29 14:55:00 +020084 "androidapp/src/org/appspot/apprtc/RoomParametersFetcher.java",
85 "androidapp/src/org/appspot/apprtc/SettingsActivity.java",
86 "androidapp/src/org/appspot/apprtc/SettingsFragment.java",
87 "androidapp/src/org/appspot/apprtc/TCPChannelClient.java",
88 "androidapp/src/org/appspot/apprtc/UnhandledExceptionHandler.java",
89 "androidapp/src/org/appspot/apprtc/WebSocketChannelClient.java",
90 "androidapp/src/org/appspot/apprtc/WebSocketRTCClient.java",
91 "androidapp/src/org/appspot/apprtc/util/AppRTCUtils.java",
92 "androidapp/src/org/appspot/apprtc/util/AsyncHttpURLConnection.java",
Sami Kalliomaki9c0c75b2016-06-29 14:55:00 +020093 ]
94
95 deps = [
Magnus Jedvertc1815cf2016-09-27 10:10:41 +020096 ":AppRTCMobile_resources",
jianjun.zhuc0247402017-07-11 06:20:45 -070097 "../modules/audio_device:audio_device_java",
98 "../rtc_base:base_java",
99 "../sdk/android:libjingle_peerconnection_java",
100 "../sdk/android:libjingle_peerconnection_metrics_default_java",
101 "androidapp/third_party/autobanh:autobanh_java",
Sami Kalliomaki9c0c75b2016-06-29 14:55:00 +0200102 ]
103 }
104
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200105 android_resources("AppRTCMobile_resources") {
kjellander1993b1d2017-03-06 00:29:21 -0800106 testonly = true
Sami Kalliomaki9c0c75b2016-06-29 14:55:00 +0200107 resource_dirs = [ "androidapp/res" ]
108 custom_package = "org.appspot.apprtc"
109 }
110
Mirko Bonadeifbb3b7d2017-11-07 15:36:33 +0000111 rtc_instrumentation_test_apk("AppRTCMobileTest") {
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200112 apk_name = "AppRTCMobileTest"
Sami Kalliomaki9c0c75b2016-06-29 14:55:00 +0200113 android_manifest = "androidtests/AndroidManifest.xml"
114
sakale8aca242017-01-17 03:32:06 -0800115 java_files = [ "androidtests/src/org/appspot/apprtc/test/PeerConnectionClientTest.java" ]
Sami Kalliomaki9c0c75b2016-06-29 14:55:00 +0200116
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200117 apk_under_test = ":AppRTCMobile"
Sami Kalliomaki9c0c75b2016-06-29 14:55:00 +0200118
119 deps = [
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200120 ":AppRTCMobile_javalib",
jianjun.zhuc0247402017-07-11 06:20:45 -0700121 "../sdk/android:libjingle_peerconnection_java",
sakalcb79d512017-01-11 06:21:26 -0800122 "//third_party/android_support_test_runner:runner_java",
123 "//third_party/junit",
Sami Kalliomaki9c0c75b2016-06-29 14:55:00 +0200124 ]
125 }
mandermoa6069e82017-01-16 02:23:09 -0800126
Mirko Bonadeifbb3b7d2017-11-07 15:36:33 +0000127 rtc_instrumentation_test_apk("AppRTCMobileTestStubbedVideoIO") {
mandermoa6069e82017-01-16 02:23:09 -0800128 apk_name = "AppRTCMobileTestStubbedVideoIO"
129 android_manifest = "androidtests/AndroidManifest.xml"
130
oprypin30cda5e2017-04-24 04:15:13 -0700131 java_files = [ "androidtests/src/org/appspot/apprtc/test/CallActivityStubbedInputOutputTest.java" ]
mandermoa6069e82017-01-16 02:23:09 -0800132
133 apk_under_test = ":AppRTCMobile"
134
135 deps = [
136 ":AppRTCMobile_javalib",
jianjun.zhuc0247402017-07-11 06:20:45 -0700137 "../sdk/android:libjingle_peerconnection_java",
mandermoa6069e82017-01-16 02:23:09 -0800138 "//third_party/android_support_test_runner:rules_java",
139 "//third_party/android_support_test_runner:runner_java",
140 "//third_party/espresso:espresso_all_java",
141 "//third_party/hamcrest:hamcrest_java",
142 "//third_party/junit",
mandermoa6069e82017-01-16 02:23:09 -0800143 ]
144
145 data = [
Mirko Bonadei92ea95e2017-09-15 06:47:31 +0200146 "../resources/reference_video_640x360_30fps.y4m",
mandermoa6069e82017-01-16 02:23:09 -0800147 ]
148 }
Sami Kalliomaki9c0c75b2016-06-29 14:55:00 +0200149}
tkchin2ddfdba2016-08-07 21:37:45 -0700150
151if (is_ios || (is_mac && target_cpu != "x86")) {
tkchin2ddfdba2016-08-07 21:37:45 -0700152 config("apprtc_common_config") {
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200153 include_dirs = [ "objc/AppRTCMobile/common" ]
tkchin2ddfdba2016-08-07 21:37:45 -0700154 }
155
kjellanderb62dbbe2016-09-23 00:38:52 -0700156 rtc_static_library("apprtc_common") {
kjellander1993b1d2017-03-06 00:29:21 -0800157 testonly = true
tkchin2ddfdba2016-08-07 21:37:45 -0700158 sources = [
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200159 "objc/AppRTCMobile/common/ARDUtilities.h",
160 "objc/AppRTCMobile/common/ARDUtilities.m",
tkchin2ddfdba2016-08-07 21:37:45 -0700161 ]
ehmaldonadoe9cc6862016-09-05 06:10:18 -0700162 public_configs = [ ":apprtc_common_config" ]
tkchin2ddfdba2016-08-07 21:37:45 -0700163
Kári Tristan Helgason946923a2017-06-02 14:05:56 +0200164 if (is_ios) {
kthelgason5901d9d2017-08-16 07:28:03 -0700165 deps = [
166 ":AppRTCMobile_ios_frameworks",
167 ]
Kári Tristan Helgason946923a2017-06-02 14:05:56 +0200168 } else {
kthelgason5901d9d2017-08-16 07:28:03 -0700169 deps = [
kthelgason36d658d2017-08-24 05:43:45 -0700170 "../sdk:common_objc",
kthelgason5901d9d2017-08-16 07:28:03 -0700171 "../system_wrappers:field_trial_default",
172 "../system_wrappers:metrics_default",
173 ]
Kári Tristan Helgason946923a2017-06-02 14:05:56 +0200174 }
tkchin2ddfdba2016-08-07 21:37:45 -0700175 }
176
177 config("apprtc_signaling_config") {
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200178 include_dirs = [ "objc/AppRTCMobile" ]
tkchin2ddfdba2016-08-07 21:37:45 -0700179
180 # GN orders flags on a target before flags from configs. The default config
181 # adds these flags so to cancel them out they need to come from a config and
182 # cannot be on the target directly.
183 cflags = [
184 "-Wno-sign-compare",
185 "-Wno-unused-variable",
186 ]
tkchin2ddfdba2016-08-07 21:37:45 -0700187 }
188
kjellanderb62dbbe2016-09-23 00:38:52 -0700189 rtc_static_library("apprtc_signaling") {
kjellander1993b1d2017-03-06 00:29:21 -0800190 testonly = true
tkchin2ddfdba2016-08-07 21:37:45 -0700191 sources = [
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200192 "objc/AppRTCMobile/ARDAppClient+Internal.h",
193 "objc/AppRTCMobile/ARDAppClient.h",
194 "objc/AppRTCMobile/ARDAppClient.m",
195 "objc/AppRTCMobile/ARDAppEngineClient.h",
196 "objc/AppRTCMobile/ARDAppEngineClient.m",
197 "objc/AppRTCMobile/ARDBitrateTracker.h",
198 "objc/AppRTCMobile/ARDBitrateTracker.m",
sakalc522e752017-04-05 12:17:48 -0700199 "objc/AppRTCMobile/ARDCaptureController.h",
200 "objc/AppRTCMobile/ARDCaptureController.m",
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200201 "objc/AppRTCMobile/ARDJoinResponse+Internal.h",
202 "objc/AppRTCMobile/ARDJoinResponse.h",
203 "objc/AppRTCMobile/ARDJoinResponse.m",
204 "objc/AppRTCMobile/ARDMessageResponse+Internal.h",
205 "objc/AppRTCMobile/ARDMessageResponse.h",
206 "objc/AppRTCMobile/ARDMessageResponse.m",
207 "objc/AppRTCMobile/ARDRoomServerClient.h",
sakalc4adacf2017-03-28 01:22:48 -0700208 "objc/AppRTCMobile/ARDSettingsModel+Private.h",
209 "objc/AppRTCMobile/ARDSettingsModel.h",
210 "objc/AppRTCMobile/ARDSettingsModel.m",
211 "objc/AppRTCMobile/ARDSettingsStore.h",
212 "objc/AppRTCMobile/ARDSettingsStore.m",
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200213 "objc/AppRTCMobile/ARDSignalingChannel.h",
214 "objc/AppRTCMobile/ARDSignalingMessage.h",
215 "objc/AppRTCMobile/ARDSignalingMessage.m",
216 "objc/AppRTCMobile/ARDStatsBuilder.h",
217 "objc/AppRTCMobile/ARDStatsBuilder.m",
kthelgasoncc882af2017-01-13 05:59:46 -0800218 "objc/AppRTCMobile/ARDTURNClient+Internal.h",
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200219 "objc/AppRTCMobile/ARDTURNClient.h",
kthelgasoncc882af2017-01-13 05:59:46 -0800220 "objc/AppRTCMobile/ARDTURNClient.m",
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200221 "objc/AppRTCMobile/ARDWebSocketChannel.h",
222 "objc/AppRTCMobile/ARDWebSocketChannel.m",
223 "objc/AppRTCMobile/RTCIceCandidate+JSON.h",
224 "objc/AppRTCMobile/RTCIceCandidate+JSON.m",
225 "objc/AppRTCMobile/RTCIceServer+JSON.h",
226 "objc/AppRTCMobile/RTCIceServer+JSON.m",
227 "objc/AppRTCMobile/RTCMediaConstraints+JSON.h",
228 "objc/AppRTCMobile/RTCMediaConstraints+JSON.m",
229 "objc/AppRTCMobile/RTCSessionDescription+JSON.h",
230 "objc/AppRTCMobile/RTCSessionDescription+JSON.m",
tkchin2ddfdba2016-08-07 21:37:45 -0700231 ]
ehmaldonadoe9cc6862016-09-05 06:10:18 -0700232 public_configs = [ ":apprtc_signaling_config" ]
tkchin2ddfdba2016-08-07 21:37:45 -0700233 deps = [
234 ":apprtc_common",
235 ":socketrocket",
236 ]
Kári Tristan Helgason946923a2017-06-02 14:05:56 +0200237 if (is_ios) {
238 deps += [ ":AppRTCMobile_ios_frameworks" ]
239 } else {
240 public_deps = [
kthelgason36d658d2017-08-24 05:43:45 -0700241 "../sdk:peerconnection_objc",
Kári Tristan Helgason946923a2017-06-02 14:05:56 +0200242 ]
243 }
tkchin2ddfdba2016-08-07 21:37:45 -0700244 libs = [ "QuartzCore.framework" ]
245 }
246
247 if (is_ios) {
denicija77bfd7c2016-11-15 00:41:26 -0800248 rtc_static_library("AppRTCMobile_lib") {
kjellander1993b1d2017-03-06 00:29:21 -0800249 testonly = true
tkchin2ddfdba2016-08-07 21:37:45 -0700250 sources = [
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200251 "objc/AppRTCMobile/ios/ARDAppDelegate.m",
Daniela012b56b2017-11-15 13:15:24 +0100252 "objc/AppRTCMobile/ios/ARDFileCaptureController.h",
253 "objc/AppRTCMobile/ios/ARDFileCaptureController.m",
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200254 "objc/AppRTCMobile/ios/ARDMainView.h",
255 "objc/AppRTCMobile/ios/ARDMainView.m",
256 "objc/AppRTCMobile/ios/ARDMainViewController.h",
257 "objc/AppRTCMobile/ios/ARDMainViewController.m",
denicijad17d5362016-11-02 02:56:09 -0700258 "objc/AppRTCMobile/ios/ARDSettingsViewController.h",
259 "objc/AppRTCMobile/ios/ARDSettingsViewController.m",
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200260 "objc/AppRTCMobile/ios/ARDStatsView.h",
261 "objc/AppRTCMobile/ios/ARDStatsView.m",
262 "objc/AppRTCMobile/ios/ARDVideoCallView.h",
263 "objc/AppRTCMobile/ios/ARDVideoCallView.m",
264 "objc/AppRTCMobile/ios/ARDVideoCallViewController.h",
265 "objc/AppRTCMobile/ios/ARDVideoCallViewController.m",
Anders Carlsson6bf43d22017-10-16 13:51:43 +0200266 "objc/AppRTCMobile/ios/RTCVideoCodecInfo+HumanReadable.h",
267 "objc/AppRTCMobile/ios/RTCVideoCodecInfo+HumanReadable.m",
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200268 "objc/AppRTCMobile/ios/UIImage+ARDUtilities.h",
269 "objc/AppRTCMobile/ios/UIImage+ARDUtilities.m",
denicija77bfd7c2016-11-15 00:41:26 -0800270 ]
denicija77bfd7c2016-11-15 00:41:26 -0800271
272 deps = [
Kári Tristan Helgason946923a2017-06-02 14:05:56 +0200273 ":AppRTCMobile_ios_frameworks",
denicija77bfd7c2016-11-15 00:41:26 -0800274 ":apprtc_common",
275 ":apprtc_signaling",
276 ]
277 }
278
279 ios_app_bundle("AppRTCMobile") {
kjellander1993b1d2017-03-06 00:29:21 -0800280 testonly = true
denicija77bfd7c2016-11-15 00:41:26 -0800281 sources = [
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200282 "objc/AppRTCMobile/ios/main.m",
tkchin2ddfdba2016-08-07 21:37:45 -0700283 ]
284
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200285 info_plist = "objc/AppRTCMobile/ios/Info.plist"
tkchin2ddfdba2016-08-07 21:37:45 -0700286
denicija77bfd7c2016-11-15 00:41:26 -0800287 configs += [ "..:common_config" ]
tkchin2ddfdba2016-08-07 21:37:45 -0700288 public_configs = [ "..:common_inherited_config" ]
289
290 deps = [
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200291 ":AppRTCMobile_ios_bundle_data",
kthelgasond3adbfb2017-01-26 01:14:04 -0800292 ":AppRTCMobile_ios_frameworks",
denicija77bfd7c2016-11-15 00:41:26 -0800293 ":AppRTCMobile_lib",
tkchin2ddfdba2016-08-07 21:37:45 -0700294 ]
295
296 if (target_cpu == "x86") {
297 deps += [ "//testing/iossim:iossim" ]
298 }
299 }
300
kthelgasond3adbfb2017-01-26 01:14:04 -0800301 bundle_data("AppRTCMobile_ios_frameworks") {
302 public_deps = [
kthelgason36d658d2017-08-24 05:43:45 -0700303 "../sdk:framework_objc+link",
kthelgasond3adbfb2017-01-26 01:14:04 -0800304 ]
305 sources = [
wjywbsbef8a5d2017-10-09 02:32:28 -0400306 "$root_build_dir/WebRTC.framework",
kthelgasond3adbfb2017-01-26 01:14:04 -0800307 ]
308 outputs = [
309 "{{bundle_resources_dir}}/Frameworks/{{source_file_part}}",
310 ]
311 }
312
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200313 bundle_data("AppRTCMobile_ios_bundle_data") {
tkchin2ddfdba2016-08-07 21:37:45 -0700314 sources = [
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200315 "objc/AppRTCMobile/ios/resources/Roboto-Regular.ttf",
Daniela012b56b2017-11-15 13:15:24 +0100316
317 # Sample video taken from https://media.xiph.org/video/derf/
318 "objc/AppRTCMobile/ios/resources/foreman.mp4",
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200319 "objc/AppRTCMobile/ios/resources/iPhone5@2x.png",
320 "objc/AppRTCMobile/ios/resources/iPhone6@2x.png",
321 "objc/AppRTCMobile/ios/resources/iPhone6p@3x.png",
322 "objc/AppRTCMobile/ios/resources/ic_call_end_black_24dp.png",
323 "objc/AppRTCMobile/ios/resources/ic_call_end_black_24dp@2x.png",
324 "objc/AppRTCMobile/ios/resources/ic_clear_black_24dp.png",
325 "objc/AppRTCMobile/ios/resources/ic_clear_black_24dp@2x.png",
denicija6d6762c2016-10-28 04:53:16 -0700326 "objc/AppRTCMobile/ios/resources/ic_settings_black_24dp.png",
327 "objc/AppRTCMobile/ios/resources/ic_settings_black_24dp@2x.png",
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200328 "objc/AppRTCMobile/ios/resources/ic_surround_sound_black_24dp.png",
329 "objc/AppRTCMobile/ios/resources/ic_surround_sound_black_24dp@2x.png",
330 "objc/AppRTCMobile/ios/resources/ic_switch_video_black_24dp.png",
331 "objc/AppRTCMobile/ios/resources/ic_switch_video_black_24dp@2x.png",
332 "objc/AppRTCMobile/ios/resources/mozart.mp3",
anderscb5ed9052017-08-15 04:07:12 -0700333 "objc/Icon-120.png",
334 "objc/Icon-180.png",
tkchin2ddfdba2016-08-07 21:37:45 -0700335 "objc/Icon.png",
336 ]
337 outputs = [
338 "{{bundle_resources_dir}}/{{source_file_part}}",
339 ]
340 }
341 }
342
343 if (is_mac) {
denicija77bfd7c2016-11-15 00:41:26 -0800344 rtc_static_library("AppRTCMobile_lib") {
kjellander1993b1d2017-03-06 00:29:21 -0800345 testonly = true
tkchin2ddfdba2016-08-07 21:37:45 -0700346 sources = [
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200347 "objc/AppRTCMobile/mac/APPRTCAppDelegate.h",
348 "objc/AppRTCMobile/mac/APPRTCAppDelegate.m",
349 "objc/AppRTCMobile/mac/APPRTCViewController.h",
350 "objc/AppRTCMobile/mac/APPRTCViewController.m",
tkchin2ddfdba2016-08-07 21:37:45 -0700351 ]
jianjun.zhuc0247402017-07-11 06:20:45 -0700352 configs += [ "..:common_objc" ]
tkchin2ddfdba2016-08-07 21:37:45 -0700353 deps = [
354 ":apprtc_common",
355 ":apprtc_signaling",
kthelgason36d658d2017-08-24 05:43:45 -0700356 "../sdk:ui_objc",
tkchin2ddfdba2016-08-07 21:37:45 -0700357 ]
358 }
359
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200360 mac_app_bundle("AppRTCMobile") {
kjellander1993b1d2017-03-06 00:29:21 -0800361 testonly = true
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200362 output_name = "AppRTCMobile"
tkchin2ddfdba2016-08-07 21:37:45 -0700363
tkchin2ddfdba2016-08-07 21:37:45 -0700364 sources = [
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200365 "objc/AppRTCMobile/mac/main.m",
tkchin2ddfdba2016-08-07 21:37:45 -0700366 ]
367
368 public_configs = [ "..:common_inherited_config" ]
369
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200370 info_plist = "objc/AppRTCMobile/mac/Info.plist"
tkchin2ddfdba2016-08-07 21:37:45 -0700371
372 libs = [ "AppKit.framework" ]
373
374 deps = [
denicija77bfd7c2016-11-15 00:41:26 -0800375 ":AppRTCMobile_lib",
tkchin2ddfdba2016-08-07 21:37:45 -0700376 ]
377 }
378 }
379
380 config("socketrocket_include_config") {
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200381 include_dirs = [ "objc/AppRTCMobile/third_party/SocketRocket" ]
tkchin2ddfdba2016-08-07 21:37:45 -0700382 }
383
384 config("socketrocket_warning_config") {
385 # GN orders flags on a target before flags from configs. The default config
386 # adds these flags so to cancel them out they need to come from a config and
387 # cannot be on the target directly.
388 cflags = [
389 "-Wno-deprecated-declarations",
390 "-Wno-nonnull",
tkchin2ddfdba2016-08-07 21:37:45 -0700391 "-Wno-semicolon-before-method-body",
kthelgasone47de1a2017-02-24 01:56:01 -0800392 "-Wno-unused-variable",
tkchin2ddfdba2016-08-07 21:37:45 -0700393 ]
394
henrika27d8b612016-09-21 04:13:00 -0700395 cflags_objc = [
396 # Enabled for cflags_objc in build/config/compiler/BUILD.gn.
397 "-Wno-objc-missing-property-synthesis",
henrika27d8b612016-09-21 04:13:00 -0700398 ]
tkchin2ddfdba2016-08-07 21:37:45 -0700399 }
400
kjellanderb62dbbe2016-09-23 00:38:52 -0700401 rtc_static_library("socketrocket") {
kjellander1993b1d2017-03-06 00:29:21 -0800402 testonly = true
tkchin2ddfdba2016-08-07 21:37:45 -0700403 sources = [
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200404 "objc/AppRTCMobile/third_party/SocketRocket/SRWebSocket.h",
405 "objc/AppRTCMobile/third_party/SocketRocket/SRWebSocket.m",
tkchin2ddfdba2016-08-07 21:37:45 -0700406 ]
kthelgasonc0977102017-04-24 00:57:16 -0700407 configs += [ ":socketrocket_warning_config" ]
ehmaldonadoe9cc6862016-09-05 06:10:18 -0700408 public_configs = [ ":socketrocket_include_config" ]
tkchin2ddfdba2016-08-07 21:37:45 -0700409
410 libs = [
411 "CFNetwork.framework",
412 "icucore",
413 ]
414 }
adam.fedorbcc5d872016-11-07 14:53:28 -0800415
416 if (rtc_include_tests) {
kthelgason4065a572017-02-14 04:58:56 -0800417 # TODO(kthelgason): compile xctests on mac when chromium supports it.
418 if (is_ios) {
419 rtc_source_set("apprtcmobile_test_sources") {
kjellander1993b1d2017-03-06 00:29:21 -0800420 testonly = true
kthelgason4065a572017-02-14 04:58:56 -0800421 include_dirs = [
422 "objc/AppRTCMobile",
423 "objc/AppRTCMobile/ios",
424 ]
425 testonly = true
426 sources = [
427 "objc/AppRTCMobile/tests/ARDAppClient_xctest.mm",
Daniela012b56b2017-11-15 13:15:24 +0100428 "objc/AppRTCMobile/tests/ARDFileCaptureController_xctest.mm",
kthelgason4065a572017-02-14 04:58:56 -0800429 "objc/AppRTCMobile/tests/ARDSettingsModel_xctest.mm",
430 ]
kjellander1993b1d2017-03-06 00:29:21 -0800431 deps = [
jianjun.zhuc0247402017-07-11 06:20:45 -0700432 "../rtc_base:rtc_base",
kjellander1993b1d2017-03-06 00:29:21 -0800433 ]
kthelgason4065a572017-02-14 04:58:56 -0800434 public_deps = [
435 ":AppRTCMobile_ios_frameworks",
436 ":AppRTCMobile_lib",
437 "//build/config/ios:xctest",
438 "//third_party/ocmock",
439 ]
adam.fedorbcc5d872016-11-07 14:53:28 -0800440 }
441
kthelgason4065a572017-02-14 04:58:56 -0800442 rtc_ios_xctest_test("apprtcmobile_tests") {
443 info_plist = "objc/AppRTCMobile/ios/Info.plist"
444 sources = [
445 "objc/AppRTCMobile/ios/main.m",
446 ]
447 deps = [
448 ":apprtcmobile_test_sources",
449 ]
450 ldflags = [ "-all_load" ]
451 }
adam.fedorbcc5d872016-11-07 14:53:28 -0800452 }
453 }
tkchin2ddfdba2016-08-07 21:37:45 -0700454}
kthelgason0727f152016-08-08 09:03:23 -0700455
456if (is_linux || is_win) {
ehmaldonadod02fe4b2016-08-26 13:31:24 -0700457 config("peerconnection_client_warnings_config") {
kjellander4a9abad2016-09-18 08:12:29 -0700458 cflags = []
ehmaldonadod02fe4b2016-08-26 13:31:24 -0700459 if (is_win && is_clang) {
kjellander4a9abad2016-09-18 08:12:29 -0700460 cflags += [
ehmaldonadod02fe4b2016-08-26 13:31:24 -0700461 # Disable warnings failing when compiling with Clang on Windows.
462 # https://bugs.chromium.org/p/webrtc/issues/detail?id=5366
463 "-Wno-format",
464
465 # See https://bugs.chromium.org/p/webrtc/issues/detail?id=6271
466 # for -Wno-reorder and -Wno-sign-compare
467 "-Wno-reorder",
468 "-Wno-sign-compare",
469 ]
470 }
kjellanderd4626e52016-09-07 02:33:01 -0700471 if (is_linux && target_cpu == "x86") {
kjellander4a9abad2016-09-18 08:12:29 -0700472 cflags += [
kjellanderd4626e52016-09-07 02:33:01 -0700473 # Needed to compile on Linux 32-bit.
474 "-Wno-sentinel",
475 ]
476 }
kjellander4a9abad2016-09-18 08:12:29 -0700477
478 if (is_clang) {
479 # TODO(ehmaldonado): Make peerconnection_client compile with the standard
480 # set of warnings.
481 # See https://bugs.chromium.org/p/webrtc/issues/detail?id=6306
482 cflags += [ "-Wno-inconsistent-missing-override" ]
483 }
ehmaldonadod02fe4b2016-08-26 13:31:24 -0700484 }
485
ehmaldonado38a21322016-09-02 04:10:34 -0700486 rtc_executable("peerconnection_client") {
kjellander1993b1d2017-03-06 00:29:21 -0800487 testonly = true
kthelgason0727f152016-08-08 09:03:23 -0700488 sources = [
489 "peerconnection/client/conductor.cc",
490 "peerconnection/client/conductor.h",
491 "peerconnection/client/defaults.cc",
492 "peerconnection/client/defaults.h",
493 "peerconnection/client/peer_connection_client.cc",
494 "peerconnection/client/peer_connection_client.h",
495 ]
ehmaldonado7a2ce0b2016-09-05 01:35:44 -0700496
kjellandere40a7ee2016-10-16 23:56:12 -0700497 if (!build_with_chromium && is_clang) {
498 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
ehmaldonado38a21322016-09-02 04:10:34 -0700499 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
kthelgason0727f152016-08-08 09:03:23 -0700500 }
Patrik Höglundb5b5bce2017-11-13 10:19:58 +0100501 deps = [
502 "../api:video_frame_api_i420",
503 ]
kthelgason0727f152016-08-08 09:03:23 -0700504 if (is_win) {
505 sources += [
506 "peerconnection/client/flagdefs.h",
507 "peerconnection/client/main.cc",
508 "peerconnection/client/main_wnd.cc",
509 "peerconnection/client/main_wnd.h",
510 ]
511 cflags = [ "/wd4245" ]
512 configs += [ "//build/config/win:windowed" ]
jianjun.zhuc0247402017-07-11 06:20:45 -0700513 deps += [ "../media:rtc_media_base" ]
kthelgason0727f152016-08-08 09:03:23 -0700514 }
515 if (is_linux) {
516 sources += [
517 "peerconnection/client/linux/main.cc",
518 "peerconnection/client/linux/main_wnd.cc",
519 "peerconnection/client/linux/main_wnd.h",
520 ]
Henrik Kjellanderefbde2c2017-03-27 08:28:27 +0200521 cflags = [ "-Wno-deprecated-declarations" ]
kthelgason0727f152016-08-08 09:03:23 -0700522 libs = [
523 "X11",
524 "Xcomposite",
525 "Xext",
526 "Xrender",
527 ]
thomasandersonef16e992016-12-13 02:57:43 -0800528 deps += [ "//build/config/linux/gtk" ]
kthelgason0727f152016-08-08 09:03:23 -0700529 }
ehmaldonadod02fe4b2016-08-26 13:31:24 -0700530 configs += [ ":peerconnection_client_warnings_config" ]
kjellander1993b1d2017-03-06 00:29:21 -0800531
532 deps += [
jianjun.zhuc0247402017-07-11 06:20:45 -0700533 "../api:libjingle_peerconnection_test_api",
534 "../api:video_frame_api",
Karl Wiberg1b0eae32017-10-17 14:48:54 +0200535 "../api/audio_codecs:builtin_audio_decoder_factory",
536 "../api/audio_codecs:builtin_audio_encoder_factory",
jianjun.zhuc0247402017-07-11 06:20:45 -0700537 "../media:rtc_media",
538 "../modules/video_capture:video_capture_module",
539 "../pc:libjingle_peerconnection",
ehmaldonadof6a861a2017-07-19 10:40:47 -0700540 "../rtc_base:rtc_base",
541 "../rtc_base:rtc_base_approved",
542 "../rtc_base:rtc_json",
jianjun.zhuc0247402017-07-11 06:20:45 -0700543 "../system_wrappers:field_trial_default",
544 "../system_wrappers:metrics_default",
kjellander1993b1d2017-03-06 00:29:21 -0800545 "//third_party/libyuv",
kjellander1993b1d2017-03-06 00:29:21 -0800546 ]
kthelgason0727f152016-08-08 09:03:23 -0700547 }
kjellanderd4626e52016-09-07 02:33:01 -0700548
ehmaldonado38a21322016-09-02 04:10:34 -0700549 rtc_executable("peerconnection_server") {
kjellander1993b1d2017-03-06 00:29:21 -0800550 testonly = true
kthelgason0727f152016-08-08 09:03:23 -0700551 sources = [
552 "peerconnection/server/data_socket.cc",
553 "peerconnection/server/data_socket.h",
554 "peerconnection/server/main.cc",
555 "peerconnection/server/peer_channel.cc",
556 "peerconnection/server/peer_channel.h",
557 "peerconnection/server/utils.cc",
558 "peerconnection/server/utils.h",
559 ]
560 deps = [
jianjun.zhuc0247402017-07-11 06:20:45 -0700561 "..:webrtc_common",
ehmaldonadof6a861a2017-07-19 10:40:47 -0700562 "../rtc_base:rtc_base_approved",
jianjun.zhuc0247402017-07-11 06:20:45 -0700563 "../rtc_tools:command_line_parser",
kthelgason0727f152016-08-08 09:03:23 -0700564 ]
kjellandere40a7ee2016-10-16 23:56:12 -0700565 if (!build_with_chromium && is_clang) {
566 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
ehmaldonado38a21322016-09-02 04:10:34 -0700567 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
kthelgason0727f152016-08-08 09:03:23 -0700568 }
569 }
ehmaldonado38a21322016-09-02 04:10:34 -0700570 rtc_executable("relayserver") {
kjellander1993b1d2017-03-06 00:29:21 -0800571 testonly = true
kthelgason0727f152016-08-08 09:03:23 -0700572 sources = [
573 "relayserver/relayserver_main.cc",
574 ]
575 deps = [
jianjun.zhuc0247402017-07-11 06:20:45 -0700576 "../p2p:rtc_p2p",
577 "../pc:rtc_pc",
ehmaldonadof6a861a2017-07-19 10:40:47 -0700578 "../rtc_base:rtc_base",
579 "../rtc_base:rtc_base_approved",
jianjun.zhuc0247402017-07-11 06:20:45 -0700580 "../system_wrappers:field_trial_default",
581 "../system_wrappers:metrics_default",
kthelgason0727f152016-08-08 09:03:23 -0700582 ]
kjellandere40a7ee2016-10-16 23:56:12 -0700583 if (!build_with_chromium && is_clang) {
584 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
ehmaldonado38a21322016-09-02 04:10:34 -0700585 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
kthelgason0727f152016-08-08 09:03:23 -0700586 }
587 }
ehmaldonado38a21322016-09-02 04:10:34 -0700588 rtc_executable("turnserver") {
kjellander1993b1d2017-03-06 00:29:21 -0800589 testonly = true
kthelgason0727f152016-08-08 09:03:23 -0700590 sources = [
591 "turnserver/turnserver_main.cc",
592 ]
593 deps = [
jianjun.zhuc0247402017-07-11 06:20:45 -0700594 "../p2p:rtc_p2p",
595 "../pc:rtc_pc",
ehmaldonadof6a861a2017-07-19 10:40:47 -0700596 "../rtc_base:rtc_base",
597 "../rtc_base:rtc_base_approved",
jianjun.zhuc0247402017-07-11 06:20:45 -0700598 "../system_wrappers:field_trial_default",
599 "../system_wrappers:metrics_default",
kthelgason0727f152016-08-08 09:03:23 -0700600 ]
kjellandere40a7ee2016-10-16 23:56:12 -0700601 if (!build_with_chromium && is_clang) {
602 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
ehmaldonado38a21322016-09-02 04:10:34 -0700603 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
kthelgason0727f152016-08-08 09:03:23 -0700604 }
605 }
ehmaldonado38a21322016-09-02 04:10:34 -0700606 rtc_executable("stunserver") {
kjellander1993b1d2017-03-06 00:29:21 -0800607 testonly = true
kthelgason0727f152016-08-08 09:03:23 -0700608 sources = [
609 "stunserver/stunserver_main.cc",
610 ]
611 deps = [
jianjun.zhuc0247402017-07-11 06:20:45 -0700612 "../p2p:rtc_p2p",
613 "../pc:rtc_pc",
ehmaldonadof6a861a2017-07-19 10:40:47 -0700614 "../rtc_base:rtc_base",
615 "../rtc_base:rtc_base_approved",
jianjun.zhuc0247402017-07-11 06:20:45 -0700616 "../system_wrappers:field_trial_default",
617 "../system_wrappers:metrics_default",
kthelgason0727f152016-08-08 09:03:23 -0700618 ]
kjellandere40a7ee2016-10-16 23:56:12 -0700619 if (!build_with_chromium && is_clang) {
620 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
ehmaldonado38a21322016-09-02 04:10:34 -0700621 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
kthelgason0727f152016-08-08 09:03:23 -0700622 }
623 }
624}
charujainaca3a242016-11-01 03:09:15 -0700625
qiangchen42f96d52017-08-08 17:08:03 -0700626if (is_win || is_android) {
gyzhouad7cad82017-05-11 16:10:03 -0700627 rtc_shared_library("webrtc_unity_plugin") {
628 testonly = true
629 sources = [
630 "unityplugin/simple_peer_connection.cc",
631 "unityplugin/simple_peer_connection.h",
632 "unityplugin/unity_plugin_apis.cc",
633 "unityplugin/unity_plugin_apis.h",
gyzhoub38f3862017-07-25 16:04:31 -0700634 "unityplugin/video_observer.cc",
635 "unityplugin/video_observer.h",
gyzhouad7cad82017-05-11 16:10:03 -0700636 ]
qiangchen42f96d52017-08-08 17:08:03 -0700637
638 if (is_android) {
639 sources += [
640 "unityplugin/classreferenceholder.cc",
641 "unityplugin/classreferenceholder.h",
642 "unityplugin/jni_onload.cc",
643 ]
644 }
645
gyzhouad7cad82017-05-11 16:10:03 -0700646 if (!build_with_chromium && is_clang) {
647 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
648 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
649 }
qiangchen42f96d52017-08-08 17:08:03 -0700650 if (is_win) {
651 cflags = [ "/wd4245" ]
652 configs += [
653 "//build/config/win:windowed",
654 ":peerconnection_client_warnings_config",
655 ]
656 }
gyzhouad7cad82017-05-11 16:10:03 -0700657 deps = [
jianjun.zhuc0247402017-07-11 06:20:45 -0700658 "../api:libjingle_peerconnection_test_api",
659 "../api:video_frame_api",
Qiang Chen51e20462017-12-05 11:11:21 -0800660 "../api/audio_codecs:builtin_audio_decoder_factory",
661 "../api/audio_codecs:builtin_audio_encoder_factory",
jianjun.zhuc0247402017-07-11 06:20:45 -0700662 "../media:rtc_media",
663 "../media:rtc_media_base",
664 "../modules/video_capture:video_capture_module",
665 "../pc:libjingle_peerconnection",
qiangchen42f96d52017-08-08 17:08:03 -0700666 "../rtc_base:rtc_base",
jianjun.zhuc0247402017-07-11 06:20:45 -0700667 "../system_wrappers:field_trial_default",
668 "../system_wrappers:metrics_default",
gyzhouad7cad82017-05-11 16:10:03 -0700669 ]
qiangchen42f96d52017-08-08 17:08:03 -0700670 if (is_android) {
671 deps += [ "../sdk/android:libjingle_peerconnection_jni" ]
672 }
673 }
674}
675
676if (is_android) {
Mirko Bonadeifbb3b7d2017-11-07 15:36:33 +0000677 rtc_android_library("webrtc_unity_java") {
qiangchen42f96d52017-08-08 17:08:03 -0700678 java_files = [ "unityplugin/java/src/org/webrtc/UnityUtility.java" ]
679 deps = [
680 "../rtc_base:base_java",
681 "../sdk/android:libjingle_peerconnection_java",
682 ]
683 }
684
685 dist_jar("libwebrtc_unity") {
686 _target_dir_name = get_label_info(":$target_name", "dir")
687 output = "${root_out_dir}/lib.java${_target_dir_name}/${target_name}.jar"
688 direct_deps_only = true
689 use_interface_jars = false
Oleh Prypin86021d92017-09-24 22:29:06 +0200690 requires_android = true
qiangchen42f96d52017-08-08 17:08:03 -0700691 deps = [
692 ":webrtc_unity_java",
693 "../modules/audio_device:audio_device_java",
694 "../rtc_base:base_java",
695 "../sdk/android:libjingle_peerconnection_java",
696 "../sdk/android:libjingle_peerconnection_metrics_default_java",
697 ]
gyzhouad7cad82017-05-11 16:10:03 -0700698 }
699}
700
charujainaca3a242016-11-01 03:09:15 -0700701if (!build_with_chromium) {
702 # Doesn't build within Chrome on Win.
703 rtc_executable("stun_prober") {
kjellander1993b1d2017-03-06 00:29:21 -0800704 testonly = true
charujainaca3a242016-11-01 03:09:15 -0700705 sources = [
706 "stunprober/main.cc",
707 ]
708
709 if (!build_with_chromium && is_clang) {
710 # Suppress warnings from Chrome's Clang plugins.
711 # See http://code.google.com/p/webrtc/issues/detail?id=163 for details.
712 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
713 }
714
715 deps = [
716 "../p2p:libstunprober",
717 "../p2p:rtc_p2p",
ehmaldonadof6a861a2017-07-19 10:40:47 -0700718 "../rtc_base:rtc_base",
719 "../rtc_base:rtc_base_approved",
charujainaca3a242016-11-01 03:09:15 -0700720 "../system_wrappers:field_trial_default",
721 ]
722 }
723}