blob: fa3c1e0ba4ec6d25b616dbb697ac21bdbd167e5d [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
Patrik Höglunda8005cf2017-12-13 16:05:42 +0100115 java_files = [
116 "androidtests/src/org/appspot/apprtc/test/PeerConnectionClientTest.java",
117 ]
Sami Kalliomaki9c0c75b2016-06-29 14:55:00 +0200118
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200119 apk_under_test = ":AppRTCMobile"
Sami Kalliomaki9c0c75b2016-06-29 14:55:00 +0200120
121 deps = [
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200122 ":AppRTCMobile_javalib",
jianjun.zhuc0247402017-07-11 06:20:45 -0700123 "../sdk/android:libjingle_peerconnection_java",
sakalcb79d512017-01-11 06:21:26 -0800124 "//third_party/android_support_test_runner:runner_java",
125 "//third_party/junit",
Sami Kalliomaki9c0c75b2016-06-29 14:55:00 +0200126 ]
127 }
mandermoa6069e82017-01-16 02:23:09 -0800128
Mirko Bonadeifbb3b7d2017-11-07 15:36:33 +0000129 rtc_instrumentation_test_apk("AppRTCMobileTestStubbedVideoIO") {
mandermoa6069e82017-01-16 02:23:09 -0800130 apk_name = "AppRTCMobileTestStubbedVideoIO"
131 android_manifest = "androidtests/AndroidManifest.xml"
132
oprypin30cda5e2017-04-24 04:15:13 -0700133 java_files = [ "androidtests/src/org/appspot/apprtc/test/CallActivityStubbedInputOutputTest.java" ]
mandermoa6069e82017-01-16 02:23:09 -0800134
135 apk_under_test = ":AppRTCMobile"
136
137 deps = [
138 ":AppRTCMobile_javalib",
jianjun.zhuc0247402017-07-11 06:20:45 -0700139 "../sdk/android:libjingle_peerconnection_java",
mandermoa6069e82017-01-16 02:23:09 -0800140 "//third_party/android_support_test_runner:rules_java",
141 "//third_party/android_support_test_runner:runner_java",
142 "//third_party/espresso:espresso_all_java",
143 "//third_party/hamcrest:hamcrest_java",
144 "//third_party/junit",
mandermoa6069e82017-01-16 02:23:09 -0800145 ]
146
147 data = [
Mirko Bonadei92ea95e2017-09-15 06:47:31 +0200148 "../resources/reference_video_640x360_30fps.y4m",
mandermoa6069e82017-01-16 02:23:09 -0800149 ]
150 }
Sami Kalliomaki9c0c75b2016-06-29 14:55:00 +0200151}
tkchin2ddfdba2016-08-07 21:37:45 -0700152
153if (is_ios || (is_mac && target_cpu != "x86")) {
tkchin2ddfdba2016-08-07 21:37:45 -0700154 config("apprtc_common_config") {
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200155 include_dirs = [ "objc/AppRTCMobile/common" ]
tkchin2ddfdba2016-08-07 21:37:45 -0700156 }
157
kjellanderb62dbbe2016-09-23 00:38:52 -0700158 rtc_static_library("apprtc_common") {
kjellander1993b1d2017-03-06 00:29:21 -0800159 testonly = true
tkchin2ddfdba2016-08-07 21:37:45 -0700160 sources = [
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200161 "objc/AppRTCMobile/common/ARDUtilities.h",
162 "objc/AppRTCMobile/common/ARDUtilities.m",
tkchin2ddfdba2016-08-07 21:37:45 -0700163 ]
ehmaldonadoe9cc6862016-09-05 06:10:18 -0700164 public_configs = [ ":apprtc_common_config" ]
tkchin2ddfdba2016-08-07 21:37:45 -0700165
Kári Tristan Helgason946923a2017-06-02 14:05:56 +0200166 if (is_ios) {
kthelgason5901d9d2017-08-16 07:28:03 -0700167 deps = [
168 ":AppRTCMobile_ios_frameworks",
169 ]
Kári Tristan Helgason946923a2017-06-02 14:05:56 +0200170 } else {
kthelgason5901d9d2017-08-16 07:28:03 -0700171 deps = [
kthelgason36d658d2017-08-24 05:43:45 -0700172 "../sdk:common_objc",
kthelgason5901d9d2017-08-16 07:28:03 -0700173 "../system_wrappers:field_trial_default",
174 "../system_wrappers:metrics_default",
175 ]
Kári Tristan Helgason946923a2017-06-02 14:05:56 +0200176 }
tkchin2ddfdba2016-08-07 21:37:45 -0700177 }
178
179 config("apprtc_signaling_config") {
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200180 include_dirs = [ "objc/AppRTCMobile" ]
tkchin2ddfdba2016-08-07 21:37:45 -0700181
182 # GN orders flags on a target before flags from configs. The default config
183 # adds these flags so to cancel them out they need to come from a config and
184 # cannot be on the target directly.
185 cflags = [
186 "-Wno-sign-compare",
187 "-Wno-unused-variable",
188 ]
tkchin2ddfdba2016-08-07 21:37:45 -0700189 }
190
kjellanderb62dbbe2016-09-23 00:38:52 -0700191 rtc_static_library("apprtc_signaling") {
kjellander1993b1d2017-03-06 00:29:21 -0800192 testonly = true
tkchin2ddfdba2016-08-07 21:37:45 -0700193 sources = [
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200194 "objc/AppRTCMobile/ARDAppClient+Internal.h",
195 "objc/AppRTCMobile/ARDAppClient.h",
196 "objc/AppRTCMobile/ARDAppClient.m",
197 "objc/AppRTCMobile/ARDAppEngineClient.h",
198 "objc/AppRTCMobile/ARDAppEngineClient.m",
199 "objc/AppRTCMobile/ARDBitrateTracker.h",
200 "objc/AppRTCMobile/ARDBitrateTracker.m",
sakalc522e752017-04-05 12:17:48 -0700201 "objc/AppRTCMobile/ARDCaptureController.h",
202 "objc/AppRTCMobile/ARDCaptureController.m",
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200203 "objc/AppRTCMobile/ARDJoinResponse+Internal.h",
204 "objc/AppRTCMobile/ARDJoinResponse.h",
205 "objc/AppRTCMobile/ARDJoinResponse.m",
206 "objc/AppRTCMobile/ARDMessageResponse+Internal.h",
207 "objc/AppRTCMobile/ARDMessageResponse.h",
208 "objc/AppRTCMobile/ARDMessageResponse.m",
209 "objc/AppRTCMobile/ARDRoomServerClient.h",
sakalc4adacf2017-03-28 01:22:48 -0700210 "objc/AppRTCMobile/ARDSettingsModel+Private.h",
211 "objc/AppRTCMobile/ARDSettingsModel.h",
212 "objc/AppRTCMobile/ARDSettingsModel.m",
213 "objc/AppRTCMobile/ARDSettingsStore.h",
214 "objc/AppRTCMobile/ARDSettingsStore.m",
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200215 "objc/AppRTCMobile/ARDSignalingChannel.h",
216 "objc/AppRTCMobile/ARDSignalingMessage.h",
217 "objc/AppRTCMobile/ARDSignalingMessage.m",
218 "objc/AppRTCMobile/ARDStatsBuilder.h",
219 "objc/AppRTCMobile/ARDStatsBuilder.m",
kthelgasoncc882af2017-01-13 05:59:46 -0800220 "objc/AppRTCMobile/ARDTURNClient+Internal.h",
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200221 "objc/AppRTCMobile/ARDTURNClient.h",
kthelgasoncc882af2017-01-13 05:59:46 -0800222 "objc/AppRTCMobile/ARDTURNClient.m",
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200223 "objc/AppRTCMobile/ARDWebSocketChannel.h",
224 "objc/AppRTCMobile/ARDWebSocketChannel.m",
225 "objc/AppRTCMobile/RTCIceCandidate+JSON.h",
226 "objc/AppRTCMobile/RTCIceCandidate+JSON.m",
227 "objc/AppRTCMobile/RTCIceServer+JSON.h",
228 "objc/AppRTCMobile/RTCIceServer+JSON.m",
229 "objc/AppRTCMobile/RTCMediaConstraints+JSON.h",
230 "objc/AppRTCMobile/RTCMediaConstraints+JSON.m",
231 "objc/AppRTCMobile/RTCSessionDescription+JSON.h",
232 "objc/AppRTCMobile/RTCSessionDescription+JSON.m",
tkchin2ddfdba2016-08-07 21:37:45 -0700233 ]
ehmaldonadoe9cc6862016-09-05 06:10:18 -0700234 public_configs = [ ":apprtc_signaling_config" ]
tkchin2ddfdba2016-08-07 21:37:45 -0700235 deps = [
236 ":apprtc_common",
237 ":socketrocket",
238 ]
Kári Tristan Helgason946923a2017-06-02 14:05:56 +0200239 if (is_ios) {
240 deps += [ ":AppRTCMobile_ios_frameworks" ]
241 } else {
242 public_deps = [
kthelgason36d658d2017-08-24 05:43:45 -0700243 "../sdk:peerconnection_objc",
Kári Tristan Helgason946923a2017-06-02 14:05:56 +0200244 ]
245 }
tkchin2ddfdba2016-08-07 21:37:45 -0700246 libs = [ "QuartzCore.framework" ]
247 }
248
249 if (is_ios) {
denicija77bfd7c2016-11-15 00:41:26 -0800250 rtc_static_library("AppRTCMobile_lib") {
kjellander1993b1d2017-03-06 00:29:21 -0800251 testonly = true
tkchin2ddfdba2016-08-07 21:37:45 -0700252 sources = [
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200253 "objc/AppRTCMobile/ios/ARDAppDelegate.m",
Daniela012b56b2017-11-15 13:15:24 +0100254 "objc/AppRTCMobile/ios/ARDFileCaptureController.h",
255 "objc/AppRTCMobile/ios/ARDFileCaptureController.m",
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200256 "objc/AppRTCMobile/ios/ARDMainView.h",
257 "objc/AppRTCMobile/ios/ARDMainView.m",
258 "objc/AppRTCMobile/ios/ARDMainViewController.h",
259 "objc/AppRTCMobile/ios/ARDMainViewController.m",
denicijad17d5362016-11-02 02:56:09 -0700260 "objc/AppRTCMobile/ios/ARDSettingsViewController.h",
261 "objc/AppRTCMobile/ios/ARDSettingsViewController.m",
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200262 "objc/AppRTCMobile/ios/ARDStatsView.h",
263 "objc/AppRTCMobile/ios/ARDStatsView.m",
264 "objc/AppRTCMobile/ios/ARDVideoCallView.h",
265 "objc/AppRTCMobile/ios/ARDVideoCallView.m",
266 "objc/AppRTCMobile/ios/ARDVideoCallViewController.h",
267 "objc/AppRTCMobile/ios/ARDVideoCallViewController.m",
Anders Carlsson6bf43d22017-10-16 13:51:43 +0200268 "objc/AppRTCMobile/ios/RTCVideoCodecInfo+HumanReadable.h",
269 "objc/AppRTCMobile/ios/RTCVideoCodecInfo+HumanReadable.m",
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200270 "objc/AppRTCMobile/ios/UIImage+ARDUtilities.h",
271 "objc/AppRTCMobile/ios/UIImage+ARDUtilities.m",
denicija77bfd7c2016-11-15 00:41:26 -0800272 ]
denicija77bfd7c2016-11-15 00:41:26 -0800273
274 deps = [
Kári Tristan Helgason946923a2017-06-02 14:05:56 +0200275 ":AppRTCMobile_ios_frameworks",
denicija77bfd7c2016-11-15 00:41:26 -0800276 ":apprtc_common",
277 ":apprtc_signaling",
278 ]
279 }
280
281 ios_app_bundle("AppRTCMobile") {
kjellander1993b1d2017-03-06 00:29:21 -0800282 testonly = true
denicija77bfd7c2016-11-15 00:41:26 -0800283 sources = [
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200284 "objc/AppRTCMobile/ios/main.m",
tkchin2ddfdba2016-08-07 21:37:45 -0700285 ]
286
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200287 info_plist = "objc/AppRTCMobile/ios/Info.plist"
tkchin2ddfdba2016-08-07 21:37:45 -0700288
denicija77bfd7c2016-11-15 00:41:26 -0800289 configs += [ "..:common_config" ]
tkchin2ddfdba2016-08-07 21:37:45 -0700290 public_configs = [ "..:common_inherited_config" ]
291
292 deps = [
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200293 ":AppRTCMobile_ios_bundle_data",
kthelgasond3adbfb2017-01-26 01:14:04 -0800294 ":AppRTCMobile_ios_frameworks",
denicija77bfd7c2016-11-15 00:41:26 -0800295 ":AppRTCMobile_lib",
tkchin2ddfdba2016-08-07 21:37:45 -0700296 ]
297
298 if (target_cpu == "x86") {
299 deps += [ "//testing/iossim:iossim" ]
300 }
301 }
302
kthelgasond3adbfb2017-01-26 01:14:04 -0800303 bundle_data("AppRTCMobile_ios_frameworks") {
304 public_deps = [
kthelgason36d658d2017-08-24 05:43:45 -0700305 "../sdk:framework_objc+link",
kthelgasond3adbfb2017-01-26 01:14:04 -0800306 ]
307 sources = [
wjywbsbef8a5d2017-10-09 02:32:28 -0400308 "$root_build_dir/WebRTC.framework",
kthelgasond3adbfb2017-01-26 01:14:04 -0800309 ]
310 outputs = [
311 "{{bundle_resources_dir}}/Frameworks/{{source_file_part}}",
312 ]
313 }
314
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200315 bundle_data("AppRTCMobile_ios_bundle_data") {
tkchin2ddfdba2016-08-07 21:37:45 -0700316 sources = [
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200317 "objc/AppRTCMobile/ios/resources/Roboto-Regular.ttf",
Daniela012b56b2017-11-15 13:15:24 +0100318
319 # Sample video taken from https://media.xiph.org/video/derf/
320 "objc/AppRTCMobile/ios/resources/foreman.mp4",
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200321 "objc/AppRTCMobile/ios/resources/iPhone5@2x.png",
322 "objc/AppRTCMobile/ios/resources/iPhone6@2x.png",
323 "objc/AppRTCMobile/ios/resources/iPhone6p@3x.png",
324 "objc/AppRTCMobile/ios/resources/ic_call_end_black_24dp.png",
325 "objc/AppRTCMobile/ios/resources/ic_call_end_black_24dp@2x.png",
326 "objc/AppRTCMobile/ios/resources/ic_clear_black_24dp.png",
327 "objc/AppRTCMobile/ios/resources/ic_clear_black_24dp@2x.png",
denicija6d6762c2016-10-28 04:53:16 -0700328 "objc/AppRTCMobile/ios/resources/ic_settings_black_24dp.png",
329 "objc/AppRTCMobile/ios/resources/ic_settings_black_24dp@2x.png",
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200330 "objc/AppRTCMobile/ios/resources/ic_surround_sound_black_24dp.png",
331 "objc/AppRTCMobile/ios/resources/ic_surround_sound_black_24dp@2x.png",
332 "objc/AppRTCMobile/ios/resources/ic_switch_video_black_24dp.png",
333 "objc/AppRTCMobile/ios/resources/ic_switch_video_black_24dp@2x.png",
334 "objc/AppRTCMobile/ios/resources/mozart.mp3",
anderscb5ed9052017-08-15 04:07:12 -0700335 "objc/Icon-120.png",
336 "objc/Icon-180.png",
tkchin2ddfdba2016-08-07 21:37:45 -0700337 "objc/Icon.png",
338 ]
339 outputs = [
340 "{{bundle_resources_dir}}/{{source_file_part}}",
341 ]
342 }
343 }
344
345 if (is_mac) {
denicija77bfd7c2016-11-15 00:41:26 -0800346 rtc_static_library("AppRTCMobile_lib") {
kjellander1993b1d2017-03-06 00:29:21 -0800347 testonly = true
tkchin2ddfdba2016-08-07 21:37:45 -0700348 sources = [
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200349 "objc/AppRTCMobile/mac/APPRTCAppDelegate.h",
350 "objc/AppRTCMobile/mac/APPRTCAppDelegate.m",
351 "objc/AppRTCMobile/mac/APPRTCViewController.h",
352 "objc/AppRTCMobile/mac/APPRTCViewController.m",
tkchin2ddfdba2016-08-07 21:37:45 -0700353 ]
jianjun.zhuc0247402017-07-11 06:20:45 -0700354 configs += [ "..:common_objc" ]
tkchin2ddfdba2016-08-07 21:37:45 -0700355 deps = [
356 ":apprtc_common",
357 ":apprtc_signaling",
kthelgason36d658d2017-08-24 05:43:45 -0700358 "../sdk:ui_objc",
tkchin2ddfdba2016-08-07 21:37:45 -0700359 ]
360 }
361
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200362 mac_app_bundle("AppRTCMobile") {
kjellander1993b1d2017-03-06 00:29:21 -0800363 testonly = true
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200364 output_name = "AppRTCMobile"
tkchin2ddfdba2016-08-07 21:37:45 -0700365
tkchin2ddfdba2016-08-07 21:37:45 -0700366 sources = [
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200367 "objc/AppRTCMobile/mac/main.m",
tkchin2ddfdba2016-08-07 21:37:45 -0700368 ]
369
370 public_configs = [ "..:common_inherited_config" ]
371
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200372 info_plist = "objc/AppRTCMobile/mac/Info.plist"
tkchin2ddfdba2016-08-07 21:37:45 -0700373
374 libs = [ "AppKit.framework" ]
375
376 deps = [
denicija77bfd7c2016-11-15 00:41:26 -0800377 ":AppRTCMobile_lib",
tkchin2ddfdba2016-08-07 21:37:45 -0700378 ]
379 }
380 }
381
382 config("socketrocket_include_config") {
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200383 include_dirs = [ "objc/AppRTCMobile/third_party/SocketRocket" ]
tkchin2ddfdba2016-08-07 21:37:45 -0700384 }
385
386 config("socketrocket_warning_config") {
387 # GN orders flags on a target before flags from configs. The default config
388 # adds these flags so to cancel them out they need to come from a config and
389 # cannot be on the target directly.
390 cflags = [
391 "-Wno-deprecated-declarations",
392 "-Wno-nonnull",
tkchin2ddfdba2016-08-07 21:37:45 -0700393 "-Wno-semicolon-before-method-body",
kthelgasone47de1a2017-02-24 01:56:01 -0800394 "-Wno-unused-variable",
tkchin2ddfdba2016-08-07 21:37:45 -0700395 ]
396
henrika27d8b612016-09-21 04:13:00 -0700397 cflags_objc = [
398 # Enabled for cflags_objc in build/config/compiler/BUILD.gn.
399 "-Wno-objc-missing-property-synthesis",
henrika27d8b612016-09-21 04:13:00 -0700400 ]
tkchin2ddfdba2016-08-07 21:37:45 -0700401 }
402
kjellanderb62dbbe2016-09-23 00:38:52 -0700403 rtc_static_library("socketrocket") {
kjellander1993b1d2017-03-06 00:29:21 -0800404 testonly = true
tkchin2ddfdba2016-08-07 21:37:45 -0700405 sources = [
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200406 "objc/AppRTCMobile/third_party/SocketRocket/SRWebSocket.h",
407 "objc/AppRTCMobile/third_party/SocketRocket/SRWebSocket.m",
tkchin2ddfdba2016-08-07 21:37:45 -0700408 ]
kthelgasonc0977102017-04-24 00:57:16 -0700409 configs += [ ":socketrocket_warning_config" ]
ehmaldonadoe9cc6862016-09-05 06:10:18 -0700410 public_configs = [ ":socketrocket_include_config" ]
tkchin2ddfdba2016-08-07 21:37:45 -0700411
412 libs = [
413 "CFNetwork.framework",
414 "icucore",
415 ]
416 }
adam.fedorbcc5d872016-11-07 14:53:28 -0800417
418 if (rtc_include_tests) {
kthelgason4065a572017-02-14 04:58:56 -0800419 # TODO(kthelgason): compile xctests on mac when chromium supports it.
420 if (is_ios) {
421 rtc_source_set("apprtcmobile_test_sources") {
kjellander1993b1d2017-03-06 00:29:21 -0800422 testonly = true
kthelgason4065a572017-02-14 04:58:56 -0800423 include_dirs = [
424 "objc/AppRTCMobile",
425 "objc/AppRTCMobile/ios",
426 ]
427 testonly = true
428 sources = [
429 "objc/AppRTCMobile/tests/ARDAppClient_xctest.mm",
Daniela012b56b2017-11-15 13:15:24 +0100430 "objc/AppRTCMobile/tests/ARDFileCaptureController_xctest.mm",
kthelgason4065a572017-02-14 04:58:56 -0800431 "objc/AppRTCMobile/tests/ARDSettingsModel_xctest.mm",
432 ]
kjellander1993b1d2017-03-06 00:29:21 -0800433 deps = [
jianjun.zhuc0247402017-07-11 06:20:45 -0700434 "../rtc_base:rtc_base",
kjellander1993b1d2017-03-06 00:29:21 -0800435 ]
kthelgason4065a572017-02-14 04:58:56 -0800436 public_deps = [
437 ":AppRTCMobile_ios_frameworks",
438 ":AppRTCMobile_lib",
439 "//build/config/ios:xctest",
440 "//third_party/ocmock",
441 ]
adam.fedorbcc5d872016-11-07 14:53:28 -0800442 }
443
kthelgason4065a572017-02-14 04:58:56 -0800444 rtc_ios_xctest_test("apprtcmobile_tests") {
445 info_plist = "objc/AppRTCMobile/ios/Info.plist"
446 sources = [
447 "objc/AppRTCMobile/ios/main.m",
448 ]
449 deps = [
450 ":apprtcmobile_test_sources",
451 ]
452 ldflags = [ "-all_load" ]
453 }
adam.fedorbcc5d872016-11-07 14:53:28 -0800454 }
455 }
tkchin2ddfdba2016-08-07 21:37:45 -0700456}
kthelgason0727f152016-08-08 09:03:23 -0700457
458if (is_linux || is_win) {
ehmaldonadod02fe4b2016-08-26 13:31:24 -0700459 config("peerconnection_client_warnings_config") {
kjellander4a9abad2016-09-18 08:12:29 -0700460 cflags = []
ehmaldonadod02fe4b2016-08-26 13:31:24 -0700461 if (is_win && is_clang) {
kjellander4a9abad2016-09-18 08:12:29 -0700462 cflags += [
ehmaldonadod02fe4b2016-08-26 13:31:24 -0700463 # Disable warnings failing when compiling with Clang on Windows.
464 # https://bugs.chromium.org/p/webrtc/issues/detail?id=5366
465 "-Wno-format",
466
467 # See https://bugs.chromium.org/p/webrtc/issues/detail?id=6271
468 # for -Wno-reorder and -Wno-sign-compare
469 "-Wno-reorder",
470 "-Wno-sign-compare",
471 ]
472 }
kjellanderd4626e52016-09-07 02:33:01 -0700473 if (is_linux && target_cpu == "x86") {
kjellander4a9abad2016-09-18 08:12:29 -0700474 cflags += [
kjellanderd4626e52016-09-07 02:33:01 -0700475 # Needed to compile on Linux 32-bit.
476 "-Wno-sentinel",
477 ]
478 }
kjellander4a9abad2016-09-18 08:12:29 -0700479
480 if (is_clang) {
481 # TODO(ehmaldonado): Make peerconnection_client compile with the standard
482 # set of warnings.
483 # See https://bugs.chromium.org/p/webrtc/issues/detail?id=6306
484 cflags += [ "-Wno-inconsistent-missing-override" ]
485 }
ehmaldonadod02fe4b2016-08-26 13:31:24 -0700486 }
487
ehmaldonado38a21322016-09-02 04:10:34 -0700488 rtc_executable("peerconnection_client") {
kjellander1993b1d2017-03-06 00:29:21 -0800489 testonly = true
kthelgason0727f152016-08-08 09:03:23 -0700490 sources = [
491 "peerconnection/client/conductor.cc",
492 "peerconnection/client/conductor.h",
493 "peerconnection/client/defaults.cc",
494 "peerconnection/client/defaults.h",
495 "peerconnection/client/peer_connection_client.cc",
496 "peerconnection/client/peer_connection_client.h",
497 ]
ehmaldonado7a2ce0b2016-09-05 01:35:44 -0700498
kjellandere40a7ee2016-10-16 23:56:12 -0700499 if (!build_with_chromium && is_clang) {
500 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
ehmaldonado38a21322016-09-02 04:10:34 -0700501 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
kthelgason0727f152016-08-08 09:03:23 -0700502 }
Patrik Höglundb5b5bce2017-11-13 10:19:58 +0100503 deps = [
504 "../api:video_frame_api_i420",
Patrik Höglunda8005cf2017-12-13 16:05:42 +0100505 "../rtc_base:checks",
Patrik Höglundb5b5bce2017-11-13 10:19:58 +0100506 ]
kthelgason0727f152016-08-08 09:03:23 -0700507 if (is_win) {
508 sources += [
509 "peerconnection/client/flagdefs.h",
510 "peerconnection/client/main.cc",
511 "peerconnection/client/main_wnd.cc",
512 "peerconnection/client/main_wnd.h",
513 ]
514 cflags = [ "/wd4245" ]
515 configs += [ "//build/config/win:windowed" ]
jianjun.zhuc0247402017-07-11 06:20:45 -0700516 deps += [ "../media:rtc_media_base" ]
kthelgason0727f152016-08-08 09:03:23 -0700517 }
518 if (is_linux) {
519 sources += [
520 "peerconnection/client/linux/main.cc",
521 "peerconnection/client/linux/main_wnd.cc",
522 "peerconnection/client/linux/main_wnd.h",
523 ]
Henrik Kjellanderefbde2c2017-03-27 08:28:27 +0200524 cflags = [ "-Wno-deprecated-declarations" ]
kthelgason0727f152016-08-08 09:03:23 -0700525 libs = [
526 "X11",
527 "Xcomposite",
528 "Xext",
529 "Xrender",
530 ]
thomasandersonef16e992016-12-13 02:57:43 -0800531 deps += [ "//build/config/linux/gtk" ]
kthelgason0727f152016-08-08 09:03:23 -0700532 }
ehmaldonadod02fe4b2016-08-26 13:31:24 -0700533 configs += [ ":peerconnection_client_warnings_config" ]
kjellander1993b1d2017-03-06 00:29:21 -0800534
535 deps += [
jianjun.zhuc0247402017-07-11 06:20:45 -0700536 "../api:libjingle_peerconnection_test_api",
537 "../api:video_frame_api",
Karl Wiberg1b0eae32017-10-17 14:48:54 +0200538 "../api/audio_codecs:builtin_audio_decoder_factory",
539 "../api/audio_codecs:builtin_audio_encoder_factory",
jianjun.zhuc0247402017-07-11 06:20:45 -0700540 "../media:rtc_media",
541 "../modules/video_capture:video_capture_module",
542 "../pc:libjingle_peerconnection",
ehmaldonadof6a861a2017-07-19 10:40:47 -0700543 "../rtc_base:rtc_base",
544 "../rtc_base:rtc_base_approved",
545 "../rtc_base:rtc_json",
jianjun.zhuc0247402017-07-11 06:20:45 -0700546 "../system_wrappers:field_trial_default",
547 "../system_wrappers:metrics_default",
kjellander1993b1d2017-03-06 00:29:21 -0800548 "//third_party/libyuv",
kjellander1993b1d2017-03-06 00:29:21 -0800549 ]
kthelgason0727f152016-08-08 09:03:23 -0700550 }
kjellanderd4626e52016-09-07 02:33:01 -0700551
ehmaldonado38a21322016-09-02 04:10:34 -0700552 rtc_executable("peerconnection_server") {
kjellander1993b1d2017-03-06 00:29:21 -0800553 testonly = true
kthelgason0727f152016-08-08 09:03:23 -0700554 sources = [
555 "peerconnection/server/data_socket.cc",
556 "peerconnection/server/data_socket.h",
557 "peerconnection/server/main.cc",
558 "peerconnection/server/peer_channel.cc",
559 "peerconnection/server/peer_channel.h",
560 "peerconnection/server/utils.cc",
561 "peerconnection/server/utils.h",
562 ]
563 deps = [
jianjun.zhuc0247402017-07-11 06:20:45 -0700564 "..:webrtc_common",
ehmaldonadof6a861a2017-07-19 10:40:47 -0700565 "../rtc_base:rtc_base_approved",
jianjun.zhuc0247402017-07-11 06:20:45 -0700566 "../rtc_tools:command_line_parser",
kthelgason0727f152016-08-08 09:03:23 -0700567 ]
kjellandere40a7ee2016-10-16 23:56:12 -0700568 if (!build_with_chromium && is_clang) {
569 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
ehmaldonado38a21322016-09-02 04:10:34 -0700570 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
kthelgason0727f152016-08-08 09:03:23 -0700571 }
572 }
ehmaldonado38a21322016-09-02 04:10:34 -0700573 rtc_executable("relayserver") {
kjellander1993b1d2017-03-06 00:29:21 -0800574 testonly = true
kthelgason0727f152016-08-08 09:03:23 -0700575 sources = [
576 "relayserver/relayserver_main.cc",
577 ]
578 deps = [
jianjun.zhuc0247402017-07-11 06:20:45 -0700579 "../p2p:rtc_p2p",
580 "../pc:rtc_pc",
ehmaldonadof6a861a2017-07-19 10:40:47 -0700581 "../rtc_base:rtc_base",
582 "../rtc_base:rtc_base_approved",
jianjun.zhuc0247402017-07-11 06:20:45 -0700583 "../system_wrappers:field_trial_default",
584 "../system_wrappers:metrics_default",
kthelgason0727f152016-08-08 09:03:23 -0700585 ]
kjellandere40a7ee2016-10-16 23:56:12 -0700586 if (!build_with_chromium && is_clang) {
587 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
ehmaldonado38a21322016-09-02 04:10:34 -0700588 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
kthelgason0727f152016-08-08 09:03:23 -0700589 }
590 }
ehmaldonado38a21322016-09-02 04:10:34 -0700591 rtc_executable("turnserver") {
kjellander1993b1d2017-03-06 00:29:21 -0800592 testonly = true
kthelgason0727f152016-08-08 09:03:23 -0700593 sources = [
594 "turnserver/turnserver_main.cc",
595 ]
596 deps = [
jianjun.zhuc0247402017-07-11 06:20:45 -0700597 "../p2p:rtc_p2p",
598 "../pc:rtc_pc",
ehmaldonadof6a861a2017-07-19 10:40:47 -0700599 "../rtc_base:rtc_base",
600 "../rtc_base:rtc_base_approved",
jianjun.zhuc0247402017-07-11 06:20:45 -0700601 "../system_wrappers:field_trial_default",
602 "../system_wrappers:metrics_default",
kthelgason0727f152016-08-08 09:03:23 -0700603 ]
kjellandere40a7ee2016-10-16 23:56:12 -0700604 if (!build_with_chromium && is_clang) {
605 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
ehmaldonado38a21322016-09-02 04:10:34 -0700606 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
kthelgason0727f152016-08-08 09:03:23 -0700607 }
608 }
ehmaldonado38a21322016-09-02 04:10:34 -0700609 rtc_executable("stunserver") {
kjellander1993b1d2017-03-06 00:29:21 -0800610 testonly = true
kthelgason0727f152016-08-08 09:03:23 -0700611 sources = [
612 "stunserver/stunserver_main.cc",
613 ]
614 deps = [
jianjun.zhuc0247402017-07-11 06:20:45 -0700615 "../p2p:rtc_p2p",
616 "../pc:rtc_pc",
ehmaldonadof6a861a2017-07-19 10:40:47 -0700617 "../rtc_base:rtc_base",
618 "../rtc_base:rtc_base_approved",
jianjun.zhuc0247402017-07-11 06:20:45 -0700619 "../system_wrappers:field_trial_default",
620 "../system_wrappers:metrics_default",
kthelgason0727f152016-08-08 09:03:23 -0700621 ]
kjellandere40a7ee2016-10-16 23:56:12 -0700622 if (!build_with_chromium && is_clang) {
623 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
ehmaldonado38a21322016-09-02 04:10:34 -0700624 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
kthelgason0727f152016-08-08 09:03:23 -0700625 }
626 }
627}
charujainaca3a242016-11-01 03:09:15 -0700628
qiangchen42f96d52017-08-08 17:08:03 -0700629if (is_win || is_android) {
gyzhouad7cad82017-05-11 16:10:03 -0700630 rtc_shared_library("webrtc_unity_plugin") {
631 testonly = true
632 sources = [
633 "unityplugin/simple_peer_connection.cc",
634 "unityplugin/simple_peer_connection.h",
635 "unityplugin/unity_plugin_apis.cc",
636 "unityplugin/unity_plugin_apis.h",
gyzhoub38f3862017-07-25 16:04:31 -0700637 "unityplugin/video_observer.cc",
638 "unityplugin/video_observer.h",
gyzhouad7cad82017-05-11 16:10:03 -0700639 ]
qiangchen42f96d52017-08-08 17:08:03 -0700640
641 if (is_android) {
642 sources += [
643 "unityplugin/classreferenceholder.cc",
644 "unityplugin/classreferenceholder.h",
645 "unityplugin/jni_onload.cc",
646 ]
647 }
648
gyzhouad7cad82017-05-11 16:10:03 -0700649 if (!build_with_chromium && is_clang) {
650 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
651 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
652 }
qiangchen42f96d52017-08-08 17:08:03 -0700653 if (is_win) {
654 cflags = [ "/wd4245" ]
655 configs += [
656 "//build/config/win:windowed",
657 ":peerconnection_client_warnings_config",
658 ]
659 }
gyzhouad7cad82017-05-11 16:10:03 -0700660 deps = [
jianjun.zhuc0247402017-07-11 06:20:45 -0700661 "../api:libjingle_peerconnection_test_api",
662 "../api:video_frame_api",
Qiang Chen51e20462017-12-05 11:11:21 -0800663 "../api/audio_codecs:builtin_audio_decoder_factory",
664 "../api/audio_codecs:builtin_audio_encoder_factory",
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) {
Mirko Bonadeifbb3b7d2017-11-07 15:36:33 +0000680 rtc_android_library("webrtc_unity_java") {
qiangchen42f96d52017-08-08 17:08:03 -0700681 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
Oleh Prypin86021d92017-09-24 22:29:06 +0200693 requires_android = true
qiangchen42f96d52017-08-08 17:08:03 -0700694 deps = [
695 ":webrtc_unity_java",
696 "../modules/audio_device:audio_device_java",
697 "../rtc_base:base_java",
698 "../sdk/android:libjingle_peerconnection_java",
699 "../sdk/android:libjingle_peerconnection_metrics_default_java",
700 ]
gyzhouad7cad82017-05-11 16:10:03 -0700701 }
702}
703
charujainaca3a242016-11-01 03:09:15 -0700704if (!build_with_chromium) {
705 # Doesn't build within Chrome on Win.
706 rtc_executable("stun_prober") {
kjellander1993b1d2017-03-06 00:29:21 -0800707 testonly = true
charujainaca3a242016-11-01 03:09:15 -0700708 sources = [
709 "stunprober/main.cc",
710 ]
711
712 if (!build_with_chromium && is_clang) {
713 # Suppress warnings from Chrome's Clang plugins.
714 # See http://code.google.com/p/webrtc/issues/detail?id=163 for details.
715 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
716 }
717
718 deps = [
719 "../p2p:libstunprober",
720 "../p2p:rtc_p2p",
Patrik Höglunda8005cf2017-12-13 16:05:42 +0100721 "../rtc_base:checks",
ehmaldonadof6a861a2017-07-19 10:40:47 -0700722 "../rtc_base:rtc_base",
723 "../rtc_base:rtc_base_approved",
charujainaca3a242016-11-01 03:09:15 -0700724 "../system_wrappers:field_trial_default",
725 ]
726 }
727}