blob: d0808b110ab73439106dbab72146d7e600d7e334 [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") {
53 apk_name = "AppRTCMobile"
Sami Kalliomaki9c0c75b2016-06-29 14:55:00 +020054 android_manifest = "androidapp/AndroidManifest.xml"
55
56 deps = [
Magnus Jedvertc1815cf2016-09-27 10:10:41 +020057 ":AppRTCMobile_javalib",
58 ":AppRTCMobile_resources",
Sami Kalliomaki9c0c75b2016-06-29 14:55:00 +020059 "//base:base_java",
60 "//webrtc/base:base_java",
61 ]
62
magjed768c6482016-12-06 04:29:37 -080063 shared_libraries = [ "//webrtc/sdk/android:libjingle_peerconnection_so" ]
Sami Kalliomaki9c0c75b2016-06-29 14:55:00 +020064 }
65
Magnus Jedvertc1815cf2016-09-27 10:10:41 +020066 android_library("AppRTCMobile_javalib") {
sakal07a050f2017-02-13 05:58:27 -080067 android_manifest = "androidapp/AndroidManifest.xml"
68
Sami Kalliomaki9c0c75b2016-06-29 14:55:00 +020069 java_files = [
70 "androidapp/src/org/appspot/apprtc/AppRTCAudioManager.java",
henrikac3c2f312016-12-14 07:36:56 -080071 "androidapp/src/org/appspot/apprtc/AppRTCBluetoothManager.java",
Sami Kalliomaki9c0c75b2016-06-29 14:55:00 +020072 "androidapp/src/org/appspot/apprtc/AppRTCClient.java",
73 "androidapp/src/org/appspot/apprtc/AppRTCProximitySensor.java",
74 "androidapp/src/org/appspot/apprtc/CallActivity.java",
75 "androidapp/src/org/appspot/apprtc/CallFragment.java",
76 "androidapp/src/org/appspot/apprtc/CaptureQualityController.java",
77 "androidapp/src/org/appspot/apprtc/ConnectActivity.java",
78 "androidapp/src/org/appspot/apprtc/CpuMonitor.java",
79 "androidapp/src/org/appspot/apprtc/DirectRTCClient.java",
80 "androidapp/src/org/appspot/apprtc/HudFragment.java",
81 "androidapp/src/org/appspot/apprtc/PeerConnectionClient.java",
Sami Kalliomaki9c0c75b2016-06-29 14:55:00 +020082 "androidapp/src/org/appspot/apprtc/RoomParametersFetcher.java",
83 "androidapp/src/org/appspot/apprtc/SettingsActivity.java",
84 "androidapp/src/org/appspot/apprtc/SettingsFragment.java",
85 "androidapp/src/org/appspot/apprtc/TCPChannelClient.java",
86 "androidapp/src/org/appspot/apprtc/UnhandledExceptionHandler.java",
87 "androidapp/src/org/appspot/apprtc/WebSocketChannelClient.java",
88 "androidapp/src/org/appspot/apprtc/WebSocketRTCClient.java",
89 "androidapp/src/org/appspot/apprtc/util/AppRTCUtils.java",
90 "androidapp/src/org/appspot/apprtc/util/AsyncHttpURLConnection.java",
Sami Kalliomaki9c0c75b2016-06-29 14:55:00 +020091 ]
92
93 deps = [
Magnus Jedvertc1815cf2016-09-27 10:10:41 +020094 ":AppRTCMobile_resources",
Sami Kalliomaki9c0c75b2016-06-29 14:55:00 +020095 "//webrtc/base:base_java",
96 "//webrtc/examples/androidapp/third_party/autobanh:autobanh_java",
mbonadeib55bd972017-01-23 01:25:53 -080097 "//webrtc/modules/audio_device:audio_device_java",
magjed768c6482016-12-06 04:29:37 -080098 "//webrtc/sdk/android:libjingle_peerconnection_java",
99 "//webrtc/sdk/android:libjingle_peerconnection_metrics_default_java",
Sami Kalliomaki9c0c75b2016-06-29 14:55:00 +0200100 ]
101 }
102
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200103 android_resources("AppRTCMobile_resources") {
Sami Kalliomaki9c0c75b2016-06-29 14:55:00 +0200104 resource_dirs = [ "androidapp/res" ]
105 custom_package = "org.appspot.apprtc"
106 }
107
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200108 instrumentation_test_apk("AppRTCMobileTest") {
109 apk_name = "AppRTCMobileTest"
Sami Kalliomaki9c0c75b2016-06-29 14:55:00 +0200110 android_manifest = "androidtests/AndroidManifest.xml"
111
sakale8aca242017-01-17 03:32:06 -0800112 java_files = [ "androidtests/src/org/appspot/apprtc/test/PeerConnectionClientTest.java" ]
Sami Kalliomaki9c0c75b2016-06-29 14:55:00 +0200113
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200114 apk_under_test = ":AppRTCMobile"
Sami Kalliomaki9c0c75b2016-06-29 14:55:00 +0200115
116 deps = [
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200117 ":AppRTCMobile_javalib",
sakalcb79d512017-01-11 06:21:26 -0800118 "//base:base_java_test_support",
119 "//third_party/android_support_test_runner:runner_java",
120 "//third_party/junit",
magjed768c6482016-12-06 04:29:37 -0800121 "//webrtc/sdk/android:libjingle_peerconnection_java",
Sami Kalliomaki9c0c75b2016-06-29 14:55:00 +0200122 ]
123 }
mandermoa6069e82017-01-16 02:23:09 -0800124
125 instrumentation_test_apk("AppRTCMobileTestStubbedVideoIO") {
126 apk_name = "AppRTCMobileTestStubbedVideoIO"
127 android_manifest = "androidtests/AndroidManifest.xml"
128
129 java_files = [ "androidtests/src/org/appspot/apprtc/test/ConnectActivityStubbedInputOutputTest.java" ]
130
131 apk_under_test = ":AppRTCMobile"
132
133 deps = [
134 ":AppRTCMobile_javalib",
135 "//third_party/android_support_test_runner:rules_java",
136 "//third_party/android_support_test_runner:runner_java",
137 "//third_party/espresso:espresso_all_java",
138 "//third_party/hamcrest:hamcrest_java",
139 "//third_party/junit",
140 "//webrtc/sdk/android:libjingle_peerconnection_java",
141 ]
142
143 data = [
144 "//resources/reference_video_640x360_30fps.y4m",
145 ]
146 }
Sami Kalliomaki9c0c75b2016-06-29 14:55:00 +0200147}
tkchin2ddfdba2016-08-07 21:37:45 -0700148
149if (is_ios || (is_mac && target_cpu != "x86")) {
150 config("warnings_config") {
151 # GN orders flags on a target before flags from configs. The default config
152 # adds these flags so to cancel them out they need to come from a config and
153 # cannot be on the target directly.
154 if (is_ios) {
155 # Suppress compiler warnings about deprecated that triggered
156 # when moving from ios_deployment_target 7.0 to 9.0.
157 # See webrtc:5549 for more details.
158 cflags = [ "-Wno-deprecated-declarations" ]
Henrik Kjellander91a57592016-10-12 20:25:34 -0700159 cflags_objc = [
160 # Enabled for cflags_objc in build/config/compiler/BUILD.gn.
161 # See webrtc:6520.
162 "-Wno-objc-missing-property-synthesis",
163 ]
tkchin2ddfdba2016-08-07 21:37:45 -0700164 }
165 }
166
167 config("apprtc_common_config") {
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200168 include_dirs = [ "objc/AppRTCMobile/common" ]
tkchin2ddfdba2016-08-07 21:37:45 -0700169 }
170
kjellanderb62dbbe2016-09-23 00:38:52 -0700171 rtc_static_library("apprtc_common") {
tkchin2ddfdba2016-08-07 21:37:45 -0700172 sources = [
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200173 "objc/AppRTCMobile/common/ARDUtilities.h",
174 "objc/AppRTCMobile/common/ARDUtilities.m",
tkchin2ddfdba2016-08-07 21:37:45 -0700175 ]
176 configs += [
tkchin2ddfdba2016-08-07 21:37:45 -0700177 ":warnings_config",
178 "//build/config/compiler:enable_arc",
179 ]
ehmaldonadoe9cc6862016-09-05 06:10:18 -0700180 public_configs = [ ":apprtc_common_config" ]
tkchin2ddfdba2016-08-07 21:37:45 -0700181
182 deps = [
183 "../sdk:rtc_sdk_common_objc",
184 "../system_wrappers:field_trial_default",
185 "../system_wrappers:metrics_default",
186 ]
187 }
188
189 config("apprtc_signaling_config") {
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200190 include_dirs = [ "objc/AppRTCMobile" ]
tkchin2ddfdba2016-08-07 21:37:45 -0700191
192 # GN orders flags on a target before flags from configs. The default config
193 # adds these flags so to cancel them out they need to come from a config and
194 # cannot be on the target directly.
195 cflags = [
196 "-Wno-sign-compare",
197 "-Wno-unused-variable",
198 ]
tkchin2ddfdba2016-08-07 21:37:45 -0700199 }
200
kjellanderb62dbbe2016-09-23 00:38:52 -0700201 rtc_static_library("apprtc_signaling") {
tkchin2ddfdba2016-08-07 21:37:45 -0700202 sources = [
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200203 "objc/AppRTCMobile/ARDAppClient+Internal.h",
204 "objc/AppRTCMobile/ARDAppClient.h",
205 "objc/AppRTCMobile/ARDAppClient.m",
206 "objc/AppRTCMobile/ARDAppEngineClient.h",
207 "objc/AppRTCMobile/ARDAppEngineClient.m",
208 "objc/AppRTCMobile/ARDBitrateTracker.h",
209 "objc/AppRTCMobile/ARDBitrateTracker.m",
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200210 "objc/AppRTCMobile/ARDJoinResponse+Internal.h",
211 "objc/AppRTCMobile/ARDJoinResponse.h",
212 "objc/AppRTCMobile/ARDJoinResponse.m",
213 "objc/AppRTCMobile/ARDMessageResponse+Internal.h",
214 "objc/AppRTCMobile/ARDMessageResponse.h",
215 "objc/AppRTCMobile/ARDMessageResponse.m",
216 "objc/AppRTCMobile/ARDRoomServerClient.h",
217 "objc/AppRTCMobile/ARDSDPUtils.h",
218 "objc/AppRTCMobile/ARDSDPUtils.m",
219 "objc/AppRTCMobile/ARDSignalingChannel.h",
220 "objc/AppRTCMobile/ARDSignalingMessage.h",
221 "objc/AppRTCMobile/ARDSignalingMessage.m",
222 "objc/AppRTCMobile/ARDStatsBuilder.h",
223 "objc/AppRTCMobile/ARDStatsBuilder.m",
kthelgasoncc882af2017-01-13 05:59:46 -0800224 "objc/AppRTCMobile/ARDTURNClient+Internal.h",
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200225 "objc/AppRTCMobile/ARDTURNClient.h",
kthelgasoncc882af2017-01-13 05:59:46 -0800226 "objc/AppRTCMobile/ARDTURNClient.m",
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200227 "objc/AppRTCMobile/ARDWebSocketChannel.h",
228 "objc/AppRTCMobile/ARDWebSocketChannel.m",
229 "objc/AppRTCMobile/RTCIceCandidate+JSON.h",
230 "objc/AppRTCMobile/RTCIceCandidate+JSON.m",
231 "objc/AppRTCMobile/RTCIceServer+JSON.h",
232 "objc/AppRTCMobile/RTCIceServer+JSON.m",
233 "objc/AppRTCMobile/RTCMediaConstraints+JSON.h",
234 "objc/AppRTCMobile/RTCMediaConstraints+JSON.m",
235 "objc/AppRTCMobile/RTCSessionDescription+JSON.h",
236 "objc/AppRTCMobile/RTCSessionDescription+JSON.m",
tkchin2ddfdba2016-08-07 21:37:45 -0700237 ]
238 configs += [
tkchin2ddfdba2016-08-07 21:37:45 -0700239 "//build/config/compiler:enable_arc",
240 ":warnings_config",
241 ]
ehmaldonadoe9cc6862016-09-05 06:10:18 -0700242 public_configs = [ ":apprtc_signaling_config" ]
tkchin2ddfdba2016-08-07 21:37:45 -0700243 deps = [
244 ":apprtc_common",
245 ":socketrocket",
246 ]
247 public_deps = [
248 "../sdk:rtc_sdk_peerconnection_objc",
249 ]
250 libs = [ "QuartzCore.framework" ]
251 }
252
253 if (is_ios) {
denicija77bfd7c2016-11-15 00:41:26 -0800254 rtc_static_library("AppRTCMobile_lib") {
tkchin2ddfdba2016-08-07 21:37:45 -0700255 sources = [
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200256 "objc/AppRTCMobile/ios/ARDAppDelegate.m",
257 "objc/AppRTCMobile/ios/ARDMainView.h",
258 "objc/AppRTCMobile/ios/ARDMainView.m",
259 "objc/AppRTCMobile/ios/ARDMainViewController.h",
260 "objc/AppRTCMobile/ios/ARDMainViewController.m",
denicija2256e042016-11-09 06:26:18 -0800261 "objc/AppRTCMobile/ios/ARDSettingsModel+Private.h",
262 "objc/AppRTCMobile/ios/ARDSettingsModel.h",
263 "objc/AppRTCMobile/ios/ARDSettingsModel.m",
264 "objc/AppRTCMobile/ios/ARDSettingsStore.h",
265 "objc/AppRTCMobile/ios/ARDSettingsStore.m",
denicijad17d5362016-11-02 02:56:09 -0700266 "objc/AppRTCMobile/ios/ARDSettingsViewController.h",
267 "objc/AppRTCMobile/ios/ARDSettingsViewController.m",
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200268 "objc/AppRTCMobile/ios/ARDStatsView.h",
269 "objc/AppRTCMobile/ios/ARDStatsView.m",
270 "objc/AppRTCMobile/ios/ARDVideoCallView.h",
271 "objc/AppRTCMobile/ios/ARDVideoCallView.m",
272 "objc/AppRTCMobile/ios/ARDVideoCallViewController.h",
273 "objc/AppRTCMobile/ios/ARDVideoCallViewController.m",
274 "objc/AppRTCMobile/ios/AppRTCMobile-Prefix.pch",
275 "objc/AppRTCMobile/ios/UIImage+ARDUtilities.h",
276 "objc/AppRTCMobile/ios/UIImage+ARDUtilities.m",
denicija77bfd7c2016-11-15 00:41:26 -0800277 ]
278 configs += [
279 "//build/config/compiler:enable_arc",
280 ":warnings_config",
281 ]
282
283 deps = [
284 ":apprtc_common",
285 ":apprtc_signaling",
286 ]
287 }
288
289 ios_app_bundle("AppRTCMobile") {
290 sources = [
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200291 "objc/AppRTCMobile/ios/main.m",
tkchin2ddfdba2016-08-07 21:37:45 -0700292 ]
293
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200294 info_plist = "objc/AppRTCMobile/ios/Info.plist"
tkchin2ddfdba2016-08-07 21:37:45 -0700295
denicija77bfd7c2016-11-15 00:41:26 -0800296 configs += [ "..:common_config" ]
tkchin2ddfdba2016-08-07 21:37:45 -0700297 public_configs = [ "..:common_inherited_config" ]
298
299 deps = [
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200300 ":AppRTCMobile_ios_bundle_data",
kthelgasond3adbfb2017-01-26 01:14:04 -0800301 ":AppRTCMobile_ios_frameworks",
denicija77bfd7c2016-11-15 00:41:26 -0800302 ":AppRTCMobile_lib",
tkchin2ddfdba2016-08-07 21:37:45 -0700303 ]
304
305 if (target_cpu == "x86") {
306 deps += [ "//testing/iossim:iossim" ]
307 }
308 }
309
kthelgasond3adbfb2017-01-26 01:14:04 -0800310 bundle_data("AppRTCMobile_ios_frameworks") {
311 public_deps = [
312 "//webrtc/sdk:rtc_sdk_framework_objc+link",
313 ]
314 sources = [
315 "$root_out_dir/WebRTC.framework",
316 ]
317 outputs = [
318 "{{bundle_resources_dir}}/Frameworks/{{source_file_part}}",
319 ]
320 }
321
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200322 bundle_data("AppRTCMobile_ios_bundle_data") {
tkchin2ddfdba2016-08-07 21:37:45 -0700323 sources = [
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200324 "objc/AppRTCMobile/ios/resources/Roboto-Regular.ttf",
325 "objc/AppRTCMobile/ios/resources/iPhone5@2x.png",
326 "objc/AppRTCMobile/ios/resources/iPhone6@2x.png",
327 "objc/AppRTCMobile/ios/resources/iPhone6p@3x.png",
328 "objc/AppRTCMobile/ios/resources/ic_call_end_black_24dp.png",
329 "objc/AppRTCMobile/ios/resources/ic_call_end_black_24dp@2x.png",
330 "objc/AppRTCMobile/ios/resources/ic_clear_black_24dp.png",
331 "objc/AppRTCMobile/ios/resources/ic_clear_black_24dp@2x.png",
denicija6d6762c2016-10-28 04:53:16 -0700332 "objc/AppRTCMobile/ios/resources/ic_settings_black_24dp.png",
333 "objc/AppRTCMobile/ios/resources/ic_settings_black_24dp@2x.png",
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200334 "objc/AppRTCMobile/ios/resources/ic_surround_sound_black_24dp.png",
335 "objc/AppRTCMobile/ios/resources/ic_surround_sound_black_24dp@2x.png",
336 "objc/AppRTCMobile/ios/resources/ic_switch_video_black_24dp.png",
337 "objc/AppRTCMobile/ios/resources/ic_switch_video_black_24dp@2x.png",
338 "objc/AppRTCMobile/ios/resources/mozart.mp3",
tkchin2ddfdba2016-08-07 21:37:45 -0700339 "objc/Icon.png",
340 ]
341 outputs = [
342 "{{bundle_resources_dir}}/{{source_file_part}}",
343 ]
344 }
345 }
346
347 if (is_mac) {
denicija77bfd7c2016-11-15 00:41:26 -0800348 rtc_static_library("AppRTCMobile_lib") {
tkchin2ddfdba2016-08-07 21:37:45 -0700349 sources = [
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200350 "objc/AppRTCMobile/mac/APPRTCAppDelegate.h",
351 "objc/AppRTCMobile/mac/APPRTCAppDelegate.m",
352 "objc/AppRTCMobile/mac/APPRTCViewController.h",
353 "objc/AppRTCMobile/mac/APPRTCViewController.m",
tkchin2ddfdba2016-08-07 21:37:45 -0700354 ]
355 configs += [
tkchin2ddfdba2016-08-07 21:37:45 -0700356 "..:common_objc",
357 "//build/config/compiler:enable_arc",
358 ]
359 deps = [
360 ":apprtc_common",
361 ":apprtc_signaling",
362 ]
363 }
364
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200365 mac_app_bundle("AppRTCMobile") {
366 output_name = "AppRTCMobile"
tkchin2ddfdba2016-08-07 21:37:45 -0700367
tkchin2ddfdba2016-08-07 21:37:45 -0700368 sources = [
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200369 "objc/AppRTCMobile/mac/main.m",
tkchin2ddfdba2016-08-07 21:37:45 -0700370 ]
371
372 public_configs = [ "..:common_inherited_config" ]
373
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200374 info_plist = "objc/AppRTCMobile/mac/Info.plist"
tkchin2ddfdba2016-08-07 21:37:45 -0700375
376 libs = [ "AppKit.framework" ]
377
378 deps = [
denicija77bfd7c2016-11-15 00:41:26 -0800379 ":AppRTCMobile_lib",
tkchin2ddfdba2016-08-07 21:37:45 -0700380 ]
381 }
382 }
383
384 config("socketrocket_include_config") {
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200385 include_dirs = [ "objc/AppRTCMobile/third_party/SocketRocket" ]
tkchin2ddfdba2016-08-07 21:37:45 -0700386 }
387
388 config("socketrocket_warning_config") {
389 # GN orders flags on a target before flags from configs. The default config
390 # adds these flags so to cancel them out they need to come from a config and
391 # cannot be on the target directly.
392 cflags = [
393 "-Wno-deprecated-declarations",
394 "-Wno-nonnull",
tkchin2ddfdba2016-08-07 21:37:45 -0700395 "-Wno-semicolon-before-method-body",
tkchin2ddfdba2016-08-07 21:37:45 -0700396 ]
397
henrika27d8b612016-09-21 04:13:00 -0700398 cflags_objc = [
399 # Enabled for cflags_objc in build/config/compiler/BUILD.gn.
400 "-Wno-objc-missing-property-synthesis",
henrika27d8b612016-09-21 04:13:00 -0700401 ]
tkchin2ddfdba2016-08-07 21:37:45 -0700402 }
403
kjellanderb62dbbe2016-09-23 00:38:52 -0700404 rtc_static_library("socketrocket") {
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 ]
409 configs += [
tkchin2ddfdba2016-08-07 21:37:45 -0700410 "//build/config/compiler:enable_arc",
411 ":socketrocket_warning_config",
412 ]
ehmaldonadoe9cc6862016-09-05 06:10:18 -0700413 public_configs = [ ":socketrocket_include_config" ]
tkchin2ddfdba2016-08-07 21:37:45 -0700414
415 libs = [
416 "CFNetwork.framework",
417 "icucore",
418 ]
419 }
adam.fedorbcc5d872016-11-07 14:53:28 -0800420
421 if (rtc_include_tests) {
kthelgason4065a572017-02-14 04:58:56 -0800422 # TODO(kthelgason): compile xctests on mac when chromium supports it.
423 if (is_ios) {
424 rtc_source_set("apprtcmobile_test_sources") {
425 include_dirs = [
426 "objc/AppRTCMobile",
427 "objc/AppRTCMobile/ios",
428 ]
429 testonly = true
430 sources = [
431 "objc/AppRTCMobile/tests/ARDAppClient_xctest.mm",
432 "objc/AppRTCMobile/tests/ARDSDPUtils_xctest.mm",
433 "objc/AppRTCMobile/tests/ARDSettingsModel_xctest.mm",
434 ]
435 public_deps = [
436 ":AppRTCMobile_ios_frameworks",
437 ":AppRTCMobile_lib",
438 "//build/config/ios:xctest",
439 "//third_party/ocmock",
440 ]
441 configs += [ "//build/config/compiler:enable_arc" ]
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") {
kthelgason0727f152016-08-08 09:03:23 -0700489 sources = [
490 "peerconnection/client/conductor.cc",
491 "peerconnection/client/conductor.h",
492 "peerconnection/client/defaults.cc",
493 "peerconnection/client/defaults.h",
494 "peerconnection/client/peer_connection_client.cc",
495 "peerconnection/client/peer_connection_client.h",
496 ]
ehmaldonado7a2ce0b2016-09-05 01:35:44 -0700497
kjellandere40a7ee2016-10-16 23:56:12 -0700498 if (!build_with_chromium && is_clang) {
499 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
ehmaldonado38a21322016-09-02 04:10:34 -0700500 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
kthelgason0727f152016-08-08 09:03:23 -0700501 }
502 if (is_win) {
503 sources += [
504 "peerconnection/client/flagdefs.h",
505 "peerconnection/client/main.cc",
506 "peerconnection/client/main_wnd.cc",
507 "peerconnection/client/main_wnd.h",
508 ]
509 cflags = [ "/wd4245" ]
510 configs += [ "//build/config/win:windowed" ]
511 }
thomasandersonef16e992016-12-13 02:57:43 -0800512 deps = [
513 "//third_party/libyuv",
ossu7bb87ee2017-01-23 04:56:25 -0800514 "//webrtc/pc:libjingle_peerconnection",
thomasandersonef16e992016-12-13 02:57:43 -0800515 "//webrtc/system_wrappers:field_trial_default",
516 "//webrtc/system_wrappers:metrics_default",
517 ]
kthelgason0727f152016-08-08 09:03:23 -0700518 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 ]
524 libs = [
525 "X11",
526 "Xcomposite",
527 "Xext",
528 "Xrender",
529 ]
thomasandersonef16e992016-12-13 02:57:43 -0800530 deps += [ "//build/config/linux/gtk" ]
kthelgason0727f152016-08-08 09:03:23 -0700531 }
ehmaldonadod02fe4b2016-08-26 13:31:24 -0700532 configs += [ ":peerconnection_client_warnings_config" ]
kthelgason0727f152016-08-08 09:03:23 -0700533 if (rtc_build_json) {
534 deps += [ "//third_party/jsoncpp" ]
535 }
536 }
kjellanderd4626e52016-09-07 02:33:01 -0700537
ehmaldonado38a21322016-09-02 04:10:34 -0700538 rtc_executable("peerconnection_server") {
kthelgason0727f152016-08-08 09:03:23 -0700539 sources = [
540 "peerconnection/server/data_socket.cc",
541 "peerconnection/server/data_socket.h",
542 "peerconnection/server/main.cc",
543 "peerconnection/server/peer_channel.cc",
544 "peerconnection/server/peer_channel.h",
545 "peerconnection/server/utils.cc",
546 "peerconnection/server/utils.h",
547 ]
548 deps = [
549 "//webrtc:webrtc_common",
550 "//webrtc/base:rtc_base_approved",
551 "//webrtc/tools:command_line_parser",
552 ]
kjellandere40a7ee2016-10-16 23:56:12 -0700553 if (!build_with_chromium && is_clang) {
554 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
ehmaldonado38a21322016-09-02 04:10:34 -0700555 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
kthelgason0727f152016-08-08 09:03:23 -0700556 }
557 }
ehmaldonado38a21322016-09-02 04:10:34 -0700558 rtc_executable("relayserver") {
kthelgason0727f152016-08-08 09:03:23 -0700559 sources = [
560 "relayserver/relayserver_main.cc",
561 ]
562 deps = [
563 "//webrtc/base:rtc_base_approved",
564 "//webrtc/pc:rtc_pc",
565 "//webrtc/system_wrappers:field_trial_default",
566 "//webrtc/system_wrappers:metrics_default",
567 ]
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("turnserver") {
kthelgason0727f152016-08-08 09:03:23 -0700574 sources = [
575 "turnserver/turnserver_main.cc",
576 ]
577 deps = [
578 "//webrtc/base:rtc_base_approved",
579 "//webrtc/pc:rtc_pc",
580 "//webrtc/system_wrappers:field_trial_default",
581 "//webrtc/system_wrappers:metrics_default",
582 ]
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("stunserver") {
kthelgason0727f152016-08-08 09:03:23 -0700589 sources = [
590 "stunserver/stunserver_main.cc",
591 ]
592 deps = [
593 "//webrtc/base:rtc_base_approved",
594 "//webrtc/pc:rtc_pc",
595 "//webrtc/system_wrappers:field_trial_default",
596 "//webrtc/system_wrappers:metrics_default",
597 ]
kjellandere40a7ee2016-10-16 23:56:12 -0700598 if (!build_with_chromium && is_clang) {
599 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
ehmaldonado38a21322016-09-02 04:10:34 -0700600 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
kthelgason0727f152016-08-08 09:03:23 -0700601 }
602 }
603}
charujainaca3a242016-11-01 03:09:15 -0700604
605if (!build_with_chromium) {
606 # Doesn't build within Chrome on Win.
607 rtc_executable("stun_prober") {
608 sources = [
609 "stunprober/main.cc",
610 ]
611
612 if (!build_with_chromium && is_clang) {
613 # Suppress warnings from Chrome's Clang plugins.
614 # See http://code.google.com/p/webrtc/issues/detail?id=163 for details.
615 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
616 }
617
618 deps = [
619 "../p2p:libstunprober",
620 "../p2p:rtc_p2p",
621 "../system_wrappers:field_trial_default",
622 ]
623 }
624}