blob: eaa3bc91836dbb5a147e56643a2e3950da1dba39 [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",
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",
denicija77bfd7c2016-11-15 00:41:26 -0800303 ":AppRTCMobile_lib",
tkchin2ddfdba2016-08-07 21:37:45 -0700304 ]
305
306 if (target_cpu == "x86") {
307 deps += [ "//testing/iossim:iossim" ]
308 }
309 }
310
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200311 bundle_data("AppRTCMobile_ios_bundle_data") {
tkchin2ddfdba2016-08-07 21:37:45 -0700312 sources = [
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200313 "objc/AppRTCMobile/ios/resources/Roboto-Regular.ttf",
314 "objc/AppRTCMobile/ios/resources/iPhone5@2x.png",
315 "objc/AppRTCMobile/ios/resources/iPhone6@2x.png",
316 "objc/AppRTCMobile/ios/resources/iPhone6p@3x.png",
317 "objc/AppRTCMobile/ios/resources/ic_call_end_black_24dp.png",
318 "objc/AppRTCMobile/ios/resources/ic_call_end_black_24dp@2x.png",
319 "objc/AppRTCMobile/ios/resources/ic_clear_black_24dp.png",
320 "objc/AppRTCMobile/ios/resources/ic_clear_black_24dp@2x.png",
denicija6d6762c2016-10-28 04:53:16 -0700321 "objc/AppRTCMobile/ios/resources/ic_settings_black_24dp.png",
322 "objc/AppRTCMobile/ios/resources/ic_settings_black_24dp@2x.png",
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200323 "objc/AppRTCMobile/ios/resources/ic_surround_sound_black_24dp.png",
324 "objc/AppRTCMobile/ios/resources/ic_surround_sound_black_24dp@2x.png",
325 "objc/AppRTCMobile/ios/resources/ic_switch_video_black_24dp.png",
326 "objc/AppRTCMobile/ios/resources/ic_switch_video_black_24dp@2x.png",
327 "objc/AppRTCMobile/ios/resources/mozart.mp3",
tkchin2ddfdba2016-08-07 21:37:45 -0700328 "objc/Icon.png",
329 ]
330 outputs = [
331 "{{bundle_resources_dir}}/{{source_file_part}}",
332 ]
333 }
334 }
335
336 if (is_mac) {
denicija77bfd7c2016-11-15 00:41:26 -0800337 rtc_static_library("AppRTCMobile_lib") {
tkchin2ddfdba2016-08-07 21:37:45 -0700338 sources = [
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200339 "objc/AppRTCMobile/mac/APPRTCAppDelegate.h",
340 "objc/AppRTCMobile/mac/APPRTCAppDelegate.m",
341 "objc/AppRTCMobile/mac/APPRTCViewController.h",
342 "objc/AppRTCMobile/mac/APPRTCViewController.m",
tkchin2ddfdba2016-08-07 21:37:45 -0700343 ]
344 configs += [
tkchin2ddfdba2016-08-07 21:37:45 -0700345 "..:common_objc",
346 "//build/config/compiler:enable_arc",
347 ]
348 deps = [
349 ":apprtc_common",
350 ":apprtc_signaling",
351 ]
352 }
353
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200354 mac_app_bundle("AppRTCMobile") {
355 output_name = "AppRTCMobile"
tkchin2ddfdba2016-08-07 21:37:45 -0700356
357 extra_substitutions = [ "MACOSX_DEPLOYMENT_TARGET=10.8" ]
358
359 sources = [
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200360 "objc/AppRTCMobile/mac/main.m",
tkchin2ddfdba2016-08-07 21:37:45 -0700361 ]
362
363 public_configs = [ "..:common_inherited_config" ]
364
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200365 info_plist = "objc/AppRTCMobile/mac/Info.plist"
tkchin2ddfdba2016-08-07 21:37:45 -0700366
367 libs = [ "AppKit.framework" ]
368
369 deps = [
denicija77bfd7c2016-11-15 00:41:26 -0800370 ":AppRTCMobile_lib",
tkchin2ddfdba2016-08-07 21:37:45 -0700371 ]
372 }
373 }
374
375 config("socketrocket_include_config") {
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200376 include_dirs = [ "objc/AppRTCMobile/third_party/SocketRocket" ]
tkchin2ddfdba2016-08-07 21:37:45 -0700377 }
378
379 config("socketrocket_warning_config") {
380 # GN orders flags on a target before flags from configs. The default config
381 # adds these flags so to cancel them out they need to come from a config and
382 # cannot be on the target directly.
383 cflags = [
384 "-Wno-deprecated-declarations",
385 "-Wno-nonnull",
tkchin2ddfdba2016-08-07 21:37:45 -0700386 "-Wno-semicolon-before-method-body",
387 "-Wno-unused-variable",
388 ]
389
henrika27d8b612016-09-21 04:13:00 -0700390 cflags_objc = [
391 # Enabled for cflags_objc in build/config/compiler/BUILD.gn.
392 "-Wno-objc-missing-property-synthesis",
393
394 # Hide the warning for SecRandomCopyBytes(), until we update to upstream.
395 # https://bugs.chromium.org/p/webrtc/issues/detail?id=6396
396 "-Wno-unused-result",
397 ]
tkchin2ddfdba2016-08-07 21:37:45 -0700398
399 if (is_mac) {
400 cflags += [ "-Wno-partial-availability" ]
401 }
402 }
403
kjellanderb62dbbe2016-09-23 00:38:52 -0700404 rtc_static_library("socketrocket") {
tkchin2ddfdba2016-08-07 21:37:45 -0700405 sources = [
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200406 "objc/AppRTCMobile/third_party/SocketRocket/SRWebSocket.h",
407 "objc/AppRTCMobile/third_party/SocketRocket/SRWebSocket.m",
tkchin2ddfdba2016-08-07 21:37:45 -0700408 ]
409 configs += [
tkchin2ddfdba2016-08-07 21:37:45 -0700410 "//build/config/compiler:enable_arc",
411 ":socketrocket_warning_config",
412 ]
ehmaldonadoe9cc6862016-09-05 06:10:18 -0700413 public_configs = [ ":socketrocket_include_config" ]
tkchin2ddfdba2016-08-07 21:37:45 -0700414
415 libs = [
416 "CFNetwork.framework",
417 "icucore",
418 ]
419 }
adam.fedorbcc5d872016-11-07 14:53:28 -0800420
421 if (rtc_include_tests) {
422 config("rtc_apprtcmobile_config") {
423 defines = [ "GTEST_RELATIVE_PATH" ]
424 }
425
426 rtc_test("apprtcmobile_tests") {
denicija77bfd7c2016-11-15 00:41:26 -0800427 include_dirs = [ "objc/AppRTCMobile/ios" ]
adam.fedorbcc5d872016-11-07 14:53:28 -0800428 deps = [
denicija77bfd7c2016-11-15 00:41:26 -0800429 ":AppRTCMobile_lib",
adam.fedorbcc5d872016-11-07 14:53:28 -0800430 ":apprtc_signaling",
431 "//testing/gtest",
432 "//third_party/ocmock",
433 ]
434
435 sources = [
436 "objc/AppRTCMobile/tests/ARDAppClientTest.mm",
denicija77bfd7c2016-11-15 00:41:26 -0800437 "objc/AppRTCMobile/tests/ARDSettingsModelTests.mm",
adam.fedorbcc5d872016-11-07 14:53:28 -0800438 ]
439
440 if (is_ios) {
441 info_plist = "objc/AppRTCMobile/ios/Info.plist"
442 }
443
444 configs += [
445 ":rtc_apprtcmobile_config",
446 "//build/config/compiler:enable_arc",
447 ]
448 }
449 }
tkchin2ddfdba2016-08-07 21:37:45 -0700450}
kthelgason0727f152016-08-08 09:03:23 -0700451
452if (is_linux || is_win) {
ehmaldonadod02fe4b2016-08-26 13:31:24 -0700453 config("peerconnection_client_warnings_config") {
kjellander4a9abad2016-09-18 08:12:29 -0700454 cflags = []
ehmaldonadod02fe4b2016-08-26 13:31:24 -0700455 if (is_win && is_clang) {
kjellander4a9abad2016-09-18 08:12:29 -0700456 cflags += [
ehmaldonadod02fe4b2016-08-26 13:31:24 -0700457 # Disable warnings failing when compiling with Clang on Windows.
458 # https://bugs.chromium.org/p/webrtc/issues/detail?id=5366
459 "-Wno-format",
460
461 # See https://bugs.chromium.org/p/webrtc/issues/detail?id=6271
462 # for -Wno-reorder and -Wno-sign-compare
463 "-Wno-reorder",
464 "-Wno-sign-compare",
465 ]
466 }
kjellanderd4626e52016-09-07 02:33:01 -0700467 if (is_linux && target_cpu == "x86") {
kjellander4a9abad2016-09-18 08:12:29 -0700468 cflags += [
kjellanderd4626e52016-09-07 02:33:01 -0700469 # Needed to compile on Linux 32-bit.
470 "-Wno-sentinel",
471 ]
472 }
kjellander4a9abad2016-09-18 08:12:29 -0700473
474 if (is_clang) {
475 # TODO(ehmaldonado): Make peerconnection_client compile with the standard
476 # set of warnings.
477 # See https://bugs.chromium.org/p/webrtc/issues/detail?id=6306
478 cflags += [ "-Wno-inconsistent-missing-override" ]
479 }
ehmaldonadod02fe4b2016-08-26 13:31:24 -0700480 }
481
ehmaldonado38a21322016-09-02 04:10:34 -0700482 rtc_executable("peerconnection_client") {
kthelgason0727f152016-08-08 09:03:23 -0700483 sources = [
484 "peerconnection/client/conductor.cc",
485 "peerconnection/client/conductor.h",
486 "peerconnection/client/defaults.cc",
487 "peerconnection/client/defaults.h",
488 "peerconnection/client/peer_connection_client.cc",
489 "peerconnection/client/peer_connection_client.h",
490 ]
ehmaldonado7a2ce0b2016-09-05 01:35:44 -0700491
kjellandere40a7ee2016-10-16 23:56:12 -0700492 if (!build_with_chromium && is_clang) {
493 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
ehmaldonado38a21322016-09-02 04:10:34 -0700494 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
kthelgason0727f152016-08-08 09:03:23 -0700495 }
496 if (is_win) {
497 sources += [
498 "peerconnection/client/flagdefs.h",
499 "peerconnection/client/main.cc",
500 "peerconnection/client/main_wnd.cc",
501 "peerconnection/client/main_wnd.h",
502 ]
503 cflags = [ "/wd4245" ]
504 configs += [ "//build/config/win:windowed" ]
505 }
thomasandersonef16e992016-12-13 02:57:43 -0800506 deps = [
507 "//third_party/libyuv",
508 "//webrtc/api:libjingle_peerconnection",
509 "//webrtc/system_wrappers:field_trial_default",
510 "//webrtc/system_wrappers:metrics_default",
511 ]
kthelgason0727f152016-08-08 09:03:23 -0700512 if (is_linux) {
513 sources += [
514 "peerconnection/client/linux/main.cc",
515 "peerconnection/client/linux/main_wnd.cc",
516 "peerconnection/client/linux/main_wnd.h",
517 ]
518 libs = [
519 "X11",
520 "Xcomposite",
521 "Xext",
522 "Xrender",
523 ]
thomasandersonef16e992016-12-13 02:57:43 -0800524 deps += [ "//build/config/linux/gtk" ]
kthelgason0727f152016-08-08 09:03:23 -0700525 }
ehmaldonadod02fe4b2016-08-26 13:31:24 -0700526 configs += [ ":peerconnection_client_warnings_config" ]
kthelgason0727f152016-08-08 09:03:23 -0700527 if (rtc_build_json) {
528 deps += [ "//third_party/jsoncpp" ]
529 }
530 }
kjellanderd4626e52016-09-07 02:33:01 -0700531
ehmaldonado38a21322016-09-02 04:10:34 -0700532 rtc_executable("peerconnection_server") {
kthelgason0727f152016-08-08 09:03:23 -0700533 sources = [
534 "peerconnection/server/data_socket.cc",
535 "peerconnection/server/data_socket.h",
536 "peerconnection/server/main.cc",
537 "peerconnection/server/peer_channel.cc",
538 "peerconnection/server/peer_channel.h",
539 "peerconnection/server/utils.cc",
540 "peerconnection/server/utils.h",
541 ]
542 deps = [
543 "//webrtc:webrtc_common",
544 "//webrtc/base:rtc_base_approved",
545 "//webrtc/tools:command_line_parser",
546 ]
kjellandere40a7ee2016-10-16 23:56:12 -0700547 if (!build_with_chromium && is_clang) {
548 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
ehmaldonado38a21322016-09-02 04:10:34 -0700549 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
kthelgason0727f152016-08-08 09:03:23 -0700550 }
551 }
ehmaldonado38a21322016-09-02 04:10:34 -0700552 rtc_executable("relayserver") {
kthelgason0727f152016-08-08 09:03:23 -0700553 sources = [
554 "relayserver/relayserver_main.cc",
555 ]
556 deps = [
557 "//webrtc/base:rtc_base_approved",
558 "//webrtc/pc:rtc_pc",
559 "//webrtc/system_wrappers:field_trial_default",
560 "//webrtc/system_wrappers:metrics_default",
561 ]
kjellandere40a7ee2016-10-16 23:56:12 -0700562 if (!build_with_chromium && is_clang) {
563 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
ehmaldonado38a21322016-09-02 04:10:34 -0700564 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
kthelgason0727f152016-08-08 09:03:23 -0700565 }
566 }
ehmaldonado38a21322016-09-02 04:10:34 -0700567 rtc_executable("turnserver") {
kthelgason0727f152016-08-08 09:03:23 -0700568 sources = [
569 "turnserver/turnserver_main.cc",
570 ]
571 deps = [
572 "//webrtc/base:rtc_base_approved",
573 "//webrtc/pc:rtc_pc",
574 "//webrtc/system_wrappers:field_trial_default",
575 "//webrtc/system_wrappers:metrics_default",
576 ]
kjellandere40a7ee2016-10-16 23:56:12 -0700577 if (!build_with_chromium && is_clang) {
578 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
ehmaldonado38a21322016-09-02 04:10:34 -0700579 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
kthelgason0727f152016-08-08 09:03:23 -0700580 }
581 }
ehmaldonado38a21322016-09-02 04:10:34 -0700582 rtc_executable("stunserver") {
kthelgason0727f152016-08-08 09:03:23 -0700583 sources = [
584 "stunserver/stunserver_main.cc",
585 ]
586 deps = [
587 "//webrtc/base:rtc_base_approved",
588 "//webrtc/pc:rtc_pc",
589 "//webrtc/system_wrappers:field_trial_default",
590 "//webrtc/system_wrappers:metrics_default",
591 ]
kjellandere40a7ee2016-10-16 23:56:12 -0700592 if (!build_with_chromium && is_clang) {
593 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
ehmaldonado38a21322016-09-02 04:10:34 -0700594 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
kthelgason0727f152016-08-08 09:03:23 -0700595 }
596 }
597}
charujainaca3a242016-11-01 03:09:15 -0700598
599if (!build_with_chromium) {
600 # Doesn't build within Chrome on Win.
601 rtc_executable("stun_prober") {
602 sources = [
603 "stunprober/main.cc",
604 ]
605
606 if (!build_with_chromium && is_clang) {
607 # Suppress warnings from Chrome's Clang plugins.
608 # See http://code.google.com/p/webrtc/issues/detail?id=163 for details.
609 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
610 }
611
612 deps = [
613 "../p2p:libstunprober",
614 "../p2p:rtc_p2p",
615 "../system_wrappers:field_trial_default",
616 ]
617 }
618}