blob: 3764b5c72c1fd55d2a4b832e3c4b288a53cdd64f [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",
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",
magjed768c6482016-12-06 04:29:37 -080096 "//webrtc/sdk/android:libjingle_peerconnection_java",
97 "//webrtc/sdk/android:libjingle_peerconnection_metrics_default_java",
Sami Kalliomaki9c0c75b2016-06-29 14:55:00 +020098 ]
99 }
100
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200101 android_resources("AppRTCMobile_resources") {
Sami Kalliomaki9c0c75b2016-06-29 14:55:00 +0200102 resource_dirs = [ "androidapp/res" ]
103 custom_package = "org.appspot.apprtc"
104 }
105
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200106 instrumentation_test_apk("AppRTCMobileTest") {
107 apk_name = "AppRTCMobileTest"
Sami Kalliomaki9c0c75b2016-06-29 14:55:00 +0200108 android_manifest = "androidtests/AndroidManifest.xml"
109
sakale8aca242017-01-17 03:32:06 -0800110 java_files = [ "androidtests/src/org/appspot/apprtc/test/PeerConnectionClientTest.java" ]
Sami Kalliomaki9c0c75b2016-06-29 14:55:00 +0200111
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200112 apk_under_test = ":AppRTCMobile"
Sami Kalliomaki9c0c75b2016-06-29 14:55:00 +0200113
114 deps = [
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200115 ":AppRTCMobile_javalib",
sakalcb79d512017-01-11 06:21:26 -0800116 "//base:base_java_test_support",
117 "//third_party/android_support_test_runner:runner_java",
118 "//third_party/junit",
magjed768c6482016-12-06 04:29:37 -0800119 "//webrtc/sdk/android:libjingle_peerconnection_java",
Sami Kalliomaki9c0c75b2016-06-29 14:55:00 +0200120 ]
121 }
mandermoa6069e82017-01-16 02:23:09 -0800122
123 instrumentation_test_apk("AppRTCMobileTestStubbedVideoIO") {
124 apk_name = "AppRTCMobileTestStubbedVideoIO"
125 android_manifest = "androidtests/AndroidManifest.xml"
126
127 java_files = [ "androidtests/src/org/appspot/apprtc/test/ConnectActivityStubbedInputOutputTest.java" ]
128
129 apk_under_test = ":AppRTCMobile"
130
131 deps = [
132 ":AppRTCMobile_javalib",
133 "//third_party/android_support_test_runner:rules_java",
134 "//third_party/android_support_test_runner:runner_java",
135 "//third_party/espresso:espresso_all_java",
136 "//third_party/hamcrest:hamcrest_java",
137 "//third_party/junit",
138 "//webrtc/sdk/android:libjingle_peerconnection_java",
139 ]
140
141 data = [
142 "//resources/reference_video_640x360_30fps.y4m",
143 ]
144 }
Sami Kalliomaki9c0c75b2016-06-29 14:55:00 +0200145}
tkchin2ddfdba2016-08-07 21:37:45 -0700146
147if (is_ios || (is_mac && target_cpu != "x86")) {
148 config("warnings_config") {
149 # GN orders flags on a target before flags from configs. The default config
150 # adds these flags so to cancel them out they need to come from a config and
151 # cannot be on the target directly.
152 if (is_ios) {
153 # Suppress compiler warnings about deprecated that triggered
154 # when moving from ios_deployment_target 7.0 to 9.0.
155 # See webrtc:5549 for more details.
156 cflags = [ "-Wno-deprecated-declarations" ]
Henrik Kjellander91a57592016-10-12 20:25:34 -0700157 cflags_objc = [
158 # Enabled for cflags_objc in build/config/compiler/BUILD.gn.
159 # See webrtc:6520.
160 "-Wno-objc-missing-property-synthesis",
161 ]
tkchin2ddfdba2016-08-07 21:37:45 -0700162 }
163 }
164
165 config("apprtc_common_config") {
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200166 include_dirs = [ "objc/AppRTCMobile/common" ]
tkchin2ddfdba2016-08-07 21:37:45 -0700167 }
168
kjellanderb62dbbe2016-09-23 00:38:52 -0700169 rtc_static_library("apprtc_common") {
tkchin2ddfdba2016-08-07 21:37:45 -0700170 sources = [
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200171 "objc/AppRTCMobile/common/ARDUtilities.h",
172 "objc/AppRTCMobile/common/ARDUtilities.m",
tkchin2ddfdba2016-08-07 21:37:45 -0700173 ]
174 configs += [
tkchin2ddfdba2016-08-07 21:37:45 -0700175 ":warnings_config",
176 "//build/config/compiler:enable_arc",
177 ]
ehmaldonadoe9cc6862016-09-05 06:10:18 -0700178 public_configs = [ ":apprtc_common_config" ]
tkchin2ddfdba2016-08-07 21:37:45 -0700179
180 deps = [
181 "../sdk:rtc_sdk_common_objc",
182 "../system_wrappers:field_trial_default",
183 "../system_wrappers:metrics_default",
184 ]
185 }
186
187 config("apprtc_signaling_config") {
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200188 include_dirs = [ "objc/AppRTCMobile" ]
tkchin2ddfdba2016-08-07 21:37:45 -0700189
190 # GN orders flags on a target before flags from configs. The default config
191 # adds these flags so to cancel them out they need to come from a config and
192 # cannot be on the target directly.
193 cflags = [
194 "-Wno-sign-compare",
195 "-Wno-unused-variable",
196 ]
197 if (is_mac) {
198 cflags += [ "-Wno-partial-availability" ]
199 }
200 }
201
kjellanderb62dbbe2016-09-23 00:38:52 -0700202 rtc_static_library("apprtc_signaling") {
tkchin2ddfdba2016-08-07 21:37:45 -0700203 sources = [
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200204 "objc/AppRTCMobile/ARDAppClient+Internal.h",
205 "objc/AppRTCMobile/ARDAppClient.h",
206 "objc/AppRTCMobile/ARDAppClient.m",
207 "objc/AppRTCMobile/ARDAppEngineClient.h",
208 "objc/AppRTCMobile/ARDAppEngineClient.m",
209 "objc/AppRTCMobile/ARDBitrateTracker.h",
210 "objc/AppRTCMobile/ARDBitrateTracker.m",
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200211 "objc/AppRTCMobile/ARDJoinResponse+Internal.h",
212 "objc/AppRTCMobile/ARDJoinResponse.h",
213 "objc/AppRTCMobile/ARDJoinResponse.m",
214 "objc/AppRTCMobile/ARDMessageResponse+Internal.h",
215 "objc/AppRTCMobile/ARDMessageResponse.h",
216 "objc/AppRTCMobile/ARDMessageResponse.m",
217 "objc/AppRTCMobile/ARDRoomServerClient.h",
218 "objc/AppRTCMobile/ARDSDPUtils.h",
219 "objc/AppRTCMobile/ARDSDPUtils.m",
220 "objc/AppRTCMobile/ARDSignalingChannel.h",
221 "objc/AppRTCMobile/ARDSignalingMessage.h",
222 "objc/AppRTCMobile/ARDSignalingMessage.m",
223 "objc/AppRTCMobile/ARDStatsBuilder.h",
224 "objc/AppRTCMobile/ARDStatsBuilder.m",
kthelgasoncc882af2017-01-13 05:59:46 -0800225 "objc/AppRTCMobile/ARDTURNClient+Internal.h",
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200226 "objc/AppRTCMobile/ARDTURNClient.h",
kthelgasoncc882af2017-01-13 05:59:46 -0800227 "objc/AppRTCMobile/ARDTURNClient.m",
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200228 "objc/AppRTCMobile/ARDWebSocketChannel.h",
229 "objc/AppRTCMobile/ARDWebSocketChannel.m",
230 "objc/AppRTCMobile/RTCIceCandidate+JSON.h",
231 "objc/AppRTCMobile/RTCIceCandidate+JSON.m",
232 "objc/AppRTCMobile/RTCIceServer+JSON.h",
233 "objc/AppRTCMobile/RTCIceServer+JSON.m",
234 "objc/AppRTCMobile/RTCMediaConstraints+JSON.h",
235 "objc/AppRTCMobile/RTCMediaConstraints+JSON.m",
236 "objc/AppRTCMobile/RTCSessionDescription+JSON.h",
237 "objc/AppRTCMobile/RTCSessionDescription+JSON.m",
tkchin2ddfdba2016-08-07 21:37:45 -0700238 ]
239 configs += [
tkchin2ddfdba2016-08-07 21:37:45 -0700240 "//build/config/compiler:enable_arc",
241 ":warnings_config",
242 ]
ehmaldonadoe9cc6862016-09-05 06:10:18 -0700243 public_configs = [ ":apprtc_signaling_config" ]
tkchin2ddfdba2016-08-07 21:37:45 -0700244 deps = [
245 ":apprtc_common",
246 ":socketrocket",
247 ]
248 public_deps = [
249 "../sdk:rtc_sdk_peerconnection_objc",
250 ]
251 libs = [ "QuartzCore.framework" ]
252 }
253
254 if (is_ios) {
denicija77bfd7c2016-11-15 00:41:26 -0800255 rtc_static_library("AppRTCMobile_lib") {
tkchin2ddfdba2016-08-07 21:37:45 -0700256 sources = [
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200257 "objc/AppRTCMobile/ios/ARDAppDelegate.m",
258 "objc/AppRTCMobile/ios/ARDMainView.h",
259 "objc/AppRTCMobile/ios/ARDMainView.m",
260 "objc/AppRTCMobile/ios/ARDMainViewController.h",
261 "objc/AppRTCMobile/ios/ARDMainViewController.m",
denicija2256e042016-11-09 06:26:18 -0800262 "objc/AppRTCMobile/ios/ARDSettingsModel+Private.h",
263 "objc/AppRTCMobile/ios/ARDSettingsModel.h",
264 "objc/AppRTCMobile/ios/ARDSettingsModel.m",
265 "objc/AppRTCMobile/ios/ARDSettingsStore.h",
266 "objc/AppRTCMobile/ios/ARDSettingsStore.m",
denicijad17d5362016-11-02 02:56:09 -0700267 "objc/AppRTCMobile/ios/ARDSettingsViewController.h",
268 "objc/AppRTCMobile/ios/ARDSettingsViewController.m",
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200269 "objc/AppRTCMobile/ios/ARDStatsView.h",
270 "objc/AppRTCMobile/ios/ARDStatsView.m",
271 "objc/AppRTCMobile/ios/ARDVideoCallView.h",
272 "objc/AppRTCMobile/ios/ARDVideoCallView.m",
273 "objc/AppRTCMobile/ios/ARDVideoCallViewController.h",
274 "objc/AppRTCMobile/ios/ARDVideoCallViewController.m",
275 "objc/AppRTCMobile/ios/AppRTCMobile-Prefix.pch",
276 "objc/AppRTCMobile/ios/UIImage+ARDUtilities.h",
277 "objc/AppRTCMobile/ios/UIImage+ARDUtilities.m",
denicija77bfd7c2016-11-15 00:41:26 -0800278 ]
279 configs += [
280 "//build/config/compiler:enable_arc",
281 ":warnings_config",
282 ]
283
284 deps = [
285 ":apprtc_common",
286 ":apprtc_signaling",
287 ]
288 }
289
290 ios_app_bundle("AppRTCMobile") {
291 sources = [
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200292 "objc/AppRTCMobile/ios/main.m",
tkchin2ddfdba2016-08-07 21:37:45 -0700293 ]
294
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200295 info_plist = "objc/AppRTCMobile/ios/Info.plist"
tkchin2ddfdba2016-08-07 21:37:45 -0700296
denicija77bfd7c2016-11-15 00:41:26 -0800297 configs += [ "..:common_config" ]
tkchin2ddfdba2016-08-07 21:37:45 -0700298 public_configs = [ "..:common_inherited_config" ]
299
300 deps = [
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200301 ":AppRTCMobile_ios_bundle_data",
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
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200310 bundle_data("AppRTCMobile_ios_bundle_data") {
tkchin2ddfdba2016-08-07 21:37:45 -0700311 sources = [
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200312 "objc/AppRTCMobile/ios/resources/Roboto-Regular.ttf",
313 "objc/AppRTCMobile/ios/resources/iPhone5@2x.png",
314 "objc/AppRTCMobile/ios/resources/iPhone6@2x.png",
315 "objc/AppRTCMobile/ios/resources/iPhone6p@3x.png",
316 "objc/AppRTCMobile/ios/resources/ic_call_end_black_24dp.png",
317 "objc/AppRTCMobile/ios/resources/ic_call_end_black_24dp@2x.png",
318 "objc/AppRTCMobile/ios/resources/ic_clear_black_24dp.png",
319 "objc/AppRTCMobile/ios/resources/ic_clear_black_24dp@2x.png",
denicija6d6762c2016-10-28 04:53:16 -0700320 "objc/AppRTCMobile/ios/resources/ic_settings_black_24dp.png",
321 "objc/AppRTCMobile/ios/resources/ic_settings_black_24dp@2x.png",
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200322 "objc/AppRTCMobile/ios/resources/ic_surround_sound_black_24dp.png",
323 "objc/AppRTCMobile/ios/resources/ic_surround_sound_black_24dp@2x.png",
324 "objc/AppRTCMobile/ios/resources/ic_switch_video_black_24dp.png",
325 "objc/AppRTCMobile/ios/resources/ic_switch_video_black_24dp@2x.png",
326 "objc/AppRTCMobile/ios/resources/mozart.mp3",
tkchin2ddfdba2016-08-07 21:37:45 -0700327 "objc/Icon.png",
328 ]
329 outputs = [
330 "{{bundle_resources_dir}}/{{source_file_part}}",
331 ]
332 }
333 }
334
335 if (is_mac) {
denicija77bfd7c2016-11-15 00:41:26 -0800336 rtc_static_library("AppRTCMobile_lib") {
tkchin2ddfdba2016-08-07 21:37:45 -0700337 sources = [
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200338 "objc/AppRTCMobile/mac/APPRTCAppDelegate.h",
339 "objc/AppRTCMobile/mac/APPRTCAppDelegate.m",
340 "objc/AppRTCMobile/mac/APPRTCViewController.h",
341 "objc/AppRTCMobile/mac/APPRTCViewController.m",
tkchin2ddfdba2016-08-07 21:37:45 -0700342 ]
343 configs += [
tkchin2ddfdba2016-08-07 21:37:45 -0700344 "..:common_objc",
345 "//build/config/compiler:enable_arc",
346 ]
347 deps = [
348 ":apprtc_common",
349 ":apprtc_signaling",
350 ]
351 }
352
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200353 mac_app_bundle("AppRTCMobile") {
354 output_name = "AppRTCMobile"
tkchin2ddfdba2016-08-07 21:37:45 -0700355
356 extra_substitutions = [ "MACOSX_DEPLOYMENT_TARGET=10.8" ]
357
358 sources = [
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200359 "objc/AppRTCMobile/mac/main.m",
tkchin2ddfdba2016-08-07 21:37:45 -0700360 ]
361
362 public_configs = [ "..:common_inherited_config" ]
363
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200364 info_plist = "objc/AppRTCMobile/mac/Info.plist"
tkchin2ddfdba2016-08-07 21:37:45 -0700365
366 libs = [ "AppKit.framework" ]
367
368 deps = [
denicija77bfd7c2016-11-15 00:41:26 -0800369 ":AppRTCMobile_lib",
tkchin2ddfdba2016-08-07 21:37:45 -0700370 ]
371 }
372 }
373
374 config("socketrocket_include_config") {
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200375 include_dirs = [ "objc/AppRTCMobile/third_party/SocketRocket" ]
tkchin2ddfdba2016-08-07 21:37:45 -0700376 }
377
378 config("socketrocket_warning_config") {
379 # GN orders flags on a target before flags from configs. The default config
380 # adds these flags so to cancel them out they need to come from a config and
381 # cannot be on the target directly.
382 cflags = [
383 "-Wno-deprecated-declarations",
384 "-Wno-nonnull",
tkchin2ddfdba2016-08-07 21:37:45 -0700385 "-Wno-semicolon-before-method-body",
386 "-Wno-unused-variable",
387 ]
388
henrika27d8b612016-09-21 04:13:00 -0700389 cflags_objc = [
390 # Enabled for cflags_objc in build/config/compiler/BUILD.gn.
391 "-Wno-objc-missing-property-synthesis",
392
393 # Hide the warning for SecRandomCopyBytes(), until we update to upstream.
394 # https://bugs.chromium.org/p/webrtc/issues/detail?id=6396
395 "-Wno-unused-result",
396 ]
tkchin2ddfdba2016-08-07 21:37:45 -0700397
398 if (is_mac) {
399 cflags += [ "-Wno-partial-availability" ]
400 }
401 }
402
kjellanderb62dbbe2016-09-23 00:38:52 -0700403 rtc_static_library("socketrocket") {
tkchin2ddfdba2016-08-07 21:37:45 -0700404 sources = [
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200405 "objc/AppRTCMobile/third_party/SocketRocket/SRWebSocket.h",
406 "objc/AppRTCMobile/third_party/SocketRocket/SRWebSocket.m",
tkchin2ddfdba2016-08-07 21:37:45 -0700407 ]
408 configs += [
tkchin2ddfdba2016-08-07 21:37:45 -0700409 "//build/config/compiler:enable_arc",
410 ":socketrocket_warning_config",
411 ]
ehmaldonadoe9cc6862016-09-05 06:10:18 -0700412 public_configs = [ ":socketrocket_include_config" ]
tkchin2ddfdba2016-08-07 21:37:45 -0700413
414 libs = [
415 "CFNetwork.framework",
416 "icucore",
417 ]
418 }
adam.fedorbcc5d872016-11-07 14:53:28 -0800419
420 if (rtc_include_tests) {
421 config("rtc_apprtcmobile_config") {
422 defines = [ "GTEST_RELATIVE_PATH" ]
423 }
424
425 rtc_test("apprtcmobile_tests") {
denicija77bfd7c2016-11-15 00:41:26 -0800426 include_dirs = [ "objc/AppRTCMobile/ios" ]
adam.fedorbcc5d872016-11-07 14:53:28 -0800427 deps = [
denicija77bfd7c2016-11-15 00:41:26 -0800428 ":AppRTCMobile_lib",
adam.fedorbcc5d872016-11-07 14:53:28 -0800429 ":apprtc_signaling",
430 "//testing/gtest",
431 "//third_party/ocmock",
432 ]
433
434 sources = [
435 "objc/AppRTCMobile/tests/ARDAppClientTest.mm",
denicija77bfd7c2016-11-15 00:41:26 -0800436 "objc/AppRTCMobile/tests/ARDSettingsModelTests.mm",
adam.fedorbcc5d872016-11-07 14:53:28 -0800437 ]
438
439 if (is_ios) {
440 info_plist = "objc/AppRTCMobile/ios/Info.plist"
441 }
442
443 configs += [
444 ":rtc_apprtcmobile_config",
445 "//build/config/compiler:enable_arc",
446 ]
447 }
448 }
tkchin2ddfdba2016-08-07 21:37:45 -0700449}
kthelgason0727f152016-08-08 09:03:23 -0700450
451if (is_linux || is_win) {
ehmaldonadod02fe4b2016-08-26 13:31:24 -0700452 config("peerconnection_client_warnings_config") {
kjellander4a9abad2016-09-18 08:12:29 -0700453 cflags = []
ehmaldonadod02fe4b2016-08-26 13:31:24 -0700454 if (is_win && is_clang) {
kjellander4a9abad2016-09-18 08:12:29 -0700455 cflags += [
ehmaldonadod02fe4b2016-08-26 13:31:24 -0700456 # Disable warnings failing when compiling with Clang on Windows.
457 # https://bugs.chromium.org/p/webrtc/issues/detail?id=5366
458 "-Wno-format",
459
460 # See https://bugs.chromium.org/p/webrtc/issues/detail?id=6271
461 # for -Wno-reorder and -Wno-sign-compare
462 "-Wno-reorder",
463 "-Wno-sign-compare",
464 ]
465 }
kjellanderd4626e52016-09-07 02:33:01 -0700466 if (is_linux && target_cpu == "x86") {
kjellander4a9abad2016-09-18 08:12:29 -0700467 cflags += [
kjellanderd4626e52016-09-07 02:33:01 -0700468 # Needed to compile on Linux 32-bit.
469 "-Wno-sentinel",
470 ]
471 }
kjellander4a9abad2016-09-18 08:12:29 -0700472
473 if (is_clang) {
474 # TODO(ehmaldonado): Make peerconnection_client compile with the standard
475 # set of warnings.
476 # See https://bugs.chromium.org/p/webrtc/issues/detail?id=6306
477 cflags += [ "-Wno-inconsistent-missing-override" ]
478 }
ehmaldonadod02fe4b2016-08-26 13:31:24 -0700479 }
480
ehmaldonado38a21322016-09-02 04:10:34 -0700481 rtc_executable("peerconnection_client") {
kthelgason0727f152016-08-08 09:03:23 -0700482 sources = [
483 "peerconnection/client/conductor.cc",
484 "peerconnection/client/conductor.h",
485 "peerconnection/client/defaults.cc",
486 "peerconnection/client/defaults.h",
487 "peerconnection/client/peer_connection_client.cc",
488 "peerconnection/client/peer_connection_client.h",
489 ]
ehmaldonado7a2ce0b2016-09-05 01:35:44 -0700490
kjellandere40a7ee2016-10-16 23:56:12 -0700491 if (!build_with_chromium && is_clang) {
492 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
ehmaldonado38a21322016-09-02 04:10:34 -0700493 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
kthelgason0727f152016-08-08 09:03:23 -0700494 }
495 if (is_win) {
496 sources += [
497 "peerconnection/client/flagdefs.h",
498 "peerconnection/client/main.cc",
499 "peerconnection/client/main_wnd.cc",
500 "peerconnection/client/main_wnd.h",
501 ]
502 cflags = [ "/wd4245" ]
503 configs += [ "//build/config/win:windowed" ]
504 }
thomasandersonef16e992016-12-13 02:57:43 -0800505 deps = [
506 "//third_party/libyuv",
507 "//webrtc/api:libjingle_peerconnection",
508 "//webrtc/system_wrappers:field_trial_default",
509 "//webrtc/system_wrappers:metrics_default",
510 ]
kthelgason0727f152016-08-08 09:03:23 -0700511 if (is_linux) {
512 sources += [
513 "peerconnection/client/linux/main.cc",
514 "peerconnection/client/linux/main_wnd.cc",
515 "peerconnection/client/linux/main_wnd.h",
516 ]
517 libs = [
518 "X11",
519 "Xcomposite",
520 "Xext",
521 "Xrender",
522 ]
thomasandersonef16e992016-12-13 02:57:43 -0800523 deps += [ "//build/config/linux/gtk" ]
kthelgason0727f152016-08-08 09:03:23 -0700524 }
ehmaldonadod02fe4b2016-08-26 13:31:24 -0700525 configs += [ ":peerconnection_client_warnings_config" ]
kthelgason0727f152016-08-08 09:03:23 -0700526 if (rtc_build_json) {
527 deps += [ "//third_party/jsoncpp" ]
528 }
529 }
kjellanderd4626e52016-09-07 02:33:01 -0700530
ehmaldonado38a21322016-09-02 04:10:34 -0700531 rtc_executable("peerconnection_server") {
kthelgason0727f152016-08-08 09:03:23 -0700532 sources = [
533 "peerconnection/server/data_socket.cc",
534 "peerconnection/server/data_socket.h",
535 "peerconnection/server/main.cc",
536 "peerconnection/server/peer_channel.cc",
537 "peerconnection/server/peer_channel.h",
538 "peerconnection/server/utils.cc",
539 "peerconnection/server/utils.h",
540 ]
541 deps = [
542 "//webrtc:webrtc_common",
543 "//webrtc/base:rtc_base_approved",
544 "//webrtc/tools:command_line_parser",
545 ]
kjellandere40a7ee2016-10-16 23:56:12 -0700546 if (!build_with_chromium && is_clang) {
547 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
ehmaldonado38a21322016-09-02 04:10:34 -0700548 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
kthelgason0727f152016-08-08 09:03:23 -0700549 }
550 }
ehmaldonado38a21322016-09-02 04:10:34 -0700551 rtc_executable("relayserver") {
kthelgason0727f152016-08-08 09:03:23 -0700552 sources = [
553 "relayserver/relayserver_main.cc",
554 ]
555 deps = [
556 "//webrtc/base:rtc_base_approved",
557 "//webrtc/pc:rtc_pc",
558 "//webrtc/system_wrappers:field_trial_default",
559 "//webrtc/system_wrappers:metrics_default",
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("turnserver") {
kthelgason0727f152016-08-08 09:03:23 -0700567 sources = [
568 "turnserver/turnserver_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("stunserver") {
kthelgason0727f152016-08-08 09:03:23 -0700582 sources = [
583 "stunserver/stunserver_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 }
596}
charujainaca3a242016-11-01 03:09:15 -0700597
598if (!build_with_chromium) {
599 # Doesn't build within Chrome on Win.
600 rtc_executable("stun_prober") {
601 sources = [
602 "stunprober/main.cc",
603 ]
604
605 if (!build_with_chromium && is_clang) {
606 # Suppress warnings from Chrome's Clang plugins.
607 # See http://code.google.com/p/webrtc/issues/detail?id=163 for details.
608 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
609 }
610
611 deps = [
612 "../p2p:libstunprober",
613 "../p2p:rtc_p2p",
614 "../system_wrappers:field_trial_default",
615 ]
616 }
617}