blob: 58ae8a4c1afd5943b2159b21c333b0a19aa31b1b [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
65 shared_libraries = [ "//webrtc/api:libjingle_peerconnection_so" ]
66 }
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/api:libjingle_peerconnection_java",
96 "//webrtc/base:base_java",
97 "//webrtc/examples/androidapp/third_party/autobanh:autobanh_java",
98 ]
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
mandermoa8bec8d2016-10-26 01:47:07 -0700110 java_files = [
mandermo9890a582016-10-27 07:26:36 -0700111 "androidtests/src/org/appspot/apprtc/test/FileVideoCapturerTest.java",
mandermoa8bec8d2016-10-26 01:47:07 -0700112 "androidtests/src/org/appspot/apprtc/test/PeerConnectionClientTest.java",
113 "androidtests/src/org/appspot/apprtc/test/VideoFileRendererTest.java",
114 ]
Sami Kalliomaki9c0c75b2016-06-29 14:55:00 +0200115
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200116 apk_under_test = ":AppRTCMobile"
Sami Kalliomaki9c0c75b2016-06-29 14:55:00 +0200117
118 deps = [
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200119 ":AppRTCMobile_javalib",
Sami Kalliomaki9c0c75b2016-06-29 14:55:00 +0200120 "//webrtc/api:libjingle_peerconnection_java",
121 ]
mandermo9890a582016-10-27 07:26:36 -0700122
123 data = [
124 "//webrtc/examples/androidtests/src/org/appspot/apprtc/test/capturetestvideo.y4m",
125 ]
Sami Kalliomaki9c0c75b2016-06-29 14:55:00 +0200126 }
Sami Kalliomaki9c0c75b2016-06-29 14:55:00 +0200127}
tkchin2ddfdba2016-08-07 21:37:45 -0700128
129if (is_ios || (is_mac && target_cpu != "x86")) {
130 config("warnings_config") {
131 # GN orders flags on a target before flags from configs. The default config
132 # adds these flags so to cancel them out they need to come from a config and
133 # cannot be on the target directly.
134 if (is_ios) {
135 # Suppress compiler warnings about deprecated that triggered
136 # when moving from ios_deployment_target 7.0 to 9.0.
137 # See webrtc:5549 for more details.
138 cflags = [ "-Wno-deprecated-declarations" ]
Henrik Kjellander91a57592016-10-12 20:25:34 -0700139 cflags_objc = [
140 # Enabled for cflags_objc in build/config/compiler/BUILD.gn.
141 # See webrtc:6520.
142 "-Wno-objc-missing-property-synthesis",
143 ]
tkchin2ddfdba2016-08-07 21:37:45 -0700144 }
145 }
146
147 config("apprtc_common_config") {
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200148 include_dirs = [ "objc/AppRTCMobile/common" ]
tkchin2ddfdba2016-08-07 21:37:45 -0700149 }
150
kjellanderb62dbbe2016-09-23 00:38:52 -0700151 rtc_static_library("apprtc_common") {
tkchin2ddfdba2016-08-07 21:37:45 -0700152 sources = [
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200153 "objc/AppRTCMobile/common/ARDUtilities.h",
154 "objc/AppRTCMobile/common/ARDUtilities.m",
tkchin2ddfdba2016-08-07 21:37:45 -0700155 ]
156 configs += [
tkchin2ddfdba2016-08-07 21:37:45 -0700157 ":warnings_config",
158 "//build/config/compiler:enable_arc",
159 ]
ehmaldonadoe9cc6862016-09-05 06:10:18 -0700160 public_configs = [ ":apprtc_common_config" ]
tkchin2ddfdba2016-08-07 21:37:45 -0700161
162 deps = [
163 "../sdk:rtc_sdk_common_objc",
164 "../system_wrappers:field_trial_default",
165 "../system_wrappers:metrics_default",
166 ]
167 }
168
169 config("apprtc_signaling_config") {
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200170 include_dirs = [ "objc/AppRTCMobile" ]
tkchin2ddfdba2016-08-07 21:37:45 -0700171
172 # GN orders flags on a target before flags from configs. The default config
173 # adds these flags so to cancel them out they need to come from a config and
174 # cannot be on the target directly.
175 cflags = [
176 "-Wno-sign-compare",
177 "-Wno-unused-variable",
178 ]
179 if (is_mac) {
180 cflags += [ "-Wno-partial-availability" ]
181 }
182 }
183
kjellanderb62dbbe2016-09-23 00:38:52 -0700184 rtc_static_library("apprtc_signaling") {
tkchin2ddfdba2016-08-07 21:37:45 -0700185 sources = [
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200186 "objc/AppRTCMobile/ARDAppClient+Internal.h",
187 "objc/AppRTCMobile/ARDAppClient.h",
188 "objc/AppRTCMobile/ARDAppClient.m",
189 "objc/AppRTCMobile/ARDAppEngineClient.h",
190 "objc/AppRTCMobile/ARDAppEngineClient.m",
191 "objc/AppRTCMobile/ARDBitrateTracker.h",
192 "objc/AppRTCMobile/ARDBitrateTracker.m",
193 "objc/AppRTCMobile/ARDCEODTURNClient.h",
194 "objc/AppRTCMobile/ARDCEODTURNClient.m",
195 "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",
209 "objc/AppRTCMobile/ARDTURNClient.h",
210 "objc/AppRTCMobile/ARDWebSocketChannel.h",
211 "objc/AppRTCMobile/ARDWebSocketChannel.m",
212 "objc/AppRTCMobile/RTCIceCandidate+JSON.h",
213 "objc/AppRTCMobile/RTCIceCandidate+JSON.m",
214 "objc/AppRTCMobile/RTCIceServer+JSON.h",
215 "objc/AppRTCMobile/RTCIceServer+JSON.m",
216 "objc/AppRTCMobile/RTCMediaConstraints+JSON.h",
217 "objc/AppRTCMobile/RTCMediaConstraints+JSON.m",
218 "objc/AppRTCMobile/RTCSessionDescription+JSON.h",
219 "objc/AppRTCMobile/RTCSessionDescription+JSON.m",
tkchin2ddfdba2016-08-07 21:37:45 -0700220 ]
221 configs += [
tkchin2ddfdba2016-08-07 21:37:45 -0700222 "//build/config/compiler:enable_arc",
223 ":warnings_config",
224 ]
ehmaldonadoe9cc6862016-09-05 06:10:18 -0700225 public_configs = [ ":apprtc_signaling_config" ]
tkchin2ddfdba2016-08-07 21:37:45 -0700226 deps = [
227 ":apprtc_common",
228 ":socketrocket",
229 ]
230 public_deps = [
231 "../sdk:rtc_sdk_peerconnection_objc",
232 ]
233 libs = [ "QuartzCore.framework" ]
234 }
235
236 if (is_ios) {
denicija77bfd7c2016-11-15 00:41:26 -0800237 rtc_static_library("AppRTCMobile_lib") {
tkchin2ddfdba2016-08-07 21:37:45 -0700238 sources = [
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200239 "objc/AppRTCMobile/ios/ARDAppDelegate.m",
240 "objc/AppRTCMobile/ios/ARDMainView.h",
241 "objc/AppRTCMobile/ios/ARDMainView.m",
242 "objc/AppRTCMobile/ios/ARDMainViewController.h",
243 "objc/AppRTCMobile/ios/ARDMainViewController.m",
denicija2256e042016-11-09 06:26:18 -0800244 "objc/AppRTCMobile/ios/ARDSettingsModel+Private.h",
245 "objc/AppRTCMobile/ios/ARDSettingsModel.h",
246 "objc/AppRTCMobile/ios/ARDSettingsModel.m",
247 "objc/AppRTCMobile/ios/ARDSettingsStore.h",
248 "objc/AppRTCMobile/ios/ARDSettingsStore.m",
denicijad17d5362016-11-02 02:56:09 -0700249 "objc/AppRTCMobile/ios/ARDSettingsViewController.h",
250 "objc/AppRTCMobile/ios/ARDSettingsViewController.m",
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200251 "objc/AppRTCMobile/ios/ARDStatsView.h",
252 "objc/AppRTCMobile/ios/ARDStatsView.m",
253 "objc/AppRTCMobile/ios/ARDVideoCallView.h",
254 "objc/AppRTCMobile/ios/ARDVideoCallView.m",
255 "objc/AppRTCMobile/ios/ARDVideoCallViewController.h",
256 "objc/AppRTCMobile/ios/ARDVideoCallViewController.m",
257 "objc/AppRTCMobile/ios/AppRTCMobile-Prefix.pch",
258 "objc/AppRTCMobile/ios/UIImage+ARDUtilities.h",
259 "objc/AppRTCMobile/ios/UIImage+ARDUtilities.m",
denicija77bfd7c2016-11-15 00:41:26 -0800260 ]
261 configs += [
262 "//build/config/compiler:enable_arc",
263 ":warnings_config",
264 ]
265
266 deps = [
267 ":apprtc_common",
268 ":apprtc_signaling",
269 ]
270 }
271
272 ios_app_bundle("AppRTCMobile") {
273 sources = [
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200274 "objc/AppRTCMobile/ios/main.m",
tkchin2ddfdba2016-08-07 21:37:45 -0700275 ]
276
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200277 info_plist = "objc/AppRTCMobile/ios/Info.plist"
tkchin2ddfdba2016-08-07 21:37:45 -0700278
denicija77bfd7c2016-11-15 00:41:26 -0800279 configs += [ "..:common_config" ]
tkchin2ddfdba2016-08-07 21:37:45 -0700280 public_configs = [ "..:common_inherited_config" ]
281
282 deps = [
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200283 ":AppRTCMobile_ios_bundle_data",
denicija77bfd7c2016-11-15 00:41:26 -0800284 ":AppRTCMobile_lib",
tkchin2ddfdba2016-08-07 21:37:45 -0700285 ]
286
287 if (target_cpu == "x86") {
288 deps += [ "//testing/iossim:iossim" ]
289 }
290 }
291
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200292 bundle_data("AppRTCMobile_ios_bundle_data") {
tkchin2ddfdba2016-08-07 21:37:45 -0700293 sources = [
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200294 "objc/AppRTCMobile/ios/resources/Roboto-Regular.ttf",
295 "objc/AppRTCMobile/ios/resources/iPhone5@2x.png",
296 "objc/AppRTCMobile/ios/resources/iPhone6@2x.png",
297 "objc/AppRTCMobile/ios/resources/iPhone6p@3x.png",
298 "objc/AppRTCMobile/ios/resources/ic_call_end_black_24dp.png",
299 "objc/AppRTCMobile/ios/resources/ic_call_end_black_24dp@2x.png",
300 "objc/AppRTCMobile/ios/resources/ic_clear_black_24dp.png",
301 "objc/AppRTCMobile/ios/resources/ic_clear_black_24dp@2x.png",
denicija6d6762c2016-10-28 04:53:16 -0700302 "objc/AppRTCMobile/ios/resources/ic_settings_black_24dp.png",
303 "objc/AppRTCMobile/ios/resources/ic_settings_black_24dp@2x.png",
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200304 "objc/AppRTCMobile/ios/resources/ic_surround_sound_black_24dp.png",
305 "objc/AppRTCMobile/ios/resources/ic_surround_sound_black_24dp@2x.png",
306 "objc/AppRTCMobile/ios/resources/ic_switch_video_black_24dp.png",
307 "objc/AppRTCMobile/ios/resources/ic_switch_video_black_24dp@2x.png",
308 "objc/AppRTCMobile/ios/resources/mozart.mp3",
tkchin2ddfdba2016-08-07 21:37:45 -0700309 "objc/Icon.png",
310 ]
311 outputs = [
312 "{{bundle_resources_dir}}/{{source_file_part}}",
313 ]
314 }
315 }
316
317 if (is_mac) {
denicija77bfd7c2016-11-15 00:41:26 -0800318 rtc_static_library("AppRTCMobile_lib") {
tkchin2ddfdba2016-08-07 21:37:45 -0700319 sources = [
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200320 "objc/AppRTCMobile/mac/APPRTCAppDelegate.h",
321 "objc/AppRTCMobile/mac/APPRTCAppDelegate.m",
322 "objc/AppRTCMobile/mac/APPRTCViewController.h",
323 "objc/AppRTCMobile/mac/APPRTCViewController.m",
tkchin2ddfdba2016-08-07 21:37:45 -0700324 ]
325 configs += [
tkchin2ddfdba2016-08-07 21:37:45 -0700326 "..:common_objc",
327 "//build/config/compiler:enable_arc",
328 ]
329 deps = [
330 ":apprtc_common",
331 ":apprtc_signaling",
332 ]
333 }
334
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200335 mac_app_bundle("AppRTCMobile") {
336 output_name = "AppRTCMobile"
tkchin2ddfdba2016-08-07 21:37:45 -0700337
338 extra_substitutions = [ "MACOSX_DEPLOYMENT_TARGET=10.8" ]
339
340 sources = [
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200341 "objc/AppRTCMobile/mac/main.m",
tkchin2ddfdba2016-08-07 21:37:45 -0700342 ]
343
344 public_configs = [ "..:common_inherited_config" ]
345
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200346 info_plist = "objc/AppRTCMobile/mac/Info.plist"
tkchin2ddfdba2016-08-07 21:37:45 -0700347
348 libs = [ "AppKit.framework" ]
349
350 deps = [
denicija77bfd7c2016-11-15 00:41:26 -0800351 ":AppRTCMobile_lib",
tkchin2ddfdba2016-08-07 21:37:45 -0700352 ]
353 }
354 }
355
356 config("socketrocket_include_config") {
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200357 include_dirs = [ "objc/AppRTCMobile/third_party/SocketRocket" ]
tkchin2ddfdba2016-08-07 21:37:45 -0700358 }
359
360 config("socketrocket_warning_config") {
361 # GN orders flags on a target before flags from configs. The default config
362 # adds these flags so to cancel them out they need to come from a config and
363 # cannot be on the target directly.
364 cflags = [
365 "-Wno-deprecated-declarations",
366 "-Wno-nonnull",
tkchin2ddfdba2016-08-07 21:37:45 -0700367 "-Wno-semicolon-before-method-body",
368 "-Wno-unused-variable",
369 ]
370
henrika27d8b612016-09-21 04:13:00 -0700371 cflags_objc = [
372 # Enabled for cflags_objc in build/config/compiler/BUILD.gn.
373 "-Wno-objc-missing-property-synthesis",
374
375 # Hide the warning for SecRandomCopyBytes(), until we update to upstream.
376 # https://bugs.chromium.org/p/webrtc/issues/detail?id=6396
377 "-Wno-unused-result",
378 ]
tkchin2ddfdba2016-08-07 21:37:45 -0700379
380 if (is_mac) {
381 cflags += [ "-Wno-partial-availability" ]
382 }
383 }
384
kjellanderb62dbbe2016-09-23 00:38:52 -0700385 rtc_static_library("socketrocket") {
tkchin2ddfdba2016-08-07 21:37:45 -0700386 sources = [
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200387 "objc/AppRTCMobile/third_party/SocketRocket/SRWebSocket.h",
388 "objc/AppRTCMobile/third_party/SocketRocket/SRWebSocket.m",
tkchin2ddfdba2016-08-07 21:37:45 -0700389 ]
390 configs += [
tkchin2ddfdba2016-08-07 21:37:45 -0700391 "//build/config/compiler:enable_arc",
392 ":socketrocket_warning_config",
393 ]
ehmaldonadoe9cc6862016-09-05 06:10:18 -0700394 public_configs = [ ":socketrocket_include_config" ]
tkchin2ddfdba2016-08-07 21:37:45 -0700395
396 libs = [
397 "CFNetwork.framework",
398 "icucore",
399 ]
400 }
adam.fedorbcc5d872016-11-07 14:53:28 -0800401
402 if (rtc_include_tests) {
403 config("rtc_apprtcmobile_config") {
404 defines = [ "GTEST_RELATIVE_PATH" ]
405 }
406
407 rtc_test("apprtcmobile_tests") {
denicija77bfd7c2016-11-15 00:41:26 -0800408 include_dirs = [ "objc/AppRTCMobile/ios" ]
adam.fedorbcc5d872016-11-07 14:53:28 -0800409 deps = [
denicija77bfd7c2016-11-15 00:41:26 -0800410 ":AppRTCMobile_lib",
adam.fedorbcc5d872016-11-07 14:53:28 -0800411 ":apprtc_signaling",
412 "//testing/gtest",
413 "//third_party/ocmock",
414 ]
415
416 sources = [
417 "objc/AppRTCMobile/tests/ARDAppClientTest.mm",
denicija77bfd7c2016-11-15 00:41:26 -0800418 "objc/AppRTCMobile/tests/ARDSettingsModelTests.mm",
adam.fedorbcc5d872016-11-07 14:53:28 -0800419 ]
420
421 if (is_ios) {
422 info_plist = "objc/AppRTCMobile/ios/Info.plist"
423 }
424
425 configs += [
426 ":rtc_apprtcmobile_config",
427 "//build/config/compiler:enable_arc",
428 ]
429 }
430 }
tkchin2ddfdba2016-08-07 21:37:45 -0700431}
kthelgason0727f152016-08-08 09:03:23 -0700432
433if (is_linux || is_win) {
434 if (is_linux) {
435 pkg_config("gtk2_config") {
436 # Gtk requires gmodule, but it does not list it as a dependency in some
437 # misconfigured systems.
438 packages = [
439 "gmodule-2.0",
440 "gtk+-2.0",
441 "gthread-2.0",
442 ]
443 }
444 }
445
ehmaldonadod02fe4b2016-08-26 13:31:24 -0700446 config("peerconnection_client_warnings_config") {
kjellander4a9abad2016-09-18 08:12:29 -0700447 cflags = []
ehmaldonadod02fe4b2016-08-26 13:31:24 -0700448 if (is_win && is_clang) {
kjellander4a9abad2016-09-18 08:12:29 -0700449 cflags += [
ehmaldonadod02fe4b2016-08-26 13:31:24 -0700450 # Disable warnings failing when compiling with Clang on Windows.
451 # https://bugs.chromium.org/p/webrtc/issues/detail?id=5366
452 "-Wno-format",
453
454 # See https://bugs.chromium.org/p/webrtc/issues/detail?id=6271
455 # for -Wno-reorder and -Wno-sign-compare
456 "-Wno-reorder",
457 "-Wno-sign-compare",
458 ]
459 }
kjellanderd4626e52016-09-07 02:33:01 -0700460 if (is_linux && target_cpu == "x86") {
kjellander4a9abad2016-09-18 08:12:29 -0700461 cflags += [
kjellanderd4626e52016-09-07 02:33:01 -0700462 # Needed to compile on Linux 32-bit.
463 "-Wno-sentinel",
464 ]
465 }
kjellander4a9abad2016-09-18 08:12:29 -0700466
467 if (is_clang) {
468 # TODO(ehmaldonado): Make peerconnection_client compile with the standard
469 # set of warnings.
470 # See https://bugs.chromium.org/p/webrtc/issues/detail?id=6306
471 cflags += [ "-Wno-inconsistent-missing-override" ]
472 }
ehmaldonadod02fe4b2016-08-26 13:31:24 -0700473 }
474
ehmaldonado38a21322016-09-02 04:10:34 -0700475 rtc_executable("peerconnection_client") {
kthelgason0727f152016-08-08 09:03:23 -0700476 sources = [
477 "peerconnection/client/conductor.cc",
478 "peerconnection/client/conductor.h",
479 "peerconnection/client/defaults.cc",
480 "peerconnection/client/defaults.h",
481 "peerconnection/client/peer_connection_client.cc",
482 "peerconnection/client/peer_connection_client.h",
483 ]
ehmaldonado7a2ce0b2016-09-05 01:35:44 -0700484
kjellandere40a7ee2016-10-16 23:56:12 -0700485 if (!build_with_chromium && is_clang) {
486 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
ehmaldonado38a21322016-09-02 04:10:34 -0700487 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
kthelgason0727f152016-08-08 09:03:23 -0700488 }
489 if (is_win) {
490 sources += [
491 "peerconnection/client/flagdefs.h",
492 "peerconnection/client/main.cc",
493 "peerconnection/client/main_wnd.cc",
494 "peerconnection/client/main_wnd.h",
495 ]
496 cflags = [ "/wd4245" ]
497 configs += [ "//build/config/win:windowed" ]
498 }
499 if (is_linux) {
500 sources += [
501 "peerconnection/client/linux/main.cc",
502 "peerconnection/client/linux/main_wnd.cc",
503 "peerconnection/client/linux/main_wnd.h",
504 ]
505 libs = [
506 "X11",
507 "Xcomposite",
508 "Xext",
509 "Xrender",
510 ]
511 public_configs = [ ":gtk2_config" ]
512 }
513 deps = [
nisse9f8e37b2016-09-01 01:06:23 -0700514 "//third_party/libyuv",
kthelgason0727f152016-08-08 09:03:23 -0700515 "//webrtc/api:libjingle_peerconnection",
516 "//webrtc/system_wrappers:field_trial_default",
517 "//webrtc/system_wrappers:metrics_default",
518 ]
ehmaldonadod02fe4b2016-08-26 13:31:24 -0700519 configs += [ ":peerconnection_client_warnings_config" ]
kthelgason0727f152016-08-08 09:03:23 -0700520 if (rtc_build_json) {
521 deps += [ "//third_party/jsoncpp" ]
522 }
523 }
kjellanderd4626e52016-09-07 02:33:01 -0700524
ehmaldonado38a21322016-09-02 04:10:34 -0700525 rtc_executable("peerconnection_server") {
kthelgason0727f152016-08-08 09:03:23 -0700526 sources = [
527 "peerconnection/server/data_socket.cc",
528 "peerconnection/server/data_socket.h",
529 "peerconnection/server/main.cc",
530 "peerconnection/server/peer_channel.cc",
531 "peerconnection/server/peer_channel.h",
532 "peerconnection/server/utils.cc",
533 "peerconnection/server/utils.h",
534 ]
535 deps = [
536 "//webrtc:webrtc_common",
537 "//webrtc/base:rtc_base_approved",
538 "//webrtc/tools:command_line_parser",
539 ]
kjellandere40a7ee2016-10-16 23:56:12 -0700540 if (!build_with_chromium && is_clang) {
541 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
ehmaldonado38a21322016-09-02 04:10:34 -0700542 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
kthelgason0727f152016-08-08 09:03:23 -0700543 }
544 }
ehmaldonado38a21322016-09-02 04:10:34 -0700545 rtc_executable("relayserver") {
kthelgason0727f152016-08-08 09:03:23 -0700546 sources = [
547 "relayserver/relayserver_main.cc",
548 ]
549 deps = [
550 "//webrtc/base:rtc_base_approved",
551 "//webrtc/pc:rtc_pc",
552 "//webrtc/system_wrappers:field_trial_default",
553 "//webrtc/system_wrappers:metrics_default",
554 ]
kjellandere40a7ee2016-10-16 23:56:12 -0700555 if (!build_with_chromium && is_clang) {
556 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
ehmaldonado38a21322016-09-02 04:10:34 -0700557 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
kthelgason0727f152016-08-08 09:03:23 -0700558 }
559 }
ehmaldonado38a21322016-09-02 04:10:34 -0700560 rtc_executable("turnserver") {
kthelgason0727f152016-08-08 09:03:23 -0700561 sources = [
562 "turnserver/turnserver_main.cc",
563 ]
564 deps = [
565 "//webrtc/base:rtc_base_approved",
566 "//webrtc/pc:rtc_pc",
567 "//webrtc/system_wrappers:field_trial_default",
568 "//webrtc/system_wrappers:metrics_default",
569 ]
kjellandere40a7ee2016-10-16 23:56:12 -0700570 if (!build_with_chromium && is_clang) {
571 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
ehmaldonado38a21322016-09-02 04:10:34 -0700572 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
kthelgason0727f152016-08-08 09:03:23 -0700573 }
574 }
ehmaldonado38a21322016-09-02 04:10:34 -0700575 rtc_executable("stunserver") {
kthelgason0727f152016-08-08 09:03:23 -0700576 sources = [
577 "stunserver/stunserver_main.cc",
578 ]
579 deps = [
580 "//webrtc/base:rtc_base_approved",
581 "//webrtc/pc:rtc_pc",
582 "//webrtc/system_wrappers:field_trial_default",
583 "//webrtc/system_wrappers:metrics_default",
584 ]
kjellandere40a7ee2016-10-16 23:56:12 -0700585 if (!build_with_chromium && is_clang) {
586 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
ehmaldonado38a21322016-09-02 04:10:34 -0700587 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
kthelgason0727f152016-08-08 09:03:23 -0700588 }
589 }
590}
charujainaca3a242016-11-01 03:09:15 -0700591
592if (!build_with_chromium) {
593 # Doesn't build within Chrome on Win.
594 rtc_executable("stun_prober") {
595 sources = [
596 "stunprober/main.cc",
597 ]
598
599 if (!build_with_chromium && is_clang) {
600 # Suppress warnings from Chrome's Clang plugins.
601 # See http://code.google.com/p/webrtc/issues/detail?id=163 for details.
602 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
603 }
604
605 deps = [
606 "../p2p:libstunprober",
607 "../p2p:rtc_p2p",
608 "../system_wrappers:field_trial_default",
609 ]
610 }
611}