blob: 3ee9ae5e9fd3648c1f7a8c35d2f4e50dc6e0af3e [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") {
Sami Kalliomaki9c0c75b2016-06-29 14:55:00 +020067 java_files = [
68 "androidapp/src/org/appspot/apprtc/AppRTCAudioManager.java",
henrikac3c2f312016-12-14 07:36:56 -080069 "androidapp/src/org/appspot/apprtc/AppRTCBluetoothManager.java",
Sami Kalliomaki9c0c75b2016-06-29 14:55:00 +020070 "androidapp/src/org/appspot/apprtc/AppRTCClient.java",
71 "androidapp/src/org/appspot/apprtc/AppRTCProximitySensor.java",
72 "androidapp/src/org/appspot/apprtc/CallActivity.java",
73 "androidapp/src/org/appspot/apprtc/CallFragment.java",
74 "androidapp/src/org/appspot/apprtc/CaptureQualityController.java",
75 "androidapp/src/org/appspot/apprtc/ConnectActivity.java",
76 "androidapp/src/org/appspot/apprtc/CpuMonitor.java",
77 "androidapp/src/org/appspot/apprtc/DirectRTCClient.java",
78 "androidapp/src/org/appspot/apprtc/HudFragment.java",
79 "androidapp/src/org/appspot/apprtc/PeerConnectionClient.java",
80 "androidapp/src/org/appspot/apprtc/PercentFrameLayout.java",
81 "androidapp/src/org/appspot/apprtc/RoomParametersFetcher.java",
82 "androidapp/src/org/appspot/apprtc/SettingsActivity.java",
83 "androidapp/src/org/appspot/apprtc/SettingsFragment.java",
84 "androidapp/src/org/appspot/apprtc/TCPChannelClient.java",
85 "androidapp/src/org/appspot/apprtc/UnhandledExceptionHandler.java",
86 "androidapp/src/org/appspot/apprtc/WebSocketChannelClient.java",
87 "androidapp/src/org/appspot/apprtc/WebSocketRTCClient.java",
88 "androidapp/src/org/appspot/apprtc/util/AppRTCUtils.java",
89 "androidapp/src/org/appspot/apprtc/util/AsyncHttpURLConnection.java",
Sami Kalliomaki9c0c75b2016-06-29 14:55:00 +020090 ]
91
92 deps = [
Magnus Jedvertc1815cf2016-09-27 10:10:41 +020093 ":AppRTCMobile_resources",
Sami Kalliomaki9c0c75b2016-06-29 14:55:00 +020094 "//webrtc/base:base_java",
95 "//webrtc/examples/androidapp/third_party/autobanh:autobanh_java",
mbonadeib55bd972017-01-23 01:25:53 -080096 "//webrtc/modules/audio_device:audio_device_java",
magjed768c6482016-12-06 04:29:37 -080097 "//webrtc/sdk/android:libjingle_peerconnection_java",
98 "//webrtc/sdk/android:libjingle_peerconnection_metrics_default_java",
Sami Kalliomaki9c0c75b2016-06-29 14:55:00 +020099 ]
100 }
101
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200102 android_resources("AppRTCMobile_resources") {
Sami Kalliomaki9c0c75b2016-06-29 14:55:00 +0200103 resource_dirs = [ "androidapp/res" ]
104 custom_package = "org.appspot.apprtc"
105 }
106
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200107 instrumentation_test_apk("AppRTCMobileTest") {
108 apk_name = "AppRTCMobileTest"
Sami Kalliomaki9c0c75b2016-06-29 14:55:00 +0200109 android_manifest = "androidtests/AndroidManifest.xml"
110
sakale8aca242017-01-17 03:32:06 -0800111 java_files = [ "androidtests/src/org/appspot/apprtc/test/PeerConnectionClientTest.java" ]
Sami Kalliomaki9c0c75b2016-06-29 14:55:00 +0200112
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200113 apk_under_test = ":AppRTCMobile"
Sami Kalliomaki9c0c75b2016-06-29 14:55:00 +0200114
115 deps = [
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200116 ":AppRTCMobile_javalib",
sakalcb79d512017-01-11 06:21:26 -0800117 "//base:base_java_test_support",
118 "//third_party/android_support_test_runner:runner_java",
119 "//third_party/junit",
magjed768c6482016-12-06 04:29:37 -0800120 "//webrtc/sdk/android:libjingle_peerconnection_java",
Sami Kalliomaki9c0c75b2016-06-29 14:55:00 +0200121 ]
122 }
mandermoa6069e82017-01-16 02:23:09 -0800123
124 instrumentation_test_apk("AppRTCMobileTestStubbedVideoIO") {
125 apk_name = "AppRTCMobileTestStubbedVideoIO"
126 android_manifest = "androidtests/AndroidManifest.xml"
127
128 java_files = [ "androidtests/src/org/appspot/apprtc/test/ConnectActivityStubbedInputOutputTest.java" ]
129
130 apk_under_test = ":AppRTCMobile"
131
132 deps = [
133 ":AppRTCMobile_javalib",
134 "//third_party/android_support_test_runner:rules_java",
135 "//third_party/android_support_test_runner:runner_java",
136 "//third_party/espresso:espresso_all_java",
137 "//third_party/hamcrest:hamcrest_java",
138 "//third_party/junit",
139 "//webrtc/sdk/android:libjingle_peerconnection_java",
140 ]
141
142 data = [
143 "//resources/reference_video_640x360_30fps.y4m",
144 ]
145 }
Sami Kalliomaki9c0c75b2016-06-29 14:55:00 +0200146}
tkchin2ddfdba2016-08-07 21:37:45 -0700147
148if (is_ios || (is_mac && target_cpu != "x86")) {
149 config("warnings_config") {
150 # GN orders flags on a target before flags from configs. The default config
151 # adds these flags so to cancel them out they need to come from a config and
152 # cannot be on the target directly.
153 if (is_ios) {
154 # Suppress compiler warnings about deprecated that triggered
155 # when moving from ios_deployment_target 7.0 to 9.0.
156 # See webrtc:5549 for more details.
157 cflags = [ "-Wno-deprecated-declarations" ]
Henrik Kjellander91a57592016-10-12 20:25:34 -0700158 cflags_objc = [
159 # Enabled for cflags_objc in build/config/compiler/BUILD.gn.
160 # See webrtc:6520.
161 "-Wno-objc-missing-property-synthesis",
162 ]
tkchin2ddfdba2016-08-07 21:37:45 -0700163 }
164 }
165
166 config("apprtc_common_config") {
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200167 include_dirs = [ "objc/AppRTCMobile/common" ]
tkchin2ddfdba2016-08-07 21:37:45 -0700168 }
169
kjellanderb62dbbe2016-09-23 00:38:52 -0700170 rtc_static_library("apprtc_common") {
tkchin2ddfdba2016-08-07 21:37:45 -0700171 sources = [
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200172 "objc/AppRTCMobile/common/ARDUtilities.h",
173 "objc/AppRTCMobile/common/ARDUtilities.m",
tkchin2ddfdba2016-08-07 21:37:45 -0700174 ]
175 configs += [
tkchin2ddfdba2016-08-07 21:37:45 -0700176 ":warnings_config",
177 "//build/config/compiler:enable_arc",
178 ]
ehmaldonadoe9cc6862016-09-05 06:10:18 -0700179 public_configs = [ ":apprtc_common_config" ]
tkchin2ddfdba2016-08-07 21:37:45 -0700180
181 deps = [
182 "../sdk:rtc_sdk_common_objc",
183 "../system_wrappers:field_trial_default",
184 "../system_wrappers:metrics_default",
185 ]
186 }
187
188 config("apprtc_signaling_config") {
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200189 include_dirs = [ "objc/AppRTCMobile" ]
tkchin2ddfdba2016-08-07 21:37:45 -0700190
191 # GN orders flags on a target before flags from configs. The default config
192 # adds these flags so to cancel them out they need to come from a config and
193 # cannot be on the target directly.
194 cflags = [
195 "-Wno-sign-compare",
196 "-Wno-unused-variable",
197 ]
198 if (is_mac) {
199 cflags += [ "-Wno-partial-availability" ]
200 }
201 }
202
kjellanderb62dbbe2016-09-23 00:38:52 -0700203 rtc_static_library("apprtc_signaling") {
tkchin2ddfdba2016-08-07 21:37:45 -0700204 sources = [
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200205 "objc/AppRTCMobile/ARDAppClient+Internal.h",
206 "objc/AppRTCMobile/ARDAppClient.h",
207 "objc/AppRTCMobile/ARDAppClient.m",
208 "objc/AppRTCMobile/ARDAppEngineClient.h",
209 "objc/AppRTCMobile/ARDAppEngineClient.m",
210 "objc/AppRTCMobile/ARDBitrateTracker.h",
211 "objc/AppRTCMobile/ARDBitrateTracker.m",
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200212 "objc/AppRTCMobile/ARDJoinResponse+Internal.h",
213 "objc/AppRTCMobile/ARDJoinResponse.h",
214 "objc/AppRTCMobile/ARDJoinResponse.m",
215 "objc/AppRTCMobile/ARDMessageResponse+Internal.h",
216 "objc/AppRTCMobile/ARDMessageResponse.h",
217 "objc/AppRTCMobile/ARDMessageResponse.m",
218 "objc/AppRTCMobile/ARDRoomServerClient.h",
219 "objc/AppRTCMobile/ARDSDPUtils.h",
220 "objc/AppRTCMobile/ARDSDPUtils.m",
221 "objc/AppRTCMobile/ARDSignalingChannel.h",
222 "objc/AppRTCMobile/ARDSignalingMessage.h",
223 "objc/AppRTCMobile/ARDSignalingMessage.m",
224 "objc/AppRTCMobile/ARDStatsBuilder.h",
225 "objc/AppRTCMobile/ARDStatsBuilder.m",
kthelgasoncc882af2017-01-13 05:59:46 -0800226 "objc/AppRTCMobile/ARDTURNClient+Internal.h",
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200227 "objc/AppRTCMobile/ARDTURNClient.h",
kthelgasoncc882af2017-01-13 05:59:46 -0800228 "objc/AppRTCMobile/ARDTURNClient.m",
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200229 "objc/AppRTCMobile/ARDWebSocketChannel.h",
230 "objc/AppRTCMobile/ARDWebSocketChannel.m",
231 "objc/AppRTCMobile/RTCIceCandidate+JSON.h",
232 "objc/AppRTCMobile/RTCIceCandidate+JSON.m",
233 "objc/AppRTCMobile/RTCIceServer+JSON.h",
234 "objc/AppRTCMobile/RTCIceServer+JSON.m",
235 "objc/AppRTCMobile/RTCMediaConstraints+JSON.h",
236 "objc/AppRTCMobile/RTCMediaConstraints+JSON.m",
237 "objc/AppRTCMobile/RTCSessionDescription+JSON.h",
238 "objc/AppRTCMobile/RTCSessionDescription+JSON.m",
tkchin2ddfdba2016-08-07 21:37:45 -0700239 ]
240 configs += [
tkchin2ddfdba2016-08-07 21:37:45 -0700241 "//build/config/compiler:enable_arc",
242 ":warnings_config",
243 ]
ehmaldonadoe9cc6862016-09-05 06:10:18 -0700244 public_configs = [ ":apprtc_signaling_config" ]
tkchin2ddfdba2016-08-07 21:37:45 -0700245 deps = [
246 ":apprtc_common",
247 ":socketrocket",
248 ]
249 public_deps = [
250 "../sdk:rtc_sdk_peerconnection_objc",
251 ]
252 libs = [ "QuartzCore.framework" ]
253 }
254
255 if (is_ios) {
denicija77bfd7c2016-11-15 00:41:26 -0800256 rtc_static_library("AppRTCMobile_lib") {
tkchin2ddfdba2016-08-07 21:37:45 -0700257 sources = [
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200258 "objc/AppRTCMobile/ios/ARDAppDelegate.m",
259 "objc/AppRTCMobile/ios/ARDMainView.h",
260 "objc/AppRTCMobile/ios/ARDMainView.m",
261 "objc/AppRTCMobile/ios/ARDMainViewController.h",
262 "objc/AppRTCMobile/ios/ARDMainViewController.m",
denicija2256e042016-11-09 06:26:18 -0800263 "objc/AppRTCMobile/ios/ARDSettingsModel+Private.h",
264 "objc/AppRTCMobile/ios/ARDSettingsModel.h",
265 "objc/AppRTCMobile/ios/ARDSettingsModel.m",
266 "objc/AppRTCMobile/ios/ARDSettingsStore.h",
267 "objc/AppRTCMobile/ios/ARDSettingsStore.m",
denicijad17d5362016-11-02 02:56:09 -0700268 "objc/AppRTCMobile/ios/ARDSettingsViewController.h",
269 "objc/AppRTCMobile/ios/ARDSettingsViewController.m",
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200270 "objc/AppRTCMobile/ios/ARDStatsView.h",
271 "objc/AppRTCMobile/ios/ARDStatsView.m",
272 "objc/AppRTCMobile/ios/ARDVideoCallView.h",
273 "objc/AppRTCMobile/ios/ARDVideoCallView.m",
274 "objc/AppRTCMobile/ios/ARDVideoCallViewController.h",
275 "objc/AppRTCMobile/ios/ARDVideoCallViewController.m",
276 "objc/AppRTCMobile/ios/AppRTCMobile-Prefix.pch",
277 "objc/AppRTCMobile/ios/UIImage+ARDUtilities.h",
278 "objc/AppRTCMobile/ios/UIImage+ARDUtilities.m",
denicija77bfd7c2016-11-15 00:41:26 -0800279 ]
280 configs += [
281 "//build/config/compiler:enable_arc",
282 ":warnings_config",
283 ]
284
285 deps = [
286 ":apprtc_common",
287 ":apprtc_signaling",
288 ]
289 }
290
291 ios_app_bundle("AppRTCMobile") {
292 sources = [
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200293 "objc/AppRTCMobile/ios/main.m",
tkchin2ddfdba2016-08-07 21:37:45 -0700294 ]
295
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200296 info_plist = "objc/AppRTCMobile/ios/Info.plist"
tkchin2ddfdba2016-08-07 21:37:45 -0700297
denicija77bfd7c2016-11-15 00:41:26 -0800298 configs += [ "..:common_config" ]
tkchin2ddfdba2016-08-07 21:37:45 -0700299 public_configs = [ "..:common_inherited_config" ]
300
301 deps = [
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200302 ":AppRTCMobile_ios_bundle_data",
kthelgasond3adbfb2017-01-26 01:14:04 -0800303 ":AppRTCMobile_ios_frameworks",
denicija77bfd7c2016-11-15 00:41:26 -0800304 ":AppRTCMobile_lib",
tkchin2ddfdba2016-08-07 21:37:45 -0700305 ]
306
307 if (target_cpu == "x86") {
308 deps += [ "//testing/iossim:iossim" ]
309 }
310 }
311
kthelgasond3adbfb2017-01-26 01:14:04 -0800312 bundle_data("AppRTCMobile_ios_frameworks") {
313 public_deps = [
314 "//webrtc/sdk:rtc_sdk_framework_objc+link",
315 ]
316 sources = [
317 "$root_out_dir/WebRTC.framework",
318 ]
319 outputs = [
320 "{{bundle_resources_dir}}/Frameworks/{{source_file_part}}",
321 ]
322 }
323
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200324 bundle_data("AppRTCMobile_ios_bundle_data") {
tkchin2ddfdba2016-08-07 21:37:45 -0700325 sources = [
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200326 "objc/AppRTCMobile/ios/resources/Roboto-Regular.ttf",
327 "objc/AppRTCMobile/ios/resources/iPhone5@2x.png",
328 "objc/AppRTCMobile/ios/resources/iPhone6@2x.png",
329 "objc/AppRTCMobile/ios/resources/iPhone6p@3x.png",
330 "objc/AppRTCMobile/ios/resources/ic_call_end_black_24dp.png",
331 "objc/AppRTCMobile/ios/resources/ic_call_end_black_24dp@2x.png",
332 "objc/AppRTCMobile/ios/resources/ic_clear_black_24dp.png",
333 "objc/AppRTCMobile/ios/resources/ic_clear_black_24dp@2x.png",
denicija6d6762c2016-10-28 04:53:16 -0700334 "objc/AppRTCMobile/ios/resources/ic_settings_black_24dp.png",
335 "objc/AppRTCMobile/ios/resources/ic_settings_black_24dp@2x.png",
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200336 "objc/AppRTCMobile/ios/resources/ic_surround_sound_black_24dp.png",
337 "objc/AppRTCMobile/ios/resources/ic_surround_sound_black_24dp@2x.png",
338 "objc/AppRTCMobile/ios/resources/ic_switch_video_black_24dp.png",
339 "objc/AppRTCMobile/ios/resources/ic_switch_video_black_24dp@2x.png",
340 "objc/AppRTCMobile/ios/resources/mozart.mp3",
tkchin2ddfdba2016-08-07 21:37:45 -0700341 "objc/Icon.png",
342 ]
343 outputs = [
344 "{{bundle_resources_dir}}/{{source_file_part}}",
345 ]
346 }
347 }
348
349 if (is_mac) {
denicija77bfd7c2016-11-15 00:41:26 -0800350 rtc_static_library("AppRTCMobile_lib") {
tkchin2ddfdba2016-08-07 21:37:45 -0700351 sources = [
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200352 "objc/AppRTCMobile/mac/APPRTCAppDelegate.h",
353 "objc/AppRTCMobile/mac/APPRTCAppDelegate.m",
354 "objc/AppRTCMobile/mac/APPRTCViewController.h",
355 "objc/AppRTCMobile/mac/APPRTCViewController.m",
tkchin2ddfdba2016-08-07 21:37:45 -0700356 ]
357 configs += [
tkchin2ddfdba2016-08-07 21:37:45 -0700358 "..:common_objc",
359 "//build/config/compiler:enable_arc",
360 ]
361 deps = [
362 ":apprtc_common",
363 ":apprtc_signaling",
364 ]
365 }
366
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200367 mac_app_bundle("AppRTCMobile") {
368 output_name = "AppRTCMobile"
tkchin2ddfdba2016-08-07 21:37:45 -0700369
370 extra_substitutions = [ "MACOSX_DEPLOYMENT_TARGET=10.8" ]
371
372 sources = [
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200373 "objc/AppRTCMobile/mac/main.m",
tkchin2ddfdba2016-08-07 21:37:45 -0700374 ]
375
376 public_configs = [ "..:common_inherited_config" ]
377
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200378 info_plist = "objc/AppRTCMobile/mac/Info.plist"
tkchin2ddfdba2016-08-07 21:37:45 -0700379
380 libs = [ "AppKit.framework" ]
381
382 deps = [
denicija77bfd7c2016-11-15 00:41:26 -0800383 ":AppRTCMobile_lib",
tkchin2ddfdba2016-08-07 21:37:45 -0700384 ]
385 }
386 }
387
388 config("socketrocket_include_config") {
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200389 include_dirs = [ "objc/AppRTCMobile/third_party/SocketRocket" ]
tkchin2ddfdba2016-08-07 21:37:45 -0700390 }
391
392 config("socketrocket_warning_config") {
393 # GN orders flags on a target before flags from configs. The default config
394 # adds these flags so to cancel them out they need to come from a config and
395 # cannot be on the target directly.
396 cflags = [
397 "-Wno-deprecated-declarations",
398 "-Wno-nonnull",
tkchin2ddfdba2016-08-07 21:37:45 -0700399 "-Wno-semicolon-before-method-body",
400 "-Wno-unused-variable",
401 ]
402
henrika27d8b612016-09-21 04:13:00 -0700403 cflags_objc = [
404 # Enabled for cflags_objc in build/config/compiler/BUILD.gn.
405 "-Wno-objc-missing-property-synthesis",
406
407 # Hide the warning for SecRandomCopyBytes(), until we update to upstream.
408 # https://bugs.chromium.org/p/webrtc/issues/detail?id=6396
409 "-Wno-unused-result",
410 ]
tkchin2ddfdba2016-08-07 21:37:45 -0700411
412 if (is_mac) {
413 cflags += [ "-Wno-partial-availability" ]
414 }
415 }
416
kjellanderb62dbbe2016-09-23 00:38:52 -0700417 rtc_static_library("socketrocket") {
tkchin2ddfdba2016-08-07 21:37:45 -0700418 sources = [
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200419 "objc/AppRTCMobile/third_party/SocketRocket/SRWebSocket.h",
420 "objc/AppRTCMobile/third_party/SocketRocket/SRWebSocket.m",
tkchin2ddfdba2016-08-07 21:37:45 -0700421 ]
422 configs += [
tkchin2ddfdba2016-08-07 21:37:45 -0700423 "//build/config/compiler:enable_arc",
424 ":socketrocket_warning_config",
425 ]
ehmaldonadoe9cc6862016-09-05 06:10:18 -0700426 public_configs = [ ":socketrocket_include_config" ]
tkchin2ddfdba2016-08-07 21:37:45 -0700427
428 libs = [
429 "CFNetwork.framework",
430 "icucore",
431 ]
432 }
adam.fedorbcc5d872016-11-07 14:53:28 -0800433
434 if (rtc_include_tests) {
435 config("rtc_apprtcmobile_config") {
436 defines = [ "GTEST_RELATIVE_PATH" ]
437 }
438
439 rtc_test("apprtcmobile_tests") {
denicija77bfd7c2016-11-15 00:41:26 -0800440 include_dirs = [ "objc/AppRTCMobile/ios" ]
adam.fedorbcc5d872016-11-07 14:53:28 -0800441 deps = [
denicija77bfd7c2016-11-15 00:41:26 -0800442 ":AppRTCMobile_lib",
adam.fedorbcc5d872016-11-07 14:53:28 -0800443 ":apprtc_signaling",
444 "//testing/gtest",
445 "//third_party/ocmock",
446 ]
447
448 sources = [
449 "objc/AppRTCMobile/tests/ARDAppClientTest.mm",
denicija77bfd7c2016-11-15 00:41:26 -0800450 "objc/AppRTCMobile/tests/ARDSettingsModelTests.mm",
adam.fedorbcc5d872016-11-07 14:53:28 -0800451 ]
452
453 if (is_ios) {
454 info_plist = "objc/AppRTCMobile/ios/Info.plist"
455 }
456
457 configs += [
458 ":rtc_apprtcmobile_config",
459 "//build/config/compiler:enable_arc",
460 ]
461 }
462 }
tkchin2ddfdba2016-08-07 21:37:45 -0700463}
kthelgason0727f152016-08-08 09:03:23 -0700464
465if (is_linux || is_win) {
ehmaldonadod02fe4b2016-08-26 13:31:24 -0700466 config("peerconnection_client_warnings_config") {
kjellander4a9abad2016-09-18 08:12:29 -0700467 cflags = []
ehmaldonadod02fe4b2016-08-26 13:31:24 -0700468 if (is_win && is_clang) {
kjellander4a9abad2016-09-18 08:12:29 -0700469 cflags += [
ehmaldonadod02fe4b2016-08-26 13:31:24 -0700470 # Disable warnings failing when compiling with Clang on Windows.
471 # https://bugs.chromium.org/p/webrtc/issues/detail?id=5366
472 "-Wno-format",
473
474 # See https://bugs.chromium.org/p/webrtc/issues/detail?id=6271
475 # for -Wno-reorder and -Wno-sign-compare
476 "-Wno-reorder",
477 "-Wno-sign-compare",
478 ]
479 }
kjellanderd4626e52016-09-07 02:33:01 -0700480 if (is_linux && target_cpu == "x86") {
kjellander4a9abad2016-09-18 08:12:29 -0700481 cflags += [
kjellanderd4626e52016-09-07 02:33:01 -0700482 # Needed to compile on Linux 32-bit.
483 "-Wno-sentinel",
484 ]
485 }
kjellander4a9abad2016-09-18 08:12:29 -0700486
487 if (is_clang) {
488 # TODO(ehmaldonado): Make peerconnection_client compile with the standard
489 # set of warnings.
490 # See https://bugs.chromium.org/p/webrtc/issues/detail?id=6306
491 cflags += [ "-Wno-inconsistent-missing-override" ]
492 }
ehmaldonadod02fe4b2016-08-26 13:31:24 -0700493 }
494
ehmaldonado38a21322016-09-02 04:10:34 -0700495 rtc_executable("peerconnection_client") {
kthelgason0727f152016-08-08 09:03:23 -0700496 sources = [
497 "peerconnection/client/conductor.cc",
498 "peerconnection/client/conductor.h",
499 "peerconnection/client/defaults.cc",
500 "peerconnection/client/defaults.h",
501 "peerconnection/client/peer_connection_client.cc",
502 "peerconnection/client/peer_connection_client.h",
503 ]
ehmaldonado7a2ce0b2016-09-05 01:35:44 -0700504
kjellandere40a7ee2016-10-16 23:56:12 -0700505 if (!build_with_chromium && is_clang) {
506 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
ehmaldonado38a21322016-09-02 04:10:34 -0700507 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
kthelgason0727f152016-08-08 09:03:23 -0700508 }
509 if (is_win) {
510 sources += [
511 "peerconnection/client/flagdefs.h",
512 "peerconnection/client/main.cc",
513 "peerconnection/client/main_wnd.cc",
514 "peerconnection/client/main_wnd.h",
515 ]
516 cflags = [ "/wd4245" ]
517 configs += [ "//build/config/win:windowed" ]
518 }
thomasandersonef16e992016-12-13 02:57:43 -0800519 deps = [
520 "//third_party/libyuv",
ossu7bb87ee2017-01-23 04:56:25 -0800521 "//webrtc/pc:libjingle_peerconnection",
thomasandersonef16e992016-12-13 02:57:43 -0800522 "//webrtc/system_wrappers:field_trial_default",
523 "//webrtc/system_wrappers:metrics_default",
524 ]
kthelgason0727f152016-08-08 09:03:23 -0700525 if (is_linux) {
526 sources += [
527 "peerconnection/client/linux/main.cc",
528 "peerconnection/client/linux/main_wnd.cc",
529 "peerconnection/client/linux/main_wnd.h",
530 ]
531 libs = [
532 "X11",
533 "Xcomposite",
534 "Xext",
535 "Xrender",
536 ]
thomasandersonef16e992016-12-13 02:57:43 -0800537 deps += [ "//build/config/linux/gtk" ]
kthelgason0727f152016-08-08 09:03:23 -0700538 }
ehmaldonadod02fe4b2016-08-26 13:31:24 -0700539 configs += [ ":peerconnection_client_warnings_config" ]
kthelgason0727f152016-08-08 09:03:23 -0700540 if (rtc_build_json) {
541 deps += [ "//third_party/jsoncpp" ]
542 }
543 }
kjellanderd4626e52016-09-07 02:33:01 -0700544
ehmaldonado38a21322016-09-02 04:10:34 -0700545 rtc_executable("peerconnection_server") {
kthelgason0727f152016-08-08 09:03:23 -0700546 sources = [
547 "peerconnection/server/data_socket.cc",
548 "peerconnection/server/data_socket.h",
549 "peerconnection/server/main.cc",
550 "peerconnection/server/peer_channel.cc",
551 "peerconnection/server/peer_channel.h",
552 "peerconnection/server/utils.cc",
553 "peerconnection/server/utils.h",
554 ]
555 deps = [
556 "//webrtc:webrtc_common",
557 "//webrtc/base:rtc_base_approved",
558 "//webrtc/tools:command_line_parser",
559 ]
kjellandere40a7ee2016-10-16 23:56:12 -0700560 if (!build_with_chromium && is_clang) {
561 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
ehmaldonado38a21322016-09-02 04:10:34 -0700562 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
kthelgason0727f152016-08-08 09:03:23 -0700563 }
564 }
ehmaldonado38a21322016-09-02 04:10:34 -0700565 rtc_executable("relayserver") {
kthelgason0727f152016-08-08 09:03:23 -0700566 sources = [
567 "relayserver/relayserver_main.cc",
568 ]
569 deps = [
570 "//webrtc/base:rtc_base_approved",
571 "//webrtc/pc:rtc_pc",
572 "//webrtc/system_wrappers:field_trial_default",
573 "//webrtc/system_wrappers:metrics_default",
574 ]
kjellandere40a7ee2016-10-16 23:56:12 -0700575 if (!build_with_chromium && is_clang) {
576 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
ehmaldonado38a21322016-09-02 04:10:34 -0700577 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
kthelgason0727f152016-08-08 09:03:23 -0700578 }
579 }
ehmaldonado38a21322016-09-02 04:10:34 -0700580 rtc_executable("turnserver") {
kthelgason0727f152016-08-08 09:03:23 -0700581 sources = [
582 "turnserver/turnserver_main.cc",
583 ]
584 deps = [
585 "//webrtc/base:rtc_base_approved",
586 "//webrtc/pc:rtc_pc",
587 "//webrtc/system_wrappers:field_trial_default",
588 "//webrtc/system_wrappers:metrics_default",
589 ]
kjellandere40a7ee2016-10-16 23:56:12 -0700590 if (!build_with_chromium && is_clang) {
591 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
ehmaldonado38a21322016-09-02 04:10:34 -0700592 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
kthelgason0727f152016-08-08 09:03:23 -0700593 }
594 }
ehmaldonado38a21322016-09-02 04:10:34 -0700595 rtc_executable("stunserver") {
kthelgason0727f152016-08-08 09:03:23 -0700596 sources = [
597 "stunserver/stunserver_main.cc",
598 ]
599 deps = [
600 "//webrtc/base:rtc_base_approved",
601 "//webrtc/pc:rtc_pc",
602 "//webrtc/system_wrappers:field_trial_default",
603 "//webrtc/system_wrappers:metrics_default",
604 ]
kjellandere40a7ee2016-10-16 23:56:12 -0700605 if (!build_with_chromium && is_clang) {
606 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
ehmaldonado38a21322016-09-02 04:10:34 -0700607 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
kthelgason0727f152016-08-08 09:03:23 -0700608 }
609 }
610}
charujainaca3a242016-11-01 03:09:15 -0700611
612if (!build_with_chromium) {
613 # Doesn't build within Chrome on Win.
614 rtc_executable("stun_prober") {
615 sources = [
616 "stunprober/main.cc",
617 ]
618
619 if (!build_with_chromium && is_clang) {
620 # Suppress warnings from Chrome's Clang plugins.
621 # See http://code.google.com/p/webrtc/issues/detail?id=163 for details.
622 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
623 }
624
625 deps = [
626 "../p2p:libstunprober",
627 "../p2p:rtc_p2p",
628 "../system_wrappers:field_trial_default",
629 ]
630 }
631}