blob: 59842fc524532742cb85c3bd98b9e89ae45f90e3 [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 ]
199 if (is_mac) {
200 cflags += [ "-Wno-partial-availability" ]
201 }
202 }
203
kjellanderb62dbbe2016-09-23 00:38:52 -0700204 rtc_static_library("apprtc_signaling") {
tkchin2ddfdba2016-08-07 21:37:45 -0700205 sources = [
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200206 "objc/AppRTCMobile/ARDAppClient+Internal.h",
207 "objc/AppRTCMobile/ARDAppClient.h",
208 "objc/AppRTCMobile/ARDAppClient.m",
209 "objc/AppRTCMobile/ARDAppEngineClient.h",
210 "objc/AppRTCMobile/ARDAppEngineClient.m",
211 "objc/AppRTCMobile/ARDBitrateTracker.h",
212 "objc/AppRTCMobile/ARDBitrateTracker.m",
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200213 "objc/AppRTCMobile/ARDJoinResponse+Internal.h",
214 "objc/AppRTCMobile/ARDJoinResponse.h",
215 "objc/AppRTCMobile/ARDJoinResponse.m",
216 "objc/AppRTCMobile/ARDMessageResponse+Internal.h",
217 "objc/AppRTCMobile/ARDMessageResponse.h",
218 "objc/AppRTCMobile/ARDMessageResponse.m",
219 "objc/AppRTCMobile/ARDRoomServerClient.h",
220 "objc/AppRTCMobile/ARDSDPUtils.h",
221 "objc/AppRTCMobile/ARDSDPUtils.m",
222 "objc/AppRTCMobile/ARDSignalingChannel.h",
223 "objc/AppRTCMobile/ARDSignalingMessage.h",
224 "objc/AppRTCMobile/ARDSignalingMessage.m",
225 "objc/AppRTCMobile/ARDStatsBuilder.h",
226 "objc/AppRTCMobile/ARDStatsBuilder.m",
kthelgasoncc882af2017-01-13 05:59:46 -0800227 "objc/AppRTCMobile/ARDTURNClient+Internal.h",
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200228 "objc/AppRTCMobile/ARDTURNClient.h",
kthelgasoncc882af2017-01-13 05:59:46 -0800229 "objc/AppRTCMobile/ARDTURNClient.m",
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200230 "objc/AppRTCMobile/ARDWebSocketChannel.h",
231 "objc/AppRTCMobile/ARDWebSocketChannel.m",
232 "objc/AppRTCMobile/RTCIceCandidate+JSON.h",
233 "objc/AppRTCMobile/RTCIceCandidate+JSON.m",
234 "objc/AppRTCMobile/RTCIceServer+JSON.h",
235 "objc/AppRTCMobile/RTCIceServer+JSON.m",
236 "objc/AppRTCMobile/RTCMediaConstraints+JSON.h",
237 "objc/AppRTCMobile/RTCMediaConstraints+JSON.m",
238 "objc/AppRTCMobile/RTCSessionDescription+JSON.h",
239 "objc/AppRTCMobile/RTCSessionDescription+JSON.m",
tkchin2ddfdba2016-08-07 21:37:45 -0700240 ]
241 configs += [
tkchin2ddfdba2016-08-07 21:37:45 -0700242 "//build/config/compiler:enable_arc",
243 ":warnings_config",
244 ]
ehmaldonadoe9cc6862016-09-05 06:10:18 -0700245 public_configs = [ ":apprtc_signaling_config" ]
tkchin2ddfdba2016-08-07 21:37:45 -0700246 deps = [
247 ":apprtc_common",
248 ":socketrocket",
249 ]
250 public_deps = [
251 "../sdk:rtc_sdk_peerconnection_objc",
252 ]
253 libs = [ "QuartzCore.framework" ]
254 }
255
256 if (is_ios) {
denicija77bfd7c2016-11-15 00:41:26 -0800257 rtc_static_library("AppRTCMobile_lib") {
tkchin2ddfdba2016-08-07 21:37:45 -0700258 sources = [
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200259 "objc/AppRTCMobile/ios/ARDAppDelegate.m",
260 "objc/AppRTCMobile/ios/ARDMainView.h",
261 "objc/AppRTCMobile/ios/ARDMainView.m",
262 "objc/AppRTCMobile/ios/ARDMainViewController.h",
263 "objc/AppRTCMobile/ios/ARDMainViewController.m",
denicija2256e042016-11-09 06:26:18 -0800264 "objc/AppRTCMobile/ios/ARDSettingsModel+Private.h",
265 "objc/AppRTCMobile/ios/ARDSettingsModel.h",
266 "objc/AppRTCMobile/ios/ARDSettingsModel.m",
267 "objc/AppRTCMobile/ios/ARDSettingsStore.h",
268 "objc/AppRTCMobile/ios/ARDSettingsStore.m",
denicijad17d5362016-11-02 02:56:09 -0700269 "objc/AppRTCMobile/ios/ARDSettingsViewController.h",
270 "objc/AppRTCMobile/ios/ARDSettingsViewController.m",
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200271 "objc/AppRTCMobile/ios/ARDStatsView.h",
272 "objc/AppRTCMobile/ios/ARDStatsView.m",
273 "objc/AppRTCMobile/ios/ARDVideoCallView.h",
274 "objc/AppRTCMobile/ios/ARDVideoCallView.m",
275 "objc/AppRTCMobile/ios/ARDVideoCallViewController.h",
276 "objc/AppRTCMobile/ios/ARDVideoCallViewController.m",
277 "objc/AppRTCMobile/ios/AppRTCMobile-Prefix.pch",
278 "objc/AppRTCMobile/ios/UIImage+ARDUtilities.h",
279 "objc/AppRTCMobile/ios/UIImage+ARDUtilities.m",
denicija77bfd7c2016-11-15 00:41:26 -0800280 ]
281 configs += [
282 "//build/config/compiler:enable_arc",
283 ":warnings_config",
284 ]
285
286 deps = [
287 ":apprtc_common",
288 ":apprtc_signaling",
289 ]
290 }
291
292 ios_app_bundle("AppRTCMobile") {
293 sources = [
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200294 "objc/AppRTCMobile/ios/main.m",
tkchin2ddfdba2016-08-07 21:37:45 -0700295 ]
296
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200297 info_plist = "objc/AppRTCMobile/ios/Info.plist"
tkchin2ddfdba2016-08-07 21:37:45 -0700298
denicija77bfd7c2016-11-15 00:41:26 -0800299 configs += [ "..:common_config" ]
tkchin2ddfdba2016-08-07 21:37:45 -0700300 public_configs = [ "..:common_inherited_config" ]
301
302 deps = [
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200303 ":AppRTCMobile_ios_bundle_data",
kthelgasond3adbfb2017-01-26 01:14:04 -0800304 ":AppRTCMobile_ios_frameworks",
denicija77bfd7c2016-11-15 00:41:26 -0800305 ":AppRTCMobile_lib",
tkchin2ddfdba2016-08-07 21:37:45 -0700306 ]
307
308 if (target_cpu == "x86") {
309 deps += [ "//testing/iossim:iossim" ]
310 }
311 }
312
kthelgasond3adbfb2017-01-26 01:14:04 -0800313 bundle_data("AppRTCMobile_ios_frameworks") {
314 public_deps = [
315 "//webrtc/sdk:rtc_sdk_framework_objc+link",
316 ]
317 sources = [
318 "$root_out_dir/WebRTC.framework",
319 ]
320 outputs = [
321 "{{bundle_resources_dir}}/Frameworks/{{source_file_part}}",
322 ]
323 }
324
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200325 bundle_data("AppRTCMobile_ios_bundle_data") {
tkchin2ddfdba2016-08-07 21:37:45 -0700326 sources = [
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200327 "objc/AppRTCMobile/ios/resources/Roboto-Regular.ttf",
328 "objc/AppRTCMobile/ios/resources/iPhone5@2x.png",
329 "objc/AppRTCMobile/ios/resources/iPhone6@2x.png",
330 "objc/AppRTCMobile/ios/resources/iPhone6p@3x.png",
331 "objc/AppRTCMobile/ios/resources/ic_call_end_black_24dp.png",
332 "objc/AppRTCMobile/ios/resources/ic_call_end_black_24dp@2x.png",
333 "objc/AppRTCMobile/ios/resources/ic_clear_black_24dp.png",
334 "objc/AppRTCMobile/ios/resources/ic_clear_black_24dp@2x.png",
denicija6d6762c2016-10-28 04:53:16 -0700335 "objc/AppRTCMobile/ios/resources/ic_settings_black_24dp.png",
336 "objc/AppRTCMobile/ios/resources/ic_settings_black_24dp@2x.png",
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200337 "objc/AppRTCMobile/ios/resources/ic_surround_sound_black_24dp.png",
338 "objc/AppRTCMobile/ios/resources/ic_surround_sound_black_24dp@2x.png",
339 "objc/AppRTCMobile/ios/resources/ic_switch_video_black_24dp.png",
340 "objc/AppRTCMobile/ios/resources/ic_switch_video_black_24dp@2x.png",
341 "objc/AppRTCMobile/ios/resources/mozart.mp3",
tkchin2ddfdba2016-08-07 21:37:45 -0700342 "objc/Icon.png",
343 ]
344 outputs = [
345 "{{bundle_resources_dir}}/{{source_file_part}}",
346 ]
347 }
348 }
349
350 if (is_mac) {
denicija77bfd7c2016-11-15 00:41:26 -0800351 rtc_static_library("AppRTCMobile_lib") {
tkchin2ddfdba2016-08-07 21:37:45 -0700352 sources = [
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200353 "objc/AppRTCMobile/mac/APPRTCAppDelegate.h",
354 "objc/AppRTCMobile/mac/APPRTCAppDelegate.m",
355 "objc/AppRTCMobile/mac/APPRTCViewController.h",
356 "objc/AppRTCMobile/mac/APPRTCViewController.m",
tkchin2ddfdba2016-08-07 21:37:45 -0700357 ]
358 configs += [
tkchin2ddfdba2016-08-07 21:37:45 -0700359 "..:common_objc",
360 "//build/config/compiler:enable_arc",
361 ]
362 deps = [
363 ":apprtc_common",
364 ":apprtc_signaling",
365 ]
366 }
367
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200368 mac_app_bundle("AppRTCMobile") {
369 output_name = "AppRTCMobile"
tkchin2ddfdba2016-08-07 21:37:45 -0700370
371 extra_substitutions = [ "MACOSX_DEPLOYMENT_TARGET=10.8" ]
372
373 sources = [
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200374 "objc/AppRTCMobile/mac/main.m",
tkchin2ddfdba2016-08-07 21:37:45 -0700375 ]
376
377 public_configs = [ "..:common_inherited_config" ]
378
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200379 info_plist = "objc/AppRTCMobile/mac/Info.plist"
tkchin2ddfdba2016-08-07 21:37:45 -0700380
381 libs = [ "AppKit.framework" ]
382
383 deps = [
denicija77bfd7c2016-11-15 00:41:26 -0800384 ":AppRTCMobile_lib",
tkchin2ddfdba2016-08-07 21:37:45 -0700385 ]
386 }
387 }
388
389 config("socketrocket_include_config") {
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200390 include_dirs = [ "objc/AppRTCMobile/third_party/SocketRocket" ]
tkchin2ddfdba2016-08-07 21:37:45 -0700391 }
392
393 config("socketrocket_warning_config") {
394 # GN orders flags on a target before flags from configs. The default config
395 # adds these flags so to cancel them out they need to come from a config and
396 # cannot be on the target directly.
397 cflags = [
398 "-Wno-deprecated-declarations",
399 "-Wno-nonnull",
tkchin2ddfdba2016-08-07 21:37:45 -0700400 "-Wno-semicolon-before-method-body",
401 "-Wno-unused-variable",
402 ]
403
henrika27d8b612016-09-21 04:13:00 -0700404 cflags_objc = [
405 # Enabled for cflags_objc in build/config/compiler/BUILD.gn.
406 "-Wno-objc-missing-property-synthesis",
407
408 # Hide the warning for SecRandomCopyBytes(), until we update to upstream.
409 # https://bugs.chromium.org/p/webrtc/issues/detail?id=6396
410 "-Wno-unused-result",
411 ]
tkchin2ddfdba2016-08-07 21:37:45 -0700412
413 if (is_mac) {
414 cflags += [ "-Wno-partial-availability" ]
415 }
416 }
417
kjellanderb62dbbe2016-09-23 00:38:52 -0700418 rtc_static_library("socketrocket") {
tkchin2ddfdba2016-08-07 21:37:45 -0700419 sources = [
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200420 "objc/AppRTCMobile/third_party/SocketRocket/SRWebSocket.h",
421 "objc/AppRTCMobile/third_party/SocketRocket/SRWebSocket.m",
tkchin2ddfdba2016-08-07 21:37:45 -0700422 ]
423 configs += [
tkchin2ddfdba2016-08-07 21:37:45 -0700424 "//build/config/compiler:enable_arc",
425 ":socketrocket_warning_config",
426 ]
ehmaldonadoe9cc6862016-09-05 06:10:18 -0700427 public_configs = [ ":socketrocket_include_config" ]
tkchin2ddfdba2016-08-07 21:37:45 -0700428
429 libs = [
430 "CFNetwork.framework",
431 "icucore",
432 ]
433 }
adam.fedorbcc5d872016-11-07 14:53:28 -0800434
435 if (rtc_include_tests) {
436 config("rtc_apprtcmobile_config") {
437 defines = [ "GTEST_RELATIVE_PATH" ]
438 }
439
440 rtc_test("apprtcmobile_tests") {
denicija77bfd7c2016-11-15 00:41:26 -0800441 include_dirs = [ "objc/AppRTCMobile/ios" ]
adam.fedorbcc5d872016-11-07 14:53:28 -0800442 deps = [
denicija77bfd7c2016-11-15 00:41:26 -0800443 ":AppRTCMobile_lib",
adam.fedorbcc5d872016-11-07 14:53:28 -0800444 ":apprtc_signaling",
445 "//testing/gtest",
446 "//third_party/ocmock",
447 ]
448
449 sources = [
450 "objc/AppRTCMobile/tests/ARDAppClientTest.mm",
denicija77bfd7c2016-11-15 00:41:26 -0800451 "objc/AppRTCMobile/tests/ARDSettingsModelTests.mm",
adam.fedorbcc5d872016-11-07 14:53:28 -0800452 ]
453
454 if (is_ios) {
455 info_plist = "objc/AppRTCMobile/ios/Info.plist"
456 }
457
458 configs += [
459 ":rtc_apprtcmobile_config",
460 "//build/config/compiler:enable_arc",
461 ]
462 }
463 }
tkchin2ddfdba2016-08-07 21:37:45 -0700464}
kthelgason0727f152016-08-08 09:03:23 -0700465
466if (is_linux || is_win) {
ehmaldonadod02fe4b2016-08-26 13:31:24 -0700467 config("peerconnection_client_warnings_config") {
kjellander4a9abad2016-09-18 08:12:29 -0700468 cflags = []
ehmaldonadod02fe4b2016-08-26 13:31:24 -0700469 if (is_win && is_clang) {
kjellander4a9abad2016-09-18 08:12:29 -0700470 cflags += [
ehmaldonadod02fe4b2016-08-26 13:31:24 -0700471 # Disable warnings failing when compiling with Clang on Windows.
472 # https://bugs.chromium.org/p/webrtc/issues/detail?id=5366
473 "-Wno-format",
474
475 # See https://bugs.chromium.org/p/webrtc/issues/detail?id=6271
476 # for -Wno-reorder and -Wno-sign-compare
477 "-Wno-reorder",
478 "-Wno-sign-compare",
479 ]
480 }
kjellanderd4626e52016-09-07 02:33:01 -0700481 if (is_linux && target_cpu == "x86") {
kjellander4a9abad2016-09-18 08:12:29 -0700482 cflags += [
kjellanderd4626e52016-09-07 02:33:01 -0700483 # Needed to compile on Linux 32-bit.
484 "-Wno-sentinel",
485 ]
486 }
kjellander4a9abad2016-09-18 08:12:29 -0700487
488 if (is_clang) {
489 # TODO(ehmaldonado): Make peerconnection_client compile with the standard
490 # set of warnings.
491 # See https://bugs.chromium.org/p/webrtc/issues/detail?id=6306
492 cflags += [ "-Wno-inconsistent-missing-override" ]
493 }
ehmaldonadod02fe4b2016-08-26 13:31:24 -0700494 }
495
ehmaldonado38a21322016-09-02 04:10:34 -0700496 rtc_executable("peerconnection_client") {
kthelgason0727f152016-08-08 09:03:23 -0700497 sources = [
498 "peerconnection/client/conductor.cc",
499 "peerconnection/client/conductor.h",
500 "peerconnection/client/defaults.cc",
501 "peerconnection/client/defaults.h",
502 "peerconnection/client/peer_connection_client.cc",
503 "peerconnection/client/peer_connection_client.h",
504 ]
ehmaldonado7a2ce0b2016-09-05 01:35:44 -0700505
kjellandere40a7ee2016-10-16 23:56:12 -0700506 if (!build_with_chromium && is_clang) {
507 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
ehmaldonado38a21322016-09-02 04:10:34 -0700508 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
kthelgason0727f152016-08-08 09:03:23 -0700509 }
510 if (is_win) {
511 sources += [
512 "peerconnection/client/flagdefs.h",
513 "peerconnection/client/main.cc",
514 "peerconnection/client/main_wnd.cc",
515 "peerconnection/client/main_wnd.h",
516 ]
517 cflags = [ "/wd4245" ]
518 configs += [ "//build/config/win:windowed" ]
519 }
thomasandersonef16e992016-12-13 02:57:43 -0800520 deps = [
521 "//third_party/libyuv",
ossu7bb87ee2017-01-23 04:56:25 -0800522 "//webrtc/pc:libjingle_peerconnection",
thomasandersonef16e992016-12-13 02:57:43 -0800523 "//webrtc/system_wrappers:field_trial_default",
524 "//webrtc/system_wrappers:metrics_default",
525 ]
kthelgason0727f152016-08-08 09:03:23 -0700526 if (is_linux) {
527 sources += [
528 "peerconnection/client/linux/main.cc",
529 "peerconnection/client/linux/main_wnd.cc",
530 "peerconnection/client/linux/main_wnd.h",
531 ]
532 libs = [
533 "X11",
534 "Xcomposite",
535 "Xext",
536 "Xrender",
537 ]
thomasandersonef16e992016-12-13 02:57:43 -0800538 deps += [ "//build/config/linux/gtk" ]
kthelgason0727f152016-08-08 09:03:23 -0700539 }
ehmaldonadod02fe4b2016-08-26 13:31:24 -0700540 configs += [ ":peerconnection_client_warnings_config" ]
kthelgason0727f152016-08-08 09:03:23 -0700541 if (rtc_build_json) {
542 deps += [ "//third_party/jsoncpp" ]
543 }
544 }
kjellanderd4626e52016-09-07 02:33:01 -0700545
ehmaldonado38a21322016-09-02 04:10:34 -0700546 rtc_executable("peerconnection_server") {
kthelgason0727f152016-08-08 09:03:23 -0700547 sources = [
548 "peerconnection/server/data_socket.cc",
549 "peerconnection/server/data_socket.h",
550 "peerconnection/server/main.cc",
551 "peerconnection/server/peer_channel.cc",
552 "peerconnection/server/peer_channel.h",
553 "peerconnection/server/utils.cc",
554 "peerconnection/server/utils.h",
555 ]
556 deps = [
557 "//webrtc:webrtc_common",
558 "//webrtc/base:rtc_base_approved",
559 "//webrtc/tools:command_line_parser",
560 ]
kjellandere40a7ee2016-10-16 23:56:12 -0700561 if (!build_with_chromium && is_clang) {
562 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
ehmaldonado38a21322016-09-02 04:10:34 -0700563 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
kthelgason0727f152016-08-08 09:03:23 -0700564 }
565 }
ehmaldonado38a21322016-09-02 04:10:34 -0700566 rtc_executable("relayserver") {
kthelgason0727f152016-08-08 09:03:23 -0700567 sources = [
568 "relayserver/relayserver_main.cc",
569 ]
570 deps = [
571 "//webrtc/base:rtc_base_approved",
572 "//webrtc/pc:rtc_pc",
573 "//webrtc/system_wrappers:field_trial_default",
574 "//webrtc/system_wrappers:metrics_default",
575 ]
kjellandere40a7ee2016-10-16 23:56:12 -0700576 if (!build_with_chromium && is_clang) {
577 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
ehmaldonado38a21322016-09-02 04:10:34 -0700578 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
kthelgason0727f152016-08-08 09:03:23 -0700579 }
580 }
ehmaldonado38a21322016-09-02 04:10:34 -0700581 rtc_executable("turnserver") {
kthelgason0727f152016-08-08 09:03:23 -0700582 sources = [
583 "turnserver/turnserver_main.cc",
584 ]
585 deps = [
586 "//webrtc/base:rtc_base_approved",
587 "//webrtc/pc:rtc_pc",
588 "//webrtc/system_wrappers:field_trial_default",
589 "//webrtc/system_wrappers:metrics_default",
590 ]
kjellandere40a7ee2016-10-16 23:56:12 -0700591 if (!build_with_chromium && is_clang) {
592 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
ehmaldonado38a21322016-09-02 04:10:34 -0700593 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
kthelgason0727f152016-08-08 09:03:23 -0700594 }
595 }
ehmaldonado38a21322016-09-02 04:10:34 -0700596 rtc_executable("stunserver") {
kthelgason0727f152016-08-08 09:03:23 -0700597 sources = [
598 "stunserver/stunserver_main.cc",
599 ]
600 deps = [
601 "//webrtc/base:rtc_base_approved",
602 "//webrtc/pc:rtc_pc",
603 "//webrtc/system_wrappers:field_trial_default",
604 "//webrtc/system_wrappers:metrics_default",
605 ]
kjellandere40a7ee2016-10-16 23:56:12 -0700606 if (!build_with_chromium && is_clang) {
607 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
ehmaldonado38a21322016-09-02 04:10:34 -0700608 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
kthelgason0727f152016-08-08 09:03:23 -0700609 }
610 }
611}
charujainaca3a242016-11-01 03:09:15 -0700612
613if (!build_with_chromium) {
614 # Doesn't build within Chrome on Win.
615 rtc_executable("stun_prober") {
616 sources = [
617 "stunprober/main.cc",
618 ]
619
620 if (!build_with_chromium && is_clang) {
621 # Suppress warnings from Chrome's Clang plugins.
622 # See http://code.google.com/p/webrtc/issues/detail?id=163 for details.
623 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
624 }
625
626 deps = [
627 "../p2p:libstunprober",
628 "../p2p:rtc_p2p",
629 "../system_wrappers:field_trial_default",
630 ]
631 }
632}