blob: 0098d69781b72a4ca416a826ed4cdf85142d9cea [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",
kthelgasone47de1a2017-02-24 01:56:01 -0800396 "-Wno-unused-variable",
tkchin2ddfdba2016-08-07 21:37:45 -0700397 ]
398
henrika27d8b612016-09-21 04:13:00 -0700399 cflags_objc = [
400 # Enabled for cflags_objc in build/config/compiler/BUILD.gn.
401 "-Wno-objc-missing-property-synthesis",
kthelgasone47de1a2017-02-24 01:56:01 -0800402
403 # Hide the warning for SecRandomCopyBytes(), until we update to upstream.
404 # https://bugs.chromium.org/p/webrtc/issues/detail?id=6396
405 "-Wno-unused-result",
henrika27d8b612016-09-21 04:13:00 -0700406 ]
tkchin2ddfdba2016-08-07 21:37:45 -0700407 }
408
kjellanderb62dbbe2016-09-23 00:38:52 -0700409 rtc_static_library("socketrocket") {
tkchin2ddfdba2016-08-07 21:37:45 -0700410 sources = [
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200411 "objc/AppRTCMobile/third_party/SocketRocket/SRWebSocket.h",
412 "objc/AppRTCMobile/third_party/SocketRocket/SRWebSocket.m",
tkchin2ddfdba2016-08-07 21:37:45 -0700413 ]
414 configs += [
tkchin2ddfdba2016-08-07 21:37:45 -0700415 "//build/config/compiler:enable_arc",
416 ":socketrocket_warning_config",
417 ]
ehmaldonadoe9cc6862016-09-05 06:10:18 -0700418 public_configs = [ ":socketrocket_include_config" ]
tkchin2ddfdba2016-08-07 21:37:45 -0700419
420 libs = [
421 "CFNetwork.framework",
422 "icucore",
423 ]
424 }
adam.fedorbcc5d872016-11-07 14:53:28 -0800425
426 if (rtc_include_tests) {
kthelgason4065a572017-02-14 04:58:56 -0800427 # TODO(kthelgason): compile xctests on mac when chromium supports it.
428 if (is_ios) {
429 rtc_source_set("apprtcmobile_test_sources") {
430 include_dirs = [
431 "objc/AppRTCMobile",
432 "objc/AppRTCMobile/ios",
433 ]
434 testonly = true
435 sources = [
436 "objc/AppRTCMobile/tests/ARDAppClient_xctest.mm",
437 "objc/AppRTCMobile/tests/ARDSDPUtils_xctest.mm",
438 "objc/AppRTCMobile/tests/ARDSettingsModel_xctest.mm",
439 ]
440 public_deps = [
441 ":AppRTCMobile_ios_frameworks",
442 ":AppRTCMobile_lib",
443 "//build/config/ios:xctest",
444 "//third_party/ocmock",
445 ]
446 configs += [ "//build/config/compiler:enable_arc" ]
adam.fedorbcc5d872016-11-07 14:53:28 -0800447 }
448
kthelgason4065a572017-02-14 04:58:56 -0800449 rtc_ios_xctest_test("apprtcmobile_tests") {
450 info_plist = "objc/AppRTCMobile/ios/Info.plist"
451 sources = [
452 "objc/AppRTCMobile/ios/main.m",
453 ]
454 deps = [
455 ":apprtcmobile_test_sources",
456 ]
457 ldflags = [ "-all_load" ]
458 }
adam.fedorbcc5d872016-11-07 14:53:28 -0800459 }
460 }
tkchin2ddfdba2016-08-07 21:37:45 -0700461}
kthelgason0727f152016-08-08 09:03:23 -0700462
463if (is_linux || is_win) {
ehmaldonadod02fe4b2016-08-26 13:31:24 -0700464 config("peerconnection_client_warnings_config") {
kjellander4a9abad2016-09-18 08:12:29 -0700465 cflags = []
ehmaldonadod02fe4b2016-08-26 13:31:24 -0700466 if (is_win && is_clang) {
kjellander4a9abad2016-09-18 08:12:29 -0700467 cflags += [
ehmaldonadod02fe4b2016-08-26 13:31:24 -0700468 # Disable warnings failing when compiling with Clang on Windows.
469 # https://bugs.chromium.org/p/webrtc/issues/detail?id=5366
470 "-Wno-format",
471
472 # See https://bugs.chromium.org/p/webrtc/issues/detail?id=6271
473 # for -Wno-reorder and -Wno-sign-compare
474 "-Wno-reorder",
475 "-Wno-sign-compare",
476 ]
477 }
kjellanderd4626e52016-09-07 02:33:01 -0700478 if (is_linux && target_cpu == "x86") {
kjellander4a9abad2016-09-18 08:12:29 -0700479 cflags += [
kjellanderd4626e52016-09-07 02:33:01 -0700480 # Needed to compile on Linux 32-bit.
481 "-Wno-sentinel",
482 ]
483 }
kjellander4a9abad2016-09-18 08:12:29 -0700484
485 if (is_clang) {
486 # TODO(ehmaldonado): Make peerconnection_client compile with the standard
487 # set of warnings.
488 # See https://bugs.chromium.org/p/webrtc/issues/detail?id=6306
489 cflags += [ "-Wno-inconsistent-missing-override" ]
490 }
ehmaldonadod02fe4b2016-08-26 13:31:24 -0700491 }
492
ehmaldonado38a21322016-09-02 04:10:34 -0700493 rtc_executable("peerconnection_client") {
kthelgason0727f152016-08-08 09:03:23 -0700494 sources = [
495 "peerconnection/client/conductor.cc",
496 "peerconnection/client/conductor.h",
497 "peerconnection/client/defaults.cc",
498 "peerconnection/client/defaults.h",
499 "peerconnection/client/peer_connection_client.cc",
500 "peerconnection/client/peer_connection_client.h",
501 ]
ehmaldonado7a2ce0b2016-09-05 01:35:44 -0700502
kjellandere40a7ee2016-10-16 23:56:12 -0700503 if (!build_with_chromium && is_clang) {
504 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
ehmaldonado38a21322016-09-02 04:10:34 -0700505 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
kthelgason0727f152016-08-08 09:03:23 -0700506 }
507 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" ]
516 }
thomasandersonef16e992016-12-13 02:57:43 -0800517 deps = [
518 "//third_party/libyuv",
ossu7bb87ee2017-01-23 04:56:25 -0800519 "//webrtc/pc:libjingle_peerconnection",
thomasandersonef16e992016-12-13 02:57:43 -0800520 "//webrtc/system_wrappers:field_trial_default",
521 "//webrtc/system_wrappers:metrics_default",
522 ]
kthelgason0727f152016-08-08 09:03:23 -0700523 if (is_linux) {
524 sources += [
525 "peerconnection/client/linux/main.cc",
526 "peerconnection/client/linux/main_wnd.cc",
527 "peerconnection/client/linux/main_wnd.h",
528 ]
529 libs = [
530 "X11",
531 "Xcomposite",
532 "Xext",
533 "Xrender",
534 ]
thomasandersonef16e992016-12-13 02:57:43 -0800535 deps += [ "//build/config/linux/gtk" ]
kthelgason0727f152016-08-08 09:03:23 -0700536 }
ehmaldonadod02fe4b2016-08-26 13:31:24 -0700537 configs += [ ":peerconnection_client_warnings_config" ]
kthelgason0727f152016-08-08 09:03:23 -0700538 if (rtc_build_json) {
539 deps += [ "//third_party/jsoncpp" ]
540 }
541 }
kjellanderd4626e52016-09-07 02:33:01 -0700542
ehmaldonado38a21322016-09-02 04:10:34 -0700543 rtc_executable("peerconnection_server") {
kthelgason0727f152016-08-08 09:03:23 -0700544 sources = [
545 "peerconnection/server/data_socket.cc",
546 "peerconnection/server/data_socket.h",
547 "peerconnection/server/main.cc",
548 "peerconnection/server/peer_channel.cc",
549 "peerconnection/server/peer_channel.h",
550 "peerconnection/server/utils.cc",
551 "peerconnection/server/utils.h",
552 ]
553 deps = [
554 "//webrtc:webrtc_common",
555 "//webrtc/base:rtc_base_approved",
556 "//webrtc/tools:command_line_parser",
557 ]
kjellandere40a7ee2016-10-16 23:56:12 -0700558 if (!build_with_chromium && is_clang) {
559 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
ehmaldonado38a21322016-09-02 04:10:34 -0700560 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
kthelgason0727f152016-08-08 09:03:23 -0700561 }
562 }
ehmaldonado38a21322016-09-02 04:10:34 -0700563 rtc_executable("relayserver") {
kthelgason0727f152016-08-08 09:03:23 -0700564 sources = [
565 "relayserver/relayserver_main.cc",
566 ]
567 deps = [
568 "//webrtc/base:rtc_base_approved",
569 "//webrtc/pc:rtc_pc",
570 "//webrtc/system_wrappers:field_trial_default",
571 "//webrtc/system_wrappers:metrics_default",
572 ]
kjellandere40a7ee2016-10-16 23:56:12 -0700573 if (!build_with_chromium && is_clang) {
574 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
ehmaldonado38a21322016-09-02 04:10:34 -0700575 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
kthelgason0727f152016-08-08 09:03:23 -0700576 }
577 }
ehmaldonado38a21322016-09-02 04:10:34 -0700578 rtc_executable("turnserver") {
kthelgason0727f152016-08-08 09:03:23 -0700579 sources = [
580 "turnserver/turnserver_main.cc",
581 ]
582 deps = [
583 "//webrtc/base:rtc_base_approved",
584 "//webrtc/pc:rtc_pc",
585 "//webrtc/system_wrappers:field_trial_default",
586 "//webrtc/system_wrappers:metrics_default",
587 ]
kjellandere40a7ee2016-10-16 23:56:12 -0700588 if (!build_with_chromium && is_clang) {
589 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
ehmaldonado38a21322016-09-02 04:10:34 -0700590 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
kthelgason0727f152016-08-08 09:03:23 -0700591 }
592 }
ehmaldonado38a21322016-09-02 04:10:34 -0700593 rtc_executable("stunserver") {
kthelgason0727f152016-08-08 09:03:23 -0700594 sources = [
595 "stunserver/stunserver_main.cc",
596 ]
597 deps = [
598 "//webrtc/base:rtc_base_approved",
599 "//webrtc/pc:rtc_pc",
600 "//webrtc/system_wrappers:field_trial_default",
601 "//webrtc/system_wrappers:metrics_default",
602 ]
kjellandere40a7ee2016-10-16 23:56:12 -0700603 if (!build_with_chromium && is_clang) {
604 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
ehmaldonado38a21322016-09-02 04:10:34 -0700605 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
kthelgason0727f152016-08-08 09:03:23 -0700606 }
607 }
608}
charujainaca3a242016-11-01 03:09:15 -0700609
610if (!build_with_chromium) {
611 # Doesn't build within Chrome on Win.
612 rtc_executable("stun_prober") {
613 sources = [
614 "stunprober/main.cc",
615 ]
616
617 if (!build_with_chromium && is_clang) {
618 # Suppress warnings from Chrome's Clang plugins.
619 # See http://code.google.com/p/webrtc/issues/detail?id=163 for details.
620 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
621 }
622
623 deps = [
624 "../p2p:libstunprober",
625 "../p2p:rtc_p2p",
626 "../system_wrappers:field_trial_default",
627 ]
628 }
629}