blob: cf0c19525adc08ba1b83af2ecb86f840e50b7df6 [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
ehmaldonado38a21322016-09-02 04:10:34 -07009import("../build/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",
28 ]
29 }
30
charujainaca3a242016-11-01 03:09:15 -070031 if (!build_with_chromium) {
32 public_deps += [ ":stun_prober" ]
33 }
34
kjellander6ceab082016-10-28 05:44:03 -070035 if (is_ios || (is_mac && target_cpu != "x86")) {
Magnus Jedvertc1815cf2016-09-27 10:10:41 +020036 public_deps += [ ":AppRTCMobile" ]
Sami Kalliomaki9c0c75b2016-06-29 14:55:00 +020037 }
kjellander6ceab082016-10-28 05:44:03 -070038
39 if (is_linux || is_win) {
kjellander705ecc52016-09-15 00:53:26 -070040 public_deps += [
kthelgason0727f152016-08-08 09:03:23 -070041 ":peerconnection_client",
42 ":peerconnection_server",
43 ":relayserver",
44 ":stunserver",
45 ":turnserver",
46 ]
47 }
Sami Kalliomaki9c0c75b2016-06-29 14:55:00 +020048}
49
tkchin2ddfdba2016-08-07 21:37:45 -070050if (is_android) {
Magnus Jedvertc1815cf2016-09-27 10:10:41 +020051 android_apk("AppRTCMobile") {
52 apk_name = "AppRTCMobile"
Sami Kalliomaki9c0c75b2016-06-29 14:55:00 +020053 android_manifest = "androidapp/AndroidManifest.xml"
54
55 deps = [
Magnus Jedvertc1815cf2016-09-27 10:10:41 +020056 ":AppRTCMobile_javalib",
57 ":AppRTCMobile_resources",
Sami Kalliomaki9c0c75b2016-06-29 14:55:00 +020058 "//base:base_java",
59 "//webrtc/base:base_java",
60 ]
61
magjed768c6482016-12-06 04:29:37 -080062 shared_libraries = [ "//webrtc/sdk/android:libjingle_peerconnection_so" ]
Sami Kalliomaki9c0c75b2016-06-29 14:55:00 +020063 }
64
Magnus Jedvertc1815cf2016-09-27 10:10:41 +020065 android_library("AppRTCMobile_javalib") {
Sami Kalliomaki9c0c75b2016-06-29 14:55:00 +020066 java_files = [
67 "androidapp/src/org/appspot/apprtc/AppRTCAudioManager.java",
henrikac3c2f312016-12-14 07:36:56 -080068 "androidapp/src/org/appspot/apprtc/AppRTCBluetoothManager.java",
Sami Kalliomaki9c0c75b2016-06-29 14:55:00 +020069 "androidapp/src/org/appspot/apprtc/AppRTCClient.java",
70 "androidapp/src/org/appspot/apprtc/AppRTCProximitySensor.java",
71 "androidapp/src/org/appspot/apprtc/CallActivity.java",
72 "androidapp/src/org/appspot/apprtc/CallFragment.java",
73 "androidapp/src/org/appspot/apprtc/CaptureQualityController.java",
74 "androidapp/src/org/appspot/apprtc/ConnectActivity.java",
75 "androidapp/src/org/appspot/apprtc/CpuMonitor.java",
76 "androidapp/src/org/appspot/apprtc/DirectRTCClient.java",
77 "androidapp/src/org/appspot/apprtc/HudFragment.java",
78 "androidapp/src/org/appspot/apprtc/PeerConnectionClient.java",
79 "androidapp/src/org/appspot/apprtc/PercentFrameLayout.java",
80 "androidapp/src/org/appspot/apprtc/RoomParametersFetcher.java",
81 "androidapp/src/org/appspot/apprtc/SettingsActivity.java",
82 "androidapp/src/org/appspot/apprtc/SettingsFragment.java",
83 "androidapp/src/org/appspot/apprtc/TCPChannelClient.java",
84 "androidapp/src/org/appspot/apprtc/UnhandledExceptionHandler.java",
85 "androidapp/src/org/appspot/apprtc/WebSocketChannelClient.java",
86 "androidapp/src/org/appspot/apprtc/WebSocketRTCClient.java",
87 "androidapp/src/org/appspot/apprtc/util/AppRTCUtils.java",
88 "androidapp/src/org/appspot/apprtc/util/AsyncHttpURLConnection.java",
Sami Kalliomaki9c0c75b2016-06-29 14:55:00 +020089 ]
90
91 deps = [
Magnus Jedvertc1815cf2016-09-27 10:10:41 +020092 ":AppRTCMobile_resources",
Sami Kalliomaki9c0c75b2016-06-29 14:55:00 +020093 "//webrtc/base:base_java",
94 "//webrtc/examples/androidapp/third_party/autobanh:autobanh_java",
magjed768c6482016-12-06 04:29:37 -080095 "//webrtc/sdk/android:libjingle_peerconnection_java",
96 "//webrtc/sdk/android:libjingle_peerconnection_metrics_default_java",
Sami Kalliomaki9c0c75b2016-06-29 14:55:00 +020097 ]
98 }
99
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200100 android_resources("AppRTCMobile_resources") {
Sami Kalliomaki9c0c75b2016-06-29 14:55:00 +0200101 resource_dirs = [ "androidapp/res" ]
102 custom_package = "org.appspot.apprtc"
103 }
104
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200105 instrumentation_test_apk("AppRTCMobileTest") {
106 apk_name = "AppRTCMobileTest"
Sami Kalliomaki9c0c75b2016-06-29 14:55:00 +0200107 android_manifest = "androidtests/AndroidManifest.xml"
108
mandermoa8bec8d2016-10-26 01:47:07 -0700109 java_files = [
mandermo9890a582016-10-27 07:26:36 -0700110 "androidtests/src/org/appspot/apprtc/test/FileVideoCapturerTest.java",
mandermoa8bec8d2016-10-26 01:47:07 -0700111 "androidtests/src/org/appspot/apprtc/test/PeerConnectionClientTest.java",
112 "androidtests/src/org/appspot/apprtc/test/VideoFileRendererTest.java",
113 ]
Sami Kalliomaki9c0c75b2016-06-29 14:55:00 +0200114
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200115 apk_under_test = ":AppRTCMobile"
Sami Kalliomaki9c0c75b2016-06-29 14:55:00 +0200116
117 deps = [
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200118 ":AppRTCMobile_javalib",
sakalcb79d512017-01-11 06:21:26 -0800119 "//base:base_java_test_support",
120 "//third_party/android_support_test_runner:runner_java",
121 "//third_party/junit",
magjed768c6482016-12-06 04:29:37 -0800122 "//webrtc/sdk/android:libjingle_peerconnection_java",
Sami Kalliomaki9c0c75b2016-06-29 14:55:00 +0200123 ]
mandermo9890a582016-10-27 07:26:36 -0700124
125 data = [
126 "//webrtc/examples/androidtests/src/org/appspot/apprtc/test/capturetestvideo.y4m",
127 ]
Sami Kalliomaki9c0c75b2016-06-29 14:55:00 +0200128 }
Sami Kalliomaki9c0c75b2016-06-29 14:55:00 +0200129}
tkchin2ddfdba2016-08-07 21:37:45 -0700130
131if (is_ios || (is_mac && target_cpu != "x86")) {
132 config("warnings_config") {
133 # GN orders flags on a target before flags from configs. The default config
134 # adds these flags so to cancel them out they need to come from a config and
135 # cannot be on the target directly.
136 if (is_ios) {
137 # Suppress compiler warnings about deprecated that triggered
138 # when moving from ios_deployment_target 7.0 to 9.0.
139 # See webrtc:5549 for more details.
140 cflags = [ "-Wno-deprecated-declarations" ]
Henrik Kjellander91a57592016-10-12 20:25:34 -0700141 cflags_objc = [
142 # Enabled for cflags_objc in build/config/compiler/BUILD.gn.
143 # See webrtc:6520.
144 "-Wno-objc-missing-property-synthesis",
145 ]
tkchin2ddfdba2016-08-07 21:37:45 -0700146 }
147 }
148
149 config("apprtc_common_config") {
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200150 include_dirs = [ "objc/AppRTCMobile/common" ]
tkchin2ddfdba2016-08-07 21:37:45 -0700151 }
152
kjellanderb62dbbe2016-09-23 00:38:52 -0700153 rtc_static_library("apprtc_common") {
tkchin2ddfdba2016-08-07 21:37:45 -0700154 sources = [
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200155 "objc/AppRTCMobile/common/ARDUtilities.h",
156 "objc/AppRTCMobile/common/ARDUtilities.m",
tkchin2ddfdba2016-08-07 21:37:45 -0700157 ]
158 configs += [
tkchin2ddfdba2016-08-07 21:37:45 -0700159 ":warnings_config",
160 "//build/config/compiler:enable_arc",
161 ]
ehmaldonadoe9cc6862016-09-05 06:10:18 -0700162 public_configs = [ ":apprtc_common_config" ]
tkchin2ddfdba2016-08-07 21:37:45 -0700163
164 deps = [
165 "../sdk:rtc_sdk_common_objc",
166 "../system_wrappers:field_trial_default",
167 "../system_wrappers:metrics_default",
168 ]
169 }
170
171 config("apprtc_signaling_config") {
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200172 include_dirs = [ "objc/AppRTCMobile" ]
tkchin2ddfdba2016-08-07 21:37:45 -0700173
174 # GN orders flags on a target before flags from configs. The default config
175 # adds these flags so to cancel them out they need to come from a config and
176 # cannot be on the target directly.
177 cflags = [
178 "-Wno-sign-compare",
179 "-Wno-unused-variable",
180 ]
181 if (is_mac) {
182 cflags += [ "-Wno-partial-availability" ]
183 }
184 }
185
kjellanderb62dbbe2016-09-23 00:38:52 -0700186 rtc_static_library("apprtc_signaling") {
tkchin2ddfdba2016-08-07 21:37:45 -0700187 sources = [
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200188 "objc/AppRTCMobile/ARDAppClient+Internal.h",
189 "objc/AppRTCMobile/ARDAppClient.h",
190 "objc/AppRTCMobile/ARDAppClient.m",
191 "objc/AppRTCMobile/ARDAppEngineClient.h",
192 "objc/AppRTCMobile/ARDAppEngineClient.m",
193 "objc/AppRTCMobile/ARDBitrateTracker.h",
194 "objc/AppRTCMobile/ARDBitrateTracker.m",
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200195 "objc/AppRTCMobile/ARDJoinResponse+Internal.h",
196 "objc/AppRTCMobile/ARDJoinResponse.h",
197 "objc/AppRTCMobile/ARDJoinResponse.m",
198 "objc/AppRTCMobile/ARDMessageResponse+Internal.h",
199 "objc/AppRTCMobile/ARDMessageResponse.h",
200 "objc/AppRTCMobile/ARDMessageResponse.m",
201 "objc/AppRTCMobile/ARDRoomServerClient.h",
202 "objc/AppRTCMobile/ARDSDPUtils.h",
203 "objc/AppRTCMobile/ARDSDPUtils.m",
204 "objc/AppRTCMobile/ARDSignalingChannel.h",
205 "objc/AppRTCMobile/ARDSignalingMessage.h",
206 "objc/AppRTCMobile/ARDSignalingMessage.m",
207 "objc/AppRTCMobile/ARDStatsBuilder.h",
208 "objc/AppRTCMobile/ARDStatsBuilder.m",
kthelgasoncc882af2017-01-13 05:59:46 -0800209 "objc/AppRTCMobile/ARDTURNClient+Internal.h",
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200210 "objc/AppRTCMobile/ARDTURNClient.h",
kthelgasoncc882af2017-01-13 05:59:46 -0800211 "objc/AppRTCMobile/ARDTURNClient.m",
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200212 "objc/AppRTCMobile/ARDWebSocketChannel.h",
213 "objc/AppRTCMobile/ARDWebSocketChannel.m",
214 "objc/AppRTCMobile/RTCIceCandidate+JSON.h",
215 "objc/AppRTCMobile/RTCIceCandidate+JSON.m",
216 "objc/AppRTCMobile/RTCIceServer+JSON.h",
217 "objc/AppRTCMobile/RTCIceServer+JSON.m",
218 "objc/AppRTCMobile/RTCMediaConstraints+JSON.h",
219 "objc/AppRTCMobile/RTCMediaConstraints+JSON.m",
220 "objc/AppRTCMobile/RTCSessionDescription+JSON.h",
221 "objc/AppRTCMobile/RTCSessionDescription+JSON.m",
tkchin2ddfdba2016-08-07 21:37:45 -0700222 ]
223 configs += [
tkchin2ddfdba2016-08-07 21:37:45 -0700224 "//build/config/compiler:enable_arc",
225 ":warnings_config",
226 ]
ehmaldonadoe9cc6862016-09-05 06:10:18 -0700227 public_configs = [ ":apprtc_signaling_config" ]
tkchin2ddfdba2016-08-07 21:37:45 -0700228 deps = [
229 ":apprtc_common",
230 ":socketrocket",
231 ]
232 public_deps = [
233 "../sdk:rtc_sdk_peerconnection_objc",
234 ]
235 libs = [ "QuartzCore.framework" ]
236 }
237
238 if (is_ios) {
denicija77bfd7c2016-11-15 00:41:26 -0800239 rtc_static_library("AppRTCMobile_lib") {
tkchin2ddfdba2016-08-07 21:37:45 -0700240 sources = [
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200241 "objc/AppRTCMobile/ios/ARDAppDelegate.m",
242 "objc/AppRTCMobile/ios/ARDMainView.h",
243 "objc/AppRTCMobile/ios/ARDMainView.m",
244 "objc/AppRTCMobile/ios/ARDMainViewController.h",
245 "objc/AppRTCMobile/ios/ARDMainViewController.m",
denicija2256e042016-11-09 06:26:18 -0800246 "objc/AppRTCMobile/ios/ARDSettingsModel+Private.h",
247 "objc/AppRTCMobile/ios/ARDSettingsModel.h",
248 "objc/AppRTCMobile/ios/ARDSettingsModel.m",
249 "objc/AppRTCMobile/ios/ARDSettingsStore.h",
250 "objc/AppRTCMobile/ios/ARDSettingsStore.m",
denicijad17d5362016-11-02 02:56:09 -0700251 "objc/AppRTCMobile/ios/ARDSettingsViewController.h",
252 "objc/AppRTCMobile/ios/ARDSettingsViewController.m",
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200253 "objc/AppRTCMobile/ios/ARDStatsView.h",
254 "objc/AppRTCMobile/ios/ARDStatsView.m",
255 "objc/AppRTCMobile/ios/ARDVideoCallView.h",
256 "objc/AppRTCMobile/ios/ARDVideoCallView.m",
257 "objc/AppRTCMobile/ios/ARDVideoCallViewController.h",
258 "objc/AppRTCMobile/ios/ARDVideoCallViewController.m",
259 "objc/AppRTCMobile/ios/AppRTCMobile-Prefix.pch",
260 "objc/AppRTCMobile/ios/UIImage+ARDUtilities.h",
261 "objc/AppRTCMobile/ios/UIImage+ARDUtilities.m",
denicija77bfd7c2016-11-15 00:41:26 -0800262 ]
263 configs += [
264 "//build/config/compiler:enable_arc",
265 ":warnings_config",
266 ]
267
268 deps = [
269 ":apprtc_common",
270 ":apprtc_signaling",
271 ]
272 }
273
274 ios_app_bundle("AppRTCMobile") {
275 sources = [
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200276 "objc/AppRTCMobile/ios/main.m",
tkchin2ddfdba2016-08-07 21:37:45 -0700277 ]
278
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200279 info_plist = "objc/AppRTCMobile/ios/Info.plist"
tkchin2ddfdba2016-08-07 21:37:45 -0700280
denicija77bfd7c2016-11-15 00:41:26 -0800281 configs += [ "..:common_config" ]
tkchin2ddfdba2016-08-07 21:37:45 -0700282 public_configs = [ "..:common_inherited_config" ]
283
284 deps = [
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200285 ":AppRTCMobile_ios_bundle_data",
denicija77bfd7c2016-11-15 00:41:26 -0800286 ":AppRTCMobile_lib",
tkchin2ddfdba2016-08-07 21:37:45 -0700287 ]
288
289 if (target_cpu == "x86") {
290 deps += [ "//testing/iossim:iossim" ]
291 }
292 }
293
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200294 bundle_data("AppRTCMobile_ios_bundle_data") {
tkchin2ddfdba2016-08-07 21:37:45 -0700295 sources = [
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200296 "objc/AppRTCMobile/ios/resources/Roboto-Regular.ttf",
297 "objc/AppRTCMobile/ios/resources/iPhone5@2x.png",
298 "objc/AppRTCMobile/ios/resources/iPhone6@2x.png",
299 "objc/AppRTCMobile/ios/resources/iPhone6p@3x.png",
300 "objc/AppRTCMobile/ios/resources/ic_call_end_black_24dp.png",
301 "objc/AppRTCMobile/ios/resources/ic_call_end_black_24dp@2x.png",
302 "objc/AppRTCMobile/ios/resources/ic_clear_black_24dp.png",
303 "objc/AppRTCMobile/ios/resources/ic_clear_black_24dp@2x.png",
denicija6d6762c2016-10-28 04:53:16 -0700304 "objc/AppRTCMobile/ios/resources/ic_settings_black_24dp.png",
305 "objc/AppRTCMobile/ios/resources/ic_settings_black_24dp@2x.png",
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200306 "objc/AppRTCMobile/ios/resources/ic_surround_sound_black_24dp.png",
307 "objc/AppRTCMobile/ios/resources/ic_surround_sound_black_24dp@2x.png",
308 "objc/AppRTCMobile/ios/resources/ic_switch_video_black_24dp.png",
309 "objc/AppRTCMobile/ios/resources/ic_switch_video_black_24dp@2x.png",
310 "objc/AppRTCMobile/ios/resources/mozart.mp3",
tkchin2ddfdba2016-08-07 21:37:45 -0700311 "objc/Icon.png",
312 ]
313 outputs = [
314 "{{bundle_resources_dir}}/{{source_file_part}}",
315 ]
316 }
317 }
318
319 if (is_mac) {
denicija77bfd7c2016-11-15 00:41:26 -0800320 rtc_static_library("AppRTCMobile_lib") {
tkchin2ddfdba2016-08-07 21:37:45 -0700321 sources = [
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200322 "objc/AppRTCMobile/mac/APPRTCAppDelegate.h",
323 "objc/AppRTCMobile/mac/APPRTCAppDelegate.m",
324 "objc/AppRTCMobile/mac/APPRTCViewController.h",
325 "objc/AppRTCMobile/mac/APPRTCViewController.m",
tkchin2ddfdba2016-08-07 21:37:45 -0700326 ]
327 configs += [
tkchin2ddfdba2016-08-07 21:37:45 -0700328 "..:common_objc",
329 "//build/config/compiler:enable_arc",
330 ]
331 deps = [
332 ":apprtc_common",
333 ":apprtc_signaling",
334 ]
335 }
336
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200337 mac_app_bundle("AppRTCMobile") {
338 output_name = "AppRTCMobile"
tkchin2ddfdba2016-08-07 21:37:45 -0700339
340 extra_substitutions = [ "MACOSX_DEPLOYMENT_TARGET=10.8" ]
341
342 sources = [
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200343 "objc/AppRTCMobile/mac/main.m",
tkchin2ddfdba2016-08-07 21:37:45 -0700344 ]
345
346 public_configs = [ "..:common_inherited_config" ]
347
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200348 info_plist = "objc/AppRTCMobile/mac/Info.plist"
tkchin2ddfdba2016-08-07 21:37:45 -0700349
350 libs = [ "AppKit.framework" ]
351
352 deps = [
denicija77bfd7c2016-11-15 00:41:26 -0800353 ":AppRTCMobile_lib",
tkchin2ddfdba2016-08-07 21:37:45 -0700354 ]
355 }
356 }
357
358 config("socketrocket_include_config") {
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200359 include_dirs = [ "objc/AppRTCMobile/third_party/SocketRocket" ]
tkchin2ddfdba2016-08-07 21:37:45 -0700360 }
361
362 config("socketrocket_warning_config") {
363 # GN orders flags on a target before flags from configs. The default config
364 # adds these flags so to cancel them out they need to come from a config and
365 # cannot be on the target directly.
366 cflags = [
367 "-Wno-deprecated-declarations",
368 "-Wno-nonnull",
tkchin2ddfdba2016-08-07 21:37:45 -0700369 "-Wno-semicolon-before-method-body",
370 "-Wno-unused-variable",
371 ]
372
henrika27d8b612016-09-21 04:13:00 -0700373 cflags_objc = [
374 # Enabled for cflags_objc in build/config/compiler/BUILD.gn.
375 "-Wno-objc-missing-property-synthesis",
376
377 # Hide the warning for SecRandomCopyBytes(), until we update to upstream.
378 # https://bugs.chromium.org/p/webrtc/issues/detail?id=6396
379 "-Wno-unused-result",
380 ]
tkchin2ddfdba2016-08-07 21:37:45 -0700381
382 if (is_mac) {
383 cflags += [ "-Wno-partial-availability" ]
384 }
385 }
386
kjellanderb62dbbe2016-09-23 00:38:52 -0700387 rtc_static_library("socketrocket") {
tkchin2ddfdba2016-08-07 21:37:45 -0700388 sources = [
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200389 "objc/AppRTCMobile/third_party/SocketRocket/SRWebSocket.h",
390 "objc/AppRTCMobile/third_party/SocketRocket/SRWebSocket.m",
tkchin2ddfdba2016-08-07 21:37:45 -0700391 ]
392 configs += [
tkchin2ddfdba2016-08-07 21:37:45 -0700393 "//build/config/compiler:enable_arc",
394 ":socketrocket_warning_config",
395 ]
ehmaldonadoe9cc6862016-09-05 06:10:18 -0700396 public_configs = [ ":socketrocket_include_config" ]
tkchin2ddfdba2016-08-07 21:37:45 -0700397
398 libs = [
399 "CFNetwork.framework",
400 "icucore",
401 ]
402 }
adam.fedorbcc5d872016-11-07 14:53:28 -0800403
404 if (rtc_include_tests) {
405 config("rtc_apprtcmobile_config") {
406 defines = [ "GTEST_RELATIVE_PATH" ]
407 }
408
409 rtc_test("apprtcmobile_tests") {
denicija77bfd7c2016-11-15 00:41:26 -0800410 include_dirs = [ "objc/AppRTCMobile/ios" ]
adam.fedorbcc5d872016-11-07 14:53:28 -0800411 deps = [
denicija77bfd7c2016-11-15 00:41:26 -0800412 ":AppRTCMobile_lib",
adam.fedorbcc5d872016-11-07 14:53:28 -0800413 ":apprtc_signaling",
414 "//testing/gtest",
415 "//third_party/ocmock",
416 ]
417
418 sources = [
419 "objc/AppRTCMobile/tests/ARDAppClientTest.mm",
denicija77bfd7c2016-11-15 00:41:26 -0800420 "objc/AppRTCMobile/tests/ARDSettingsModelTests.mm",
adam.fedorbcc5d872016-11-07 14:53:28 -0800421 ]
422
423 if (is_ios) {
424 info_plist = "objc/AppRTCMobile/ios/Info.plist"
425 }
426
427 configs += [
428 ":rtc_apprtcmobile_config",
429 "//build/config/compiler:enable_arc",
430 ]
431 }
432 }
tkchin2ddfdba2016-08-07 21:37:45 -0700433}
kthelgason0727f152016-08-08 09:03:23 -0700434
435if (is_linux || is_win) {
ehmaldonadod02fe4b2016-08-26 13:31:24 -0700436 config("peerconnection_client_warnings_config") {
kjellander4a9abad2016-09-18 08:12:29 -0700437 cflags = []
ehmaldonadod02fe4b2016-08-26 13:31:24 -0700438 if (is_win && is_clang) {
kjellander4a9abad2016-09-18 08:12:29 -0700439 cflags += [
ehmaldonadod02fe4b2016-08-26 13:31:24 -0700440 # Disable warnings failing when compiling with Clang on Windows.
441 # https://bugs.chromium.org/p/webrtc/issues/detail?id=5366
442 "-Wno-format",
443
444 # See https://bugs.chromium.org/p/webrtc/issues/detail?id=6271
445 # for -Wno-reorder and -Wno-sign-compare
446 "-Wno-reorder",
447 "-Wno-sign-compare",
448 ]
449 }
kjellanderd4626e52016-09-07 02:33:01 -0700450 if (is_linux && target_cpu == "x86") {
kjellander4a9abad2016-09-18 08:12:29 -0700451 cflags += [
kjellanderd4626e52016-09-07 02:33:01 -0700452 # Needed to compile on Linux 32-bit.
453 "-Wno-sentinel",
454 ]
455 }
kjellander4a9abad2016-09-18 08:12:29 -0700456
457 if (is_clang) {
458 # TODO(ehmaldonado): Make peerconnection_client compile with the standard
459 # set of warnings.
460 # See https://bugs.chromium.org/p/webrtc/issues/detail?id=6306
461 cflags += [ "-Wno-inconsistent-missing-override" ]
462 }
ehmaldonadod02fe4b2016-08-26 13:31:24 -0700463 }
464
ehmaldonado38a21322016-09-02 04:10:34 -0700465 rtc_executable("peerconnection_client") {
kthelgason0727f152016-08-08 09:03:23 -0700466 sources = [
467 "peerconnection/client/conductor.cc",
468 "peerconnection/client/conductor.h",
469 "peerconnection/client/defaults.cc",
470 "peerconnection/client/defaults.h",
471 "peerconnection/client/peer_connection_client.cc",
472 "peerconnection/client/peer_connection_client.h",
473 ]
ehmaldonado7a2ce0b2016-09-05 01:35:44 -0700474
kjellandere40a7ee2016-10-16 23:56:12 -0700475 if (!build_with_chromium && is_clang) {
476 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
ehmaldonado38a21322016-09-02 04:10:34 -0700477 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
kthelgason0727f152016-08-08 09:03:23 -0700478 }
479 if (is_win) {
480 sources += [
481 "peerconnection/client/flagdefs.h",
482 "peerconnection/client/main.cc",
483 "peerconnection/client/main_wnd.cc",
484 "peerconnection/client/main_wnd.h",
485 ]
486 cflags = [ "/wd4245" ]
487 configs += [ "//build/config/win:windowed" ]
488 }
thomasandersonef16e992016-12-13 02:57:43 -0800489 deps = [
490 "//third_party/libyuv",
491 "//webrtc/api:libjingle_peerconnection",
492 "//webrtc/system_wrappers:field_trial_default",
493 "//webrtc/system_wrappers:metrics_default",
494 ]
kthelgason0727f152016-08-08 09:03:23 -0700495 if (is_linux) {
496 sources += [
497 "peerconnection/client/linux/main.cc",
498 "peerconnection/client/linux/main_wnd.cc",
499 "peerconnection/client/linux/main_wnd.h",
500 ]
501 libs = [
502 "X11",
503 "Xcomposite",
504 "Xext",
505 "Xrender",
506 ]
thomasandersonef16e992016-12-13 02:57:43 -0800507 deps += [ "//build/config/linux/gtk" ]
kthelgason0727f152016-08-08 09:03:23 -0700508 }
ehmaldonadod02fe4b2016-08-26 13:31:24 -0700509 configs += [ ":peerconnection_client_warnings_config" ]
kthelgason0727f152016-08-08 09:03:23 -0700510 if (rtc_build_json) {
511 deps += [ "//third_party/jsoncpp" ]
512 }
513 }
kjellanderd4626e52016-09-07 02:33:01 -0700514
ehmaldonado38a21322016-09-02 04:10:34 -0700515 rtc_executable("peerconnection_server") {
kthelgason0727f152016-08-08 09:03:23 -0700516 sources = [
517 "peerconnection/server/data_socket.cc",
518 "peerconnection/server/data_socket.h",
519 "peerconnection/server/main.cc",
520 "peerconnection/server/peer_channel.cc",
521 "peerconnection/server/peer_channel.h",
522 "peerconnection/server/utils.cc",
523 "peerconnection/server/utils.h",
524 ]
525 deps = [
526 "//webrtc:webrtc_common",
527 "//webrtc/base:rtc_base_approved",
528 "//webrtc/tools:command_line_parser",
529 ]
kjellandere40a7ee2016-10-16 23:56:12 -0700530 if (!build_with_chromium && is_clang) {
531 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
ehmaldonado38a21322016-09-02 04:10:34 -0700532 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
kthelgason0727f152016-08-08 09:03:23 -0700533 }
534 }
ehmaldonado38a21322016-09-02 04:10:34 -0700535 rtc_executable("relayserver") {
kthelgason0727f152016-08-08 09:03:23 -0700536 sources = [
537 "relayserver/relayserver_main.cc",
538 ]
539 deps = [
540 "//webrtc/base:rtc_base_approved",
541 "//webrtc/pc:rtc_pc",
542 "//webrtc/system_wrappers:field_trial_default",
543 "//webrtc/system_wrappers:metrics_default",
544 ]
kjellandere40a7ee2016-10-16 23:56:12 -0700545 if (!build_with_chromium && is_clang) {
546 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
ehmaldonado38a21322016-09-02 04:10:34 -0700547 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
kthelgason0727f152016-08-08 09:03:23 -0700548 }
549 }
ehmaldonado38a21322016-09-02 04:10:34 -0700550 rtc_executable("turnserver") {
kthelgason0727f152016-08-08 09:03:23 -0700551 sources = [
552 "turnserver/turnserver_main.cc",
553 ]
554 deps = [
555 "//webrtc/base:rtc_base_approved",
556 "//webrtc/pc:rtc_pc",
557 "//webrtc/system_wrappers:field_trial_default",
558 "//webrtc/system_wrappers:metrics_default",
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("stunserver") {
kthelgason0727f152016-08-08 09:03:23 -0700566 sources = [
567 "stunserver/stunserver_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 }
580}
charujainaca3a242016-11-01 03:09:15 -0700581
582if (!build_with_chromium) {
583 # Doesn't build within Chrome on Win.
584 rtc_executable("stun_prober") {
585 sources = [
586 "stunprober/main.cc",
587 ]
588
589 if (!build_with_chromium && is_clang) {
590 # Suppress warnings from Chrome's Clang plugins.
591 # See http://code.google.com/p/webrtc/issues/detail?id=163 for details.
592 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
593 }
594
595 deps = [
596 "../p2p:libstunprober",
597 "../p2p:rtc_p2p",
598 "../system_wrappers:field_trial_default",
599 ]
600 }
601}