blob: 8d1dcbb3a123ad2282410237e0efa59112d6b3cf [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}
kthelgason0727f152016-08-08 09:03:23 -070018if (is_linux) {
19 import("//build/config/linux/pkg_config.gni")
20}
Sami Kalliomaki9c0c75b2016-06-29 14:55:00 +020021
22group("examples") {
kjellander6ceab082016-10-28 05:44:03 -070023 # This target shall build all targets in examples.
24 testonly = true
kjellander705ecc52016-09-15 00:53:26 -070025 public_deps = []
Sami Kalliomaki9c0c75b2016-06-29 14:55:00 +020026
tkchin2ddfdba2016-08-07 21:37:45 -070027 if (is_android) {
kjellander6ceab082016-10-28 05:44:03 -070028 public_deps += [
29 ":AppRTCMobile",
30 ":AppRTCMobileTest",
31 ]
32 }
33
charujainaca3a242016-11-01 03:09:15 -070034 if (!build_with_chromium) {
35 public_deps += [ ":stun_prober" ]
36 }
37
kjellander6ceab082016-10-28 05:44:03 -070038 if (is_ios || (is_mac && target_cpu != "x86")) {
Magnus Jedvertc1815cf2016-09-27 10:10:41 +020039 public_deps += [ ":AppRTCMobile" ]
Sami Kalliomaki9c0c75b2016-06-29 14:55:00 +020040 }
kjellander6ceab082016-10-28 05:44:03 -070041
42 if (is_linux || is_win) {
kjellander705ecc52016-09-15 00:53:26 -070043 public_deps += [
kthelgason0727f152016-08-08 09:03:23 -070044 ":peerconnection_client",
45 ":peerconnection_server",
46 ":relayserver",
47 ":stunserver",
48 ":turnserver",
49 ]
50 }
Sami Kalliomaki9c0c75b2016-06-29 14:55:00 +020051}
52
tkchin2ddfdba2016-08-07 21:37:45 -070053if (is_android) {
Magnus Jedvertc1815cf2016-09-27 10:10:41 +020054 android_apk("AppRTCMobile") {
55 apk_name = "AppRTCMobile"
Sami Kalliomaki9c0c75b2016-06-29 14:55:00 +020056 android_manifest = "androidapp/AndroidManifest.xml"
57
58 deps = [
Magnus Jedvertc1815cf2016-09-27 10:10:41 +020059 ":AppRTCMobile_javalib",
60 ":AppRTCMobile_resources",
Sami Kalliomaki9c0c75b2016-06-29 14:55:00 +020061 "//base:base_java",
62 "//webrtc/base:base_java",
63 ]
64
magjed768c6482016-12-06 04:29:37 -080065 shared_libraries = [ "//webrtc/sdk/android:libjingle_peerconnection_so" ]
Sami Kalliomaki9c0c75b2016-06-29 14:55:00 +020066 }
67
Magnus Jedvertc1815cf2016-09-27 10:10:41 +020068 android_library("AppRTCMobile_javalib") {
Sami Kalliomaki9c0c75b2016-06-29 14:55:00 +020069 java_files = [
70 "androidapp/src/org/appspot/apprtc/AppRTCAudioManager.java",
71 "androidapp/src/org/appspot/apprtc/AppRTCClient.java",
72 "androidapp/src/org/appspot/apprtc/AppRTCProximitySensor.java",
73 "androidapp/src/org/appspot/apprtc/CallActivity.java",
74 "androidapp/src/org/appspot/apprtc/CallFragment.java",
75 "androidapp/src/org/appspot/apprtc/CaptureQualityController.java",
76 "androidapp/src/org/appspot/apprtc/ConnectActivity.java",
77 "androidapp/src/org/appspot/apprtc/CpuMonitor.java",
78 "androidapp/src/org/appspot/apprtc/DirectRTCClient.java",
79 "androidapp/src/org/appspot/apprtc/HudFragment.java",
80 "androidapp/src/org/appspot/apprtc/PeerConnectionClient.java",
81 "androidapp/src/org/appspot/apprtc/PercentFrameLayout.java",
82 "androidapp/src/org/appspot/apprtc/RoomParametersFetcher.java",
83 "androidapp/src/org/appspot/apprtc/SettingsActivity.java",
84 "androidapp/src/org/appspot/apprtc/SettingsFragment.java",
85 "androidapp/src/org/appspot/apprtc/TCPChannelClient.java",
86 "androidapp/src/org/appspot/apprtc/UnhandledExceptionHandler.java",
87 "androidapp/src/org/appspot/apprtc/WebSocketChannelClient.java",
88 "androidapp/src/org/appspot/apprtc/WebSocketRTCClient.java",
89 "androidapp/src/org/appspot/apprtc/util/AppRTCUtils.java",
90 "androidapp/src/org/appspot/apprtc/util/AsyncHttpURLConnection.java",
Sami Kalliomaki9c0c75b2016-06-29 14:55:00 +020091 ]
92
93 deps = [
Magnus Jedvertc1815cf2016-09-27 10:10:41 +020094 ":AppRTCMobile_resources",
Sami Kalliomaki9c0c75b2016-06-29 14:55:00 +020095 "//webrtc/base:base_java",
96 "//webrtc/examples/androidapp/third_party/autobanh:autobanh_java",
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
mandermoa8bec8d2016-10-26 01:47:07 -0700111 java_files = [
mandermo9890a582016-10-27 07:26:36 -0700112 "androidtests/src/org/appspot/apprtc/test/FileVideoCapturerTest.java",
mandermoa8bec8d2016-10-26 01:47:07 -0700113 "androidtests/src/org/appspot/apprtc/test/PeerConnectionClientTest.java",
114 "androidtests/src/org/appspot/apprtc/test/VideoFileRendererTest.java",
115 ]
Sami Kalliomaki9c0c75b2016-06-29 14:55:00 +0200116
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200117 apk_under_test = ":AppRTCMobile"
Sami Kalliomaki9c0c75b2016-06-29 14:55:00 +0200118
119 deps = [
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200120 ":AppRTCMobile_javalib",
magjed768c6482016-12-06 04:29:37 -0800121 "//webrtc/sdk/android:libjingle_peerconnection_java",
Sami Kalliomaki9c0c75b2016-06-29 14:55:00 +0200122 ]
mandermo9890a582016-10-27 07:26:36 -0700123
124 data = [
125 "//webrtc/examples/androidtests/src/org/appspot/apprtc/test/capturetestvideo.y4m",
126 ]
Sami Kalliomaki9c0c75b2016-06-29 14:55:00 +0200127 }
Sami Kalliomaki9c0c75b2016-06-29 14:55:00 +0200128}
tkchin2ddfdba2016-08-07 21:37:45 -0700129
130if (is_ios || (is_mac && target_cpu != "x86")) {
131 config("warnings_config") {
132 # GN orders flags on a target before flags from configs. The default config
133 # adds these flags so to cancel them out they need to come from a config and
134 # cannot be on the target directly.
135 if (is_ios) {
136 # Suppress compiler warnings about deprecated that triggered
137 # when moving from ios_deployment_target 7.0 to 9.0.
138 # See webrtc:5549 for more details.
139 cflags = [ "-Wno-deprecated-declarations" ]
Henrik Kjellander91a57592016-10-12 20:25:34 -0700140 cflags_objc = [
141 # Enabled for cflags_objc in build/config/compiler/BUILD.gn.
142 # See webrtc:6520.
143 "-Wno-objc-missing-property-synthesis",
144 ]
tkchin2ddfdba2016-08-07 21:37:45 -0700145 }
146 }
147
148 config("apprtc_common_config") {
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200149 include_dirs = [ "objc/AppRTCMobile/common" ]
tkchin2ddfdba2016-08-07 21:37:45 -0700150 }
151
kjellanderb62dbbe2016-09-23 00:38:52 -0700152 rtc_static_library("apprtc_common") {
tkchin2ddfdba2016-08-07 21:37:45 -0700153 sources = [
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200154 "objc/AppRTCMobile/common/ARDUtilities.h",
155 "objc/AppRTCMobile/common/ARDUtilities.m",
tkchin2ddfdba2016-08-07 21:37:45 -0700156 ]
157 configs += [
tkchin2ddfdba2016-08-07 21:37:45 -0700158 ":warnings_config",
159 "//build/config/compiler:enable_arc",
160 ]
ehmaldonadoe9cc6862016-09-05 06:10:18 -0700161 public_configs = [ ":apprtc_common_config" ]
tkchin2ddfdba2016-08-07 21:37:45 -0700162
163 deps = [
164 "../sdk:rtc_sdk_common_objc",
165 "../system_wrappers:field_trial_default",
166 "../system_wrappers:metrics_default",
167 ]
168 }
169
170 config("apprtc_signaling_config") {
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200171 include_dirs = [ "objc/AppRTCMobile" ]
tkchin2ddfdba2016-08-07 21:37:45 -0700172
173 # GN orders flags on a target before flags from configs. The default config
174 # adds these flags so to cancel them out they need to come from a config and
175 # cannot be on the target directly.
176 cflags = [
177 "-Wno-sign-compare",
178 "-Wno-unused-variable",
179 ]
180 if (is_mac) {
181 cflags += [ "-Wno-partial-availability" ]
182 }
183 }
184
kjellanderb62dbbe2016-09-23 00:38:52 -0700185 rtc_static_library("apprtc_signaling") {
tkchin2ddfdba2016-08-07 21:37:45 -0700186 sources = [
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200187 "objc/AppRTCMobile/ARDAppClient+Internal.h",
188 "objc/AppRTCMobile/ARDAppClient.h",
189 "objc/AppRTCMobile/ARDAppClient.m",
190 "objc/AppRTCMobile/ARDAppEngineClient.h",
191 "objc/AppRTCMobile/ARDAppEngineClient.m",
192 "objc/AppRTCMobile/ARDBitrateTracker.h",
193 "objc/AppRTCMobile/ARDBitrateTracker.m",
194 "objc/AppRTCMobile/ARDCEODTURNClient.h",
195 "objc/AppRTCMobile/ARDCEODTURNClient.m",
196 "objc/AppRTCMobile/ARDJoinResponse+Internal.h",
197 "objc/AppRTCMobile/ARDJoinResponse.h",
198 "objc/AppRTCMobile/ARDJoinResponse.m",
199 "objc/AppRTCMobile/ARDMessageResponse+Internal.h",
200 "objc/AppRTCMobile/ARDMessageResponse.h",
201 "objc/AppRTCMobile/ARDMessageResponse.m",
202 "objc/AppRTCMobile/ARDRoomServerClient.h",
203 "objc/AppRTCMobile/ARDSDPUtils.h",
204 "objc/AppRTCMobile/ARDSDPUtils.m",
205 "objc/AppRTCMobile/ARDSignalingChannel.h",
206 "objc/AppRTCMobile/ARDSignalingMessage.h",
207 "objc/AppRTCMobile/ARDSignalingMessage.m",
208 "objc/AppRTCMobile/ARDStatsBuilder.h",
209 "objc/AppRTCMobile/ARDStatsBuilder.m",
210 "objc/AppRTCMobile/ARDTURNClient.h",
211 "objc/AppRTCMobile/ARDWebSocketChannel.h",
212 "objc/AppRTCMobile/ARDWebSocketChannel.m",
213 "objc/AppRTCMobile/RTCIceCandidate+JSON.h",
214 "objc/AppRTCMobile/RTCIceCandidate+JSON.m",
215 "objc/AppRTCMobile/RTCIceServer+JSON.h",
216 "objc/AppRTCMobile/RTCIceServer+JSON.m",
217 "objc/AppRTCMobile/RTCMediaConstraints+JSON.h",
218 "objc/AppRTCMobile/RTCMediaConstraints+JSON.m",
219 "objc/AppRTCMobile/RTCSessionDescription+JSON.h",
220 "objc/AppRTCMobile/RTCSessionDescription+JSON.m",
tkchin2ddfdba2016-08-07 21:37:45 -0700221 ]
222 configs += [
tkchin2ddfdba2016-08-07 21:37:45 -0700223 "//build/config/compiler:enable_arc",
224 ":warnings_config",
225 ]
ehmaldonadoe9cc6862016-09-05 06:10:18 -0700226 public_configs = [ ":apprtc_signaling_config" ]
tkchin2ddfdba2016-08-07 21:37:45 -0700227 deps = [
228 ":apprtc_common",
229 ":socketrocket",
230 ]
231 public_deps = [
232 "../sdk:rtc_sdk_peerconnection_objc",
233 ]
234 libs = [ "QuartzCore.framework" ]
235 }
236
237 if (is_ios) {
denicija77bfd7c2016-11-15 00:41:26 -0800238 rtc_static_library("AppRTCMobile_lib") {
tkchin2ddfdba2016-08-07 21:37:45 -0700239 sources = [
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200240 "objc/AppRTCMobile/ios/ARDAppDelegate.m",
241 "objc/AppRTCMobile/ios/ARDMainView.h",
242 "objc/AppRTCMobile/ios/ARDMainView.m",
243 "objc/AppRTCMobile/ios/ARDMainViewController.h",
244 "objc/AppRTCMobile/ios/ARDMainViewController.m",
denicija2256e042016-11-09 06:26:18 -0800245 "objc/AppRTCMobile/ios/ARDSettingsModel+Private.h",
246 "objc/AppRTCMobile/ios/ARDSettingsModel.h",
247 "objc/AppRTCMobile/ios/ARDSettingsModel.m",
248 "objc/AppRTCMobile/ios/ARDSettingsStore.h",
249 "objc/AppRTCMobile/ios/ARDSettingsStore.m",
denicijad17d5362016-11-02 02:56:09 -0700250 "objc/AppRTCMobile/ios/ARDSettingsViewController.h",
251 "objc/AppRTCMobile/ios/ARDSettingsViewController.m",
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200252 "objc/AppRTCMobile/ios/ARDStatsView.h",
253 "objc/AppRTCMobile/ios/ARDStatsView.m",
254 "objc/AppRTCMobile/ios/ARDVideoCallView.h",
255 "objc/AppRTCMobile/ios/ARDVideoCallView.m",
256 "objc/AppRTCMobile/ios/ARDVideoCallViewController.h",
257 "objc/AppRTCMobile/ios/ARDVideoCallViewController.m",
258 "objc/AppRTCMobile/ios/AppRTCMobile-Prefix.pch",
259 "objc/AppRTCMobile/ios/UIImage+ARDUtilities.h",
260 "objc/AppRTCMobile/ios/UIImage+ARDUtilities.m",
denicija77bfd7c2016-11-15 00:41:26 -0800261 ]
262 configs += [
263 "//build/config/compiler:enable_arc",
264 ":warnings_config",
265 ]
266
267 deps = [
268 ":apprtc_common",
269 ":apprtc_signaling",
270 ]
271 }
272
273 ios_app_bundle("AppRTCMobile") {
274 sources = [
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200275 "objc/AppRTCMobile/ios/main.m",
tkchin2ddfdba2016-08-07 21:37:45 -0700276 ]
277
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200278 info_plist = "objc/AppRTCMobile/ios/Info.plist"
tkchin2ddfdba2016-08-07 21:37:45 -0700279
denicija77bfd7c2016-11-15 00:41:26 -0800280 configs += [ "..:common_config" ]
tkchin2ddfdba2016-08-07 21:37:45 -0700281 public_configs = [ "..:common_inherited_config" ]
282
283 deps = [
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200284 ":AppRTCMobile_ios_bundle_data",
denicija77bfd7c2016-11-15 00:41:26 -0800285 ":AppRTCMobile_lib",
tkchin2ddfdba2016-08-07 21:37:45 -0700286 ]
287
288 if (target_cpu == "x86") {
289 deps += [ "//testing/iossim:iossim" ]
290 }
291 }
292
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200293 bundle_data("AppRTCMobile_ios_bundle_data") {
tkchin2ddfdba2016-08-07 21:37:45 -0700294 sources = [
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200295 "objc/AppRTCMobile/ios/resources/Roboto-Regular.ttf",
296 "objc/AppRTCMobile/ios/resources/iPhone5@2x.png",
297 "objc/AppRTCMobile/ios/resources/iPhone6@2x.png",
298 "objc/AppRTCMobile/ios/resources/iPhone6p@3x.png",
299 "objc/AppRTCMobile/ios/resources/ic_call_end_black_24dp.png",
300 "objc/AppRTCMobile/ios/resources/ic_call_end_black_24dp@2x.png",
301 "objc/AppRTCMobile/ios/resources/ic_clear_black_24dp.png",
302 "objc/AppRTCMobile/ios/resources/ic_clear_black_24dp@2x.png",
denicija6d6762c2016-10-28 04:53:16 -0700303 "objc/AppRTCMobile/ios/resources/ic_settings_black_24dp.png",
304 "objc/AppRTCMobile/ios/resources/ic_settings_black_24dp@2x.png",
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200305 "objc/AppRTCMobile/ios/resources/ic_surround_sound_black_24dp.png",
306 "objc/AppRTCMobile/ios/resources/ic_surround_sound_black_24dp@2x.png",
307 "objc/AppRTCMobile/ios/resources/ic_switch_video_black_24dp.png",
308 "objc/AppRTCMobile/ios/resources/ic_switch_video_black_24dp@2x.png",
309 "objc/AppRTCMobile/ios/resources/mozart.mp3",
tkchin2ddfdba2016-08-07 21:37:45 -0700310 "objc/Icon.png",
311 ]
312 outputs = [
313 "{{bundle_resources_dir}}/{{source_file_part}}",
314 ]
315 }
316 }
317
318 if (is_mac) {
denicija77bfd7c2016-11-15 00:41:26 -0800319 rtc_static_library("AppRTCMobile_lib") {
tkchin2ddfdba2016-08-07 21:37:45 -0700320 sources = [
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200321 "objc/AppRTCMobile/mac/APPRTCAppDelegate.h",
322 "objc/AppRTCMobile/mac/APPRTCAppDelegate.m",
323 "objc/AppRTCMobile/mac/APPRTCViewController.h",
324 "objc/AppRTCMobile/mac/APPRTCViewController.m",
tkchin2ddfdba2016-08-07 21:37:45 -0700325 ]
326 configs += [
tkchin2ddfdba2016-08-07 21:37:45 -0700327 "..:common_objc",
328 "//build/config/compiler:enable_arc",
329 ]
330 deps = [
331 ":apprtc_common",
332 ":apprtc_signaling",
333 ]
334 }
335
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200336 mac_app_bundle("AppRTCMobile") {
337 output_name = "AppRTCMobile"
tkchin2ddfdba2016-08-07 21:37:45 -0700338
339 extra_substitutions = [ "MACOSX_DEPLOYMENT_TARGET=10.8" ]
340
341 sources = [
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200342 "objc/AppRTCMobile/mac/main.m",
tkchin2ddfdba2016-08-07 21:37:45 -0700343 ]
344
345 public_configs = [ "..:common_inherited_config" ]
346
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200347 info_plist = "objc/AppRTCMobile/mac/Info.plist"
tkchin2ddfdba2016-08-07 21:37:45 -0700348
349 libs = [ "AppKit.framework" ]
350
351 deps = [
denicija77bfd7c2016-11-15 00:41:26 -0800352 ":AppRTCMobile_lib",
tkchin2ddfdba2016-08-07 21:37:45 -0700353 ]
354 }
355 }
356
357 config("socketrocket_include_config") {
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200358 include_dirs = [ "objc/AppRTCMobile/third_party/SocketRocket" ]
tkchin2ddfdba2016-08-07 21:37:45 -0700359 }
360
361 config("socketrocket_warning_config") {
362 # GN orders flags on a target before flags from configs. The default config
363 # adds these flags so to cancel them out they need to come from a config and
364 # cannot be on the target directly.
365 cflags = [
366 "-Wno-deprecated-declarations",
367 "-Wno-nonnull",
tkchin2ddfdba2016-08-07 21:37:45 -0700368 "-Wno-semicolon-before-method-body",
369 "-Wno-unused-variable",
370 ]
371
henrika27d8b612016-09-21 04:13:00 -0700372 cflags_objc = [
373 # Enabled for cflags_objc in build/config/compiler/BUILD.gn.
374 "-Wno-objc-missing-property-synthesis",
375
376 # Hide the warning for SecRandomCopyBytes(), until we update to upstream.
377 # https://bugs.chromium.org/p/webrtc/issues/detail?id=6396
378 "-Wno-unused-result",
379 ]
tkchin2ddfdba2016-08-07 21:37:45 -0700380
381 if (is_mac) {
382 cflags += [ "-Wno-partial-availability" ]
383 }
384 }
385
kjellanderb62dbbe2016-09-23 00:38:52 -0700386 rtc_static_library("socketrocket") {
tkchin2ddfdba2016-08-07 21:37:45 -0700387 sources = [
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200388 "objc/AppRTCMobile/third_party/SocketRocket/SRWebSocket.h",
389 "objc/AppRTCMobile/third_party/SocketRocket/SRWebSocket.m",
tkchin2ddfdba2016-08-07 21:37:45 -0700390 ]
391 configs += [
tkchin2ddfdba2016-08-07 21:37:45 -0700392 "//build/config/compiler:enable_arc",
393 ":socketrocket_warning_config",
394 ]
ehmaldonadoe9cc6862016-09-05 06:10:18 -0700395 public_configs = [ ":socketrocket_include_config" ]
tkchin2ddfdba2016-08-07 21:37:45 -0700396
397 libs = [
398 "CFNetwork.framework",
399 "icucore",
400 ]
401 }
adam.fedorbcc5d872016-11-07 14:53:28 -0800402
403 if (rtc_include_tests) {
404 config("rtc_apprtcmobile_config") {
405 defines = [ "GTEST_RELATIVE_PATH" ]
406 }
407
408 rtc_test("apprtcmobile_tests") {
denicija77bfd7c2016-11-15 00:41:26 -0800409 include_dirs = [ "objc/AppRTCMobile/ios" ]
adam.fedorbcc5d872016-11-07 14:53:28 -0800410 deps = [
denicija77bfd7c2016-11-15 00:41:26 -0800411 ":AppRTCMobile_lib",
adam.fedorbcc5d872016-11-07 14:53:28 -0800412 ":apprtc_signaling",
413 "//testing/gtest",
414 "//third_party/ocmock",
415 ]
416
417 sources = [
418 "objc/AppRTCMobile/tests/ARDAppClientTest.mm",
denicija77bfd7c2016-11-15 00:41:26 -0800419 "objc/AppRTCMobile/tests/ARDSettingsModelTests.mm",
adam.fedorbcc5d872016-11-07 14:53:28 -0800420 ]
421
422 if (is_ios) {
423 info_plist = "objc/AppRTCMobile/ios/Info.plist"
424 }
425
426 configs += [
427 ":rtc_apprtcmobile_config",
428 "//build/config/compiler:enable_arc",
429 ]
430 }
431 }
tkchin2ddfdba2016-08-07 21:37:45 -0700432}
kthelgason0727f152016-08-08 09:03:23 -0700433
434if (is_linux || is_win) {
435 if (is_linux) {
436 pkg_config("gtk2_config") {
437 # Gtk requires gmodule, but it does not list it as a dependency in some
438 # misconfigured systems.
439 packages = [
440 "gmodule-2.0",
441 "gtk+-2.0",
442 "gthread-2.0",
443 ]
444 }
445 }
446
ehmaldonadod02fe4b2016-08-26 13:31:24 -0700447 config("peerconnection_client_warnings_config") {
kjellander4a9abad2016-09-18 08:12:29 -0700448 cflags = []
ehmaldonadod02fe4b2016-08-26 13:31:24 -0700449 if (is_win && is_clang) {
kjellander4a9abad2016-09-18 08:12:29 -0700450 cflags += [
ehmaldonadod02fe4b2016-08-26 13:31:24 -0700451 # Disable warnings failing when compiling with Clang on Windows.
452 # https://bugs.chromium.org/p/webrtc/issues/detail?id=5366
453 "-Wno-format",
454
455 # See https://bugs.chromium.org/p/webrtc/issues/detail?id=6271
456 # for -Wno-reorder and -Wno-sign-compare
457 "-Wno-reorder",
458 "-Wno-sign-compare",
459 ]
460 }
kjellanderd4626e52016-09-07 02:33:01 -0700461 if (is_linux && target_cpu == "x86") {
kjellander4a9abad2016-09-18 08:12:29 -0700462 cflags += [
kjellanderd4626e52016-09-07 02:33:01 -0700463 # Needed to compile on Linux 32-bit.
464 "-Wno-sentinel",
465 ]
466 }
kjellander4a9abad2016-09-18 08:12:29 -0700467
468 if (is_clang) {
469 # TODO(ehmaldonado): Make peerconnection_client compile with the standard
470 # set of warnings.
471 # See https://bugs.chromium.org/p/webrtc/issues/detail?id=6306
472 cflags += [ "-Wno-inconsistent-missing-override" ]
473 }
ehmaldonadod02fe4b2016-08-26 13:31:24 -0700474 }
475
ehmaldonado38a21322016-09-02 04:10:34 -0700476 rtc_executable("peerconnection_client") {
kthelgason0727f152016-08-08 09:03:23 -0700477 sources = [
478 "peerconnection/client/conductor.cc",
479 "peerconnection/client/conductor.h",
480 "peerconnection/client/defaults.cc",
481 "peerconnection/client/defaults.h",
482 "peerconnection/client/peer_connection_client.cc",
483 "peerconnection/client/peer_connection_client.h",
484 ]
ehmaldonado7a2ce0b2016-09-05 01:35:44 -0700485
kjellandere40a7ee2016-10-16 23:56:12 -0700486 if (!build_with_chromium && is_clang) {
487 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
ehmaldonado38a21322016-09-02 04:10:34 -0700488 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
kthelgason0727f152016-08-08 09:03:23 -0700489 }
490 if (is_win) {
491 sources += [
492 "peerconnection/client/flagdefs.h",
493 "peerconnection/client/main.cc",
494 "peerconnection/client/main_wnd.cc",
495 "peerconnection/client/main_wnd.h",
496 ]
497 cflags = [ "/wd4245" ]
498 configs += [ "//build/config/win:windowed" ]
499 }
500 if (is_linux) {
501 sources += [
502 "peerconnection/client/linux/main.cc",
503 "peerconnection/client/linux/main_wnd.cc",
504 "peerconnection/client/linux/main_wnd.h",
505 ]
506 libs = [
507 "X11",
508 "Xcomposite",
509 "Xext",
510 "Xrender",
511 ]
512 public_configs = [ ":gtk2_config" ]
513 }
514 deps = [
nisse9f8e37b2016-09-01 01:06:23 -0700515 "//third_party/libyuv",
kthelgason0727f152016-08-08 09:03:23 -0700516 "//webrtc/api:libjingle_peerconnection",
517 "//webrtc/system_wrappers:field_trial_default",
518 "//webrtc/system_wrappers:metrics_default",
519 ]
ehmaldonadod02fe4b2016-08-26 13:31:24 -0700520 configs += [ ":peerconnection_client_warnings_config" ]
kthelgason0727f152016-08-08 09:03:23 -0700521 if (rtc_build_json) {
522 deps += [ "//third_party/jsoncpp" ]
523 }
524 }
kjellanderd4626e52016-09-07 02:33:01 -0700525
ehmaldonado38a21322016-09-02 04:10:34 -0700526 rtc_executable("peerconnection_server") {
kthelgason0727f152016-08-08 09:03:23 -0700527 sources = [
528 "peerconnection/server/data_socket.cc",
529 "peerconnection/server/data_socket.h",
530 "peerconnection/server/main.cc",
531 "peerconnection/server/peer_channel.cc",
532 "peerconnection/server/peer_channel.h",
533 "peerconnection/server/utils.cc",
534 "peerconnection/server/utils.h",
535 ]
536 deps = [
537 "//webrtc:webrtc_common",
538 "//webrtc/base:rtc_base_approved",
539 "//webrtc/tools:command_line_parser",
540 ]
kjellandere40a7ee2016-10-16 23:56:12 -0700541 if (!build_with_chromium && is_clang) {
542 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
ehmaldonado38a21322016-09-02 04:10:34 -0700543 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
kthelgason0727f152016-08-08 09:03:23 -0700544 }
545 }
ehmaldonado38a21322016-09-02 04:10:34 -0700546 rtc_executable("relayserver") {
kthelgason0727f152016-08-08 09:03:23 -0700547 sources = [
548 "relayserver/relayserver_main.cc",
549 ]
550 deps = [
551 "//webrtc/base:rtc_base_approved",
552 "//webrtc/pc:rtc_pc",
553 "//webrtc/system_wrappers:field_trial_default",
554 "//webrtc/system_wrappers:metrics_default",
555 ]
kjellandere40a7ee2016-10-16 23:56:12 -0700556 if (!build_with_chromium && is_clang) {
557 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
ehmaldonado38a21322016-09-02 04:10:34 -0700558 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
kthelgason0727f152016-08-08 09:03:23 -0700559 }
560 }
ehmaldonado38a21322016-09-02 04:10:34 -0700561 rtc_executable("turnserver") {
kthelgason0727f152016-08-08 09:03:23 -0700562 sources = [
563 "turnserver/turnserver_main.cc",
564 ]
565 deps = [
566 "//webrtc/base:rtc_base_approved",
567 "//webrtc/pc:rtc_pc",
568 "//webrtc/system_wrappers:field_trial_default",
569 "//webrtc/system_wrappers:metrics_default",
570 ]
kjellandere40a7ee2016-10-16 23:56:12 -0700571 if (!build_with_chromium && is_clang) {
572 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
ehmaldonado38a21322016-09-02 04:10:34 -0700573 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
kthelgason0727f152016-08-08 09:03:23 -0700574 }
575 }
ehmaldonado38a21322016-09-02 04:10:34 -0700576 rtc_executable("stunserver") {
kthelgason0727f152016-08-08 09:03:23 -0700577 sources = [
578 "stunserver/stunserver_main.cc",
579 ]
580 deps = [
581 "//webrtc/base:rtc_base_approved",
582 "//webrtc/pc:rtc_pc",
583 "//webrtc/system_wrappers:field_trial_default",
584 "//webrtc/system_wrappers:metrics_default",
585 ]
kjellandere40a7ee2016-10-16 23:56:12 -0700586 if (!build_with_chromium && is_clang) {
587 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
ehmaldonado38a21322016-09-02 04:10:34 -0700588 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
kthelgason0727f152016-08-08 09:03:23 -0700589 }
590 }
591}
charujainaca3a242016-11-01 03:09:15 -0700592
593if (!build_with_chromium) {
594 # Doesn't build within Chrome on Win.
595 rtc_executable("stun_prober") {
596 sources = [
597 "stunprober/main.cc",
598 ]
599
600 if (!build_with_chromium && is_clang) {
601 # Suppress warnings from Chrome's Clang plugins.
602 # See http://code.google.com/p/webrtc/issues/detail?id=163 for details.
603 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
604 }
605
606 deps = [
607 "../p2p:libstunprober",
608 "../p2p:rtc_p2p",
609 "../system_wrappers:field_trial_default",
610 ]
611 }
612}