blob: 74d340fa1e7855309c4ce7bd59d0d75d7d9fff92 [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
mbonadei9aa3f0a2017-01-24 06:58:22 -08009import("../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") {
kjellander1993b1d2017-03-06 00:29:21 -080053 testonly = true
Magnus Jedvertc1815cf2016-09-27 10:10:41 +020054 apk_name = "AppRTCMobile"
Sami Kalliomaki9c0c75b2016-06-29 14:55:00 +020055 android_manifest = "androidapp/AndroidManifest.xml"
56
57 deps = [
Magnus Jedvertc1815cf2016-09-27 10:10:41 +020058 ":AppRTCMobile_javalib",
59 ":AppRTCMobile_resources",
Sami Kalliomaki9c0c75b2016-06-29 14:55:00 +020060 "//base:base_java",
61 "//webrtc/base:base_java",
62 ]
63
magjed768c6482016-12-06 04:29:37 -080064 shared_libraries = [ "//webrtc/sdk/android:libjingle_peerconnection_so" ]
Sami Kalliomaki9c0c75b2016-06-29 14:55:00 +020065 }
66
Magnus Jedvertc1815cf2016-09-27 10:10:41 +020067 android_library("AppRTCMobile_javalib") {
kjellander1993b1d2017-03-06 00:29:21 -080068 testonly = true
sakal07a050f2017-02-13 05:58:27 -080069 android_manifest = "androidapp/AndroidManifest.xml"
70
Sami Kalliomaki9c0c75b2016-06-29 14:55:00 +020071 java_files = [
72 "androidapp/src/org/appspot/apprtc/AppRTCAudioManager.java",
henrikac3c2f312016-12-14 07:36:56 -080073 "androidapp/src/org/appspot/apprtc/AppRTCBluetoothManager.java",
Sami Kalliomaki9c0c75b2016-06-29 14:55:00 +020074 "androidapp/src/org/appspot/apprtc/AppRTCClient.java",
75 "androidapp/src/org/appspot/apprtc/AppRTCProximitySensor.java",
76 "androidapp/src/org/appspot/apprtc/CallActivity.java",
77 "androidapp/src/org/appspot/apprtc/CallFragment.java",
78 "androidapp/src/org/appspot/apprtc/CaptureQualityController.java",
79 "androidapp/src/org/appspot/apprtc/ConnectActivity.java",
80 "androidapp/src/org/appspot/apprtc/CpuMonitor.java",
81 "androidapp/src/org/appspot/apprtc/DirectRTCClient.java",
82 "androidapp/src/org/appspot/apprtc/HudFragment.java",
83 "androidapp/src/org/appspot/apprtc/PeerConnectionClient.java",
Sami Kalliomaki9c0c75b2016-06-29 14:55:00 +020084 "androidapp/src/org/appspot/apprtc/RoomParametersFetcher.java",
85 "androidapp/src/org/appspot/apprtc/SettingsActivity.java",
86 "androidapp/src/org/appspot/apprtc/SettingsFragment.java",
87 "androidapp/src/org/appspot/apprtc/TCPChannelClient.java",
88 "androidapp/src/org/appspot/apprtc/UnhandledExceptionHandler.java",
89 "androidapp/src/org/appspot/apprtc/WebSocketChannelClient.java",
90 "androidapp/src/org/appspot/apprtc/WebSocketRTCClient.java",
91 "androidapp/src/org/appspot/apprtc/util/AppRTCUtils.java",
92 "androidapp/src/org/appspot/apprtc/util/AsyncHttpURLConnection.java",
Sami Kalliomaki9c0c75b2016-06-29 14:55:00 +020093 ]
94
95 deps = [
Magnus Jedvertc1815cf2016-09-27 10:10:41 +020096 ":AppRTCMobile_resources",
Sami Kalliomaki9c0c75b2016-06-29 14:55:00 +020097 "//webrtc/base:base_java",
98 "//webrtc/examples/androidapp/third_party/autobanh:autobanh_java",
mbonadeib55bd972017-01-23 01:25:53 -080099 "//webrtc/modules/audio_device:audio_device_java",
magjed768c6482016-12-06 04:29:37 -0800100 "//webrtc/sdk/android:libjingle_peerconnection_java",
101 "//webrtc/sdk/android:libjingle_peerconnection_metrics_default_java",
Sami Kalliomaki9c0c75b2016-06-29 14:55:00 +0200102 ]
103 }
104
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200105 android_resources("AppRTCMobile_resources") {
kjellander1993b1d2017-03-06 00:29:21 -0800106 testonly = true
Sami Kalliomaki9c0c75b2016-06-29 14:55:00 +0200107 resource_dirs = [ "androidapp/res" ]
108 custom_package = "org.appspot.apprtc"
109 }
110
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200111 instrumentation_test_apk("AppRTCMobileTest") {
112 apk_name = "AppRTCMobileTest"
Sami Kalliomaki9c0c75b2016-06-29 14:55:00 +0200113 android_manifest = "androidtests/AndroidManifest.xml"
114
sakale8aca242017-01-17 03:32:06 -0800115 java_files = [ "androidtests/src/org/appspot/apprtc/test/PeerConnectionClientTest.java" ]
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",
sakalcb79d512017-01-11 06:21:26 -0800121 "//base:base_java_test_support",
122 "//third_party/android_support_test_runner:runner_java",
123 "//third_party/junit",
magjed768c6482016-12-06 04:29:37 -0800124 "//webrtc/sdk/android:libjingle_peerconnection_java",
Sami Kalliomaki9c0c75b2016-06-29 14:55:00 +0200125 ]
126 }
mandermoa6069e82017-01-16 02:23:09 -0800127
128 instrumentation_test_apk("AppRTCMobileTestStubbedVideoIO") {
129 apk_name = "AppRTCMobileTestStubbedVideoIO"
130 android_manifest = "androidtests/AndroidManifest.xml"
131
132 java_files = [ "androidtests/src/org/appspot/apprtc/test/ConnectActivityStubbedInputOutputTest.java" ]
133
134 apk_under_test = ":AppRTCMobile"
135
136 deps = [
137 ":AppRTCMobile_javalib",
138 "//third_party/android_support_test_runner:rules_java",
139 "//third_party/android_support_test_runner:runner_java",
140 "//third_party/espresso:espresso_all_java",
141 "//third_party/hamcrest:hamcrest_java",
142 "//third_party/junit",
143 "//webrtc/sdk/android:libjingle_peerconnection_java",
144 ]
145
146 data = [
147 "//resources/reference_video_640x360_30fps.y4m",
148 ]
149 }
Sami Kalliomaki9c0c75b2016-06-29 14:55:00 +0200150}
tkchin2ddfdba2016-08-07 21:37:45 -0700151
152if (is_ios || (is_mac && target_cpu != "x86")) {
153 config("warnings_config") {
154 # GN orders flags on a target before flags from configs. The default config
155 # adds these flags so to cancel them out they need to come from a config and
156 # cannot be on the target directly.
157 if (is_ios) {
158 # Suppress compiler warnings about deprecated that triggered
159 # when moving from ios_deployment_target 7.0 to 9.0.
160 # See webrtc:5549 for more details.
161 cflags = [ "-Wno-deprecated-declarations" ]
Henrik Kjellander91a57592016-10-12 20:25:34 -0700162 cflags_objc = [
163 # Enabled for cflags_objc in build/config/compiler/BUILD.gn.
164 # See webrtc:6520.
165 "-Wno-objc-missing-property-synthesis",
166 ]
tkchin2ddfdba2016-08-07 21:37:45 -0700167 }
168 }
169
170 config("apprtc_common_config") {
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200171 include_dirs = [ "objc/AppRTCMobile/common" ]
tkchin2ddfdba2016-08-07 21:37:45 -0700172 }
173
kjellanderb62dbbe2016-09-23 00:38:52 -0700174 rtc_static_library("apprtc_common") {
kjellander1993b1d2017-03-06 00:29:21 -0800175 testonly = true
tkchin2ddfdba2016-08-07 21:37:45 -0700176 sources = [
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200177 "objc/AppRTCMobile/common/ARDUtilities.h",
178 "objc/AppRTCMobile/common/ARDUtilities.m",
tkchin2ddfdba2016-08-07 21:37:45 -0700179 ]
180 configs += [
tkchin2ddfdba2016-08-07 21:37:45 -0700181 ":warnings_config",
182 "//build/config/compiler:enable_arc",
183 ]
ehmaldonadoe9cc6862016-09-05 06:10:18 -0700184 public_configs = [ ":apprtc_common_config" ]
tkchin2ddfdba2016-08-07 21:37:45 -0700185
186 deps = [
kjellander1993b1d2017-03-06 00:29:21 -0800187 "//webrtc/sdk:rtc_sdk_common_objc",
188 "//webrtc/system_wrappers:field_trial_default",
189 "//webrtc/system_wrappers:metrics_default",
tkchin2ddfdba2016-08-07 21:37:45 -0700190 ]
191 }
192
193 config("apprtc_signaling_config") {
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200194 include_dirs = [ "objc/AppRTCMobile" ]
tkchin2ddfdba2016-08-07 21:37:45 -0700195
196 # GN orders flags on a target before flags from configs. The default config
197 # adds these flags so to cancel them out they need to come from a config and
198 # cannot be on the target directly.
199 cflags = [
200 "-Wno-sign-compare",
201 "-Wno-unused-variable",
202 ]
tkchin2ddfdba2016-08-07 21:37:45 -0700203 }
204
kjellanderb62dbbe2016-09-23 00:38:52 -0700205 rtc_static_library("apprtc_signaling") {
kjellander1993b1d2017-03-06 00:29:21 -0800206 testonly = true
tkchin2ddfdba2016-08-07 21:37:45 -0700207 sources = [
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200208 "objc/AppRTCMobile/ARDAppClient+Internal.h",
209 "objc/AppRTCMobile/ARDAppClient.h",
210 "objc/AppRTCMobile/ARDAppClient.m",
211 "objc/AppRTCMobile/ARDAppEngineClient.h",
212 "objc/AppRTCMobile/ARDAppEngineClient.m",
213 "objc/AppRTCMobile/ARDBitrateTracker.h",
214 "objc/AppRTCMobile/ARDBitrateTracker.m",
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200215 "objc/AppRTCMobile/ARDJoinResponse+Internal.h",
216 "objc/AppRTCMobile/ARDJoinResponse.h",
217 "objc/AppRTCMobile/ARDJoinResponse.m",
218 "objc/AppRTCMobile/ARDMessageResponse+Internal.h",
219 "objc/AppRTCMobile/ARDMessageResponse.h",
220 "objc/AppRTCMobile/ARDMessageResponse.m",
221 "objc/AppRTCMobile/ARDRoomServerClient.h",
222 "objc/AppRTCMobile/ARDSDPUtils.h",
223 "objc/AppRTCMobile/ARDSDPUtils.m",
224 "objc/AppRTCMobile/ARDSignalingChannel.h",
225 "objc/AppRTCMobile/ARDSignalingMessage.h",
226 "objc/AppRTCMobile/ARDSignalingMessage.m",
227 "objc/AppRTCMobile/ARDStatsBuilder.h",
228 "objc/AppRTCMobile/ARDStatsBuilder.m",
kthelgasoncc882af2017-01-13 05:59:46 -0800229 "objc/AppRTCMobile/ARDTURNClient+Internal.h",
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200230 "objc/AppRTCMobile/ARDTURNClient.h",
kthelgasoncc882af2017-01-13 05:59:46 -0800231 "objc/AppRTCMobile/ARDTURNClient.m",
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200232 "objc/AppRTCMobile/ARDWebSocketChannel.h",
233 "objc/AppRTCMobile/ARDWebSocketChannel.m",
234 "objc/AppRTCMobile/RTCIceCandidate+JSON.h",
235 "objc/AppRTCMobile/RTCIceCandidate+JSON.m",
236 "objc/AppRTCMobile/RTCIceServer+JSON.h",
237 "objc/AppRTCMobile/RTCIceServer+JSON.m",
238 "objc/AppRTCMobile/RTCMediaConstraints+JSON.h",
239 "objc/AppRTCMobile/RTCMediaConstraints+JSON.m",
240 "objc/AppRTCMobile/RTCSessionDescription+JSON.h",
241 "objc/AppRTCMobile/RTCSessionDescription+JSON.m",
tkchin2ddfdba2016-08-07 21:37:45 -0700242 ]
243 configs += [
tkchin2ddfdba2016-08-07 21:37:45 -0700244 "//build/config/compiler:enable_arc",
245 ":warnings_config",
246 ]
ehmaldonadoe9cc6862016-09-05 06:10:18 -0700247 public_configs = [ ":apprtc_signaling_config" ]
tkchin2ddfdba2016-08-07 21:37:45 -0700248 deps = [
249 ":apprtc_common",
250 ":socketrocket",
251 ]
252 public_deps = [
kjellander1993b1d2017-03-06 00:29:21 -0800253 "//webrtc/sdk:rtc_sdk_peerconnection_objc",
tkchin2ddfdba2016-08-07 21:37:45 -0700254 ]
255 libs = [ "QuartzCore.framework" ]
256 }
257
258 if (is_ios) {
denicija77bfd7c2016-11-15 00:41:26 -0800259 rtc_static_library("AppRTCMobile_lib") {
kjellander1993b1d2017-03-06 00:29:21 -0800260 testonly = true
tkchin2ddfdba2016-08-07 21:37:45 -0700261 sources = [
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200262 "objc/AppRTCMobile/ios/ARDAppDelegate.m",
263 "objc/AppRTCMobile/ios/ARDMainView.h",
264 "objc/AppRTCMobile/ios/ARDMainView.m",
265 "objc/AppRTCMobile/ios/ARDMainViewController.h",
266 "objc/AppRTCMobile/ios/ARDMainViewController.m",
denicija2256e042016-11-09 06:26:18 -0800267 "objc/AppRTCMobile/ios/ARDSettingsModel+Private.h",
268 "objc/AppRTCMobile/ios/ARDSettingsModel.h",
269 "objc/AppRTCMobile/ios/ARDSettingsModel.m",
270 "objc/AppRTCMobile/ios/ARDSettingsStore.h",
271 "objc/AppRTCMobile/ios/ARDSettingsStore.m",
denicijad17d5362016-11-02 02:56:09 -0700272 "objc/AppRTCMobile/ios/ARDSettingsViewController.h",
273 "objc/AppRTCMobile/ios/ARDSettingsViewController.m",
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200274 "objc/AppRTCMobile/ios/ARDStatsView.h",
275 "objc/AppRTCMobile/ios/ARDStatsView.m",
276 "objc/AppRTCMobile/ios/ARDVideoCallView.h",
277 "objc/AppRTCMobile/ios/ARDVideoCallView.m",
278 "objc/AppRTCMobile/ios/ARDVideoCallViewController.h",
279 "objc/AppRTCMobile/ios/ARDVideoCallViewController.m",
280 "objc/AppRTCMobile/ios/AppRTCMobile-Prefix.pch",
281 "objc/AppRTCMobile/ios/UIImage+ARDUtilities.h",
282 "objc/AppRTCMobile/ios/UIImage+ARDUtilities.m",
denicija77bfd7c2016-11-15 00:41:26 -0800283 ]
284 configs += [
285 "//build/config/compiler:enable_arc",
286 ":warnings_config",
287 ]
288
289 deps = [
290 ":apprtc_common",
291 ":apprtc_signaling",
kjellander1993b1d2017-03-06 00:29:21 -0800292 "//webrtc/modules/audio_device",
denicija77bfd7c2016-11-15 00:41:26 -0800293 ]
294 }
295
296 ios_app_bundle("AppRTCMobile") {
kjellander1993b1d2017-03-06 00:29:21 -0800297 testonly = true
denicija77bfd7c2016-11-15 00:41:26 -0800298 sources = [
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200299 "objc/AppRTCMobile/ios/main.m",
tkchin2ddfdba2016-08-07 21:37:45 -0700300 ]
301
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200302 info_plist = "objc/AppRTCMobile/ios/Info.plist"
tkchin2ddfdba2016-08-07 21:37:45 -0700303
denicija77bfd7c2016-11-15 00:41:26 -0800304 configs += [ "..:common_config" ]
tkchin2ddfdba2016-08-07 21:37:45 -0700305 public_configs = [ "..:common_inherited_config" ]
306
307 deps = [
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200308 ":AppRTCMobile_ios_bundle_data",
kthelgasond3adbfb2017-01-26 01:14:04 -0800309 ":AppRTCMobile_ios_frameworks",
denicija77bfd7c2016-11-15 00:41:26 -0800310 ":AppRTCMobile_lib",
tkchin2ddfdba2016-08-07 21:37:45 -0700311 ]
312
313 if (target_cpu == "x86") {
314 deps += [ "//testing/iossim:iossim" ]
315 }
316 }
317
kthelgasond3adbfb2017-01-26 01:14:04 -0800318 bundle_data("AppRTCMobile_ios_frameworks") {
319 public_deps = [
320 "//webrtc/sdk:rtc_sdk_framework_objc+link",
321 ]
322 sources = [
323 "$root_out_dir/WebRTC.framework",
324 ]
325 outputs = [
326 "{{bundle_resources_dir}}/Frameworks/{{source_file_part}}",
327 ]
328 }
329
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200330 bundle_data("AppRTCMobile_ios_bundle_data") {
tkchin2ddfdba2016-08-07 21:37:45 -0700331 sources = [
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200332 "objc/AppRTCMobile/ios/resources/Roboto-Regular.ttf",
333 "objc/AppRTCMobile/ios/resources/iPhone5@2x.png",
334 "objc/AppRTCMobile/ios/resources/iPhone6@2x.png",
335 "objc/AppRTCMobile/ios/resources/iPhone6p@3x.png",
336 "objc/AppRTCMobile/ios/resources/ic_call_end_black_24dp.png",
337 "objc/AppRTCMobile/ios/resources/ic_call_end_black_24dp@2x.png",
338 "objc/AppRTCMobile/ios/resources/ic_clear_black_24dp.png",
339 "objc/AppRTCMobile/ios/resources/ic_clear_black_24dp@2x.png",
denicija6d6762c2016-10-28 04:53:16 -0700340 "objc/AppRTCMobile/ios/resources/ic_settings_black_24dp.png",
341 "objc/AppRTCMobile/ios/resources/ic_settings_black_24dp@2x.png",
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200342 "objc/AppRTCMobile/ios/resources/ic_surround_sound_black_24dp.png",
343 "objc/AppRTCMobile/ios/resources/ic_surround_sound_black_24dp@2x.png",
344 "objc/AppRTCMobile/ios/resources/ic_switch_video_black_24dp.png",
345 "objc/AppRTCMobile/ios/resources/ic_switch_video_black_24dp@2x.png",
346 "objc/AppRTCMobile/ios/resources/mozart.mp3",
tkchin2ddfdba2016-08-07 21:37:45 -0700347 "objc/Icon.png",
348 ]
349 outputs = [
350 "{{bundle_resources_dir}}/{{source_file_part}}",
351 ]
352 }
353 }
354
355 if (is_mac) {
denicija77bfd7c2016-11-15 00:41:26 -0800356 rtc_static_library("AppRTCMobile_lib") {
kjellander1993b1d2017-03-06 00:29:21 -0800357 testonly = true
tkchin2ddfdba2016-08-07 21:37:45 -0700358 sources = [
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200359 "objc/AppRTCMobile/mac/APPRTCAppDelegate.h",
360 "objc/AppRTCMobile/mac/APPRTCAppDelegate.m",
361 "objc/AppRTCMobile/mac/APPRTCViewController.h",
362 "objc/AppRTCMobile/mac/APPRTCViewController.m",
tkchin2ddfdba2016-08-07 21:37:45 -0700363 ]
364 configs += [
kjellander1993b1d2017-03-06 00:29:21 -0800365 "//webrtc:common_objc",
tkchin2ddfdba2016-08-07 21:37:45 -0700366 "//build/config/compiler:enable_arc",
367 ]
368 deps = [
369 ":apprtc_common",
370 ":apprtc_signaling",
371 ]
372 }
373
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200374 mac_app_bundle("AppRTCMobile") {
kjellander1993b1d2017-03-06 00:29:21 -0800375 testonly = true
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200376 output_name = "AppRTCMobile"
tkchin2ddfdba2016-08-07 21:37:45 -0700377
tkchin2ddfdba2016-08-07 21:37:45 -0700378 sources = [
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200379 "objc/AppRTCMobile/mac/main.m",
tkchin2ddfdba2016-08-07 21:37:45 -0700380 ]
381
382 public_configs = [ "..:common_inherited_config" ]
383
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200384 info_plist = "objc/AppRTCMobile/mac/Info.plist"
tkchin2ddfdba2016-08-07 21:37:45 -0700385
386 libs = [ "AppKit.framework" ]
387
388 deps = [
denicija77bfd7c2016-11-15 00:41:26 -0800389 ":AppRTCMobile_lib",
tkchin2ddfdba2016-08-07 21:37:45 -0700390 ]
391 }
392 }
393
394 config("socketrocket_include_config") {
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200395 include_dirs = [ "objc/AppRTCMobile/third_party/SocketRocket" ]
tkchin2ddfdba2016-08-07 21:37:45 -0700396 }
397
398 config("socketrocket_warning_config") {
399 # GN orders flags on a target before flags from configs. The default config
400 # adds these flags so to cancel them out they need to come from a config and
401 # cannot be on the target directly.
402 cflags = [
403 "-Wno-deprecated-declarations",
404 "-Wno-nonnull",
tkchin2ddfdba2016-08-07 21:37:45 -0700405 "-Wno-semicolon-before-method-body",
kthelgasone47de1a2017-02-24 01:56:01 -0800406 "-Wno-unused-variable",
tkchin2ddfdba2016-08-07 21:37:45 -0700407 ]
408
henrika27d8b612016-09-21 04:13:00 -0700409 cflags_objc = [
410 # Enabled for cflags_objc in build/config/compiler/BUILD.gn.
411 "-Wno-objc-missing-property-synthesis",
henrika27d8b612016-09-21 04:13:00 -0700412 ]
tkchin2ddfdba2016-08-07 21:37:45 -0700413 }
414
kjellanderb62dbbe2016-09-23 00:38:52 -0700415 rtc_static_library("socketrocket") {
kjellander1993b1d2017-03-06 00:29:21 -0800416 testonly = true
tkchin2ddfdba2016-08-07 21:37:45 -0700417 sources = [
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200418 "objc/AppRTCMobile/third_party/SocketRocket/SRWebSocket.h",
419 "objc/AppRTCMobile/third_party/SocketRocket/SRWebSocket.m",
tkchin2ddfdba2016-08-07 21:37:45 -0700420 ]
421 configs += [
tkchin2ddfdba2016-08-07 21:37:45 -0700422 "//build/config/compiler:enable_arc",
423 ":socketrocket_warning_config",
424 ]
ehmaldonadoe9cc6862016-09-05 06:10:18 -0700425 public_configs = [ ":socketrocket_include_config" ]
tkchin2ddfdba2016-08-07 21:37:45 -0700426
427 libs = [
428 "CFNetwork.framework",
429 "icucore",
430 ]
431 }
adam.fedorbcc5d872016-11-07 14:53:28 -0800432
433 if (rtc_include_tests) {
kthelgason4065a572017-02-14 04:58:56 -0800434 # TODO(kthelgason): compile xctests on mac when chromium supports it.
435 if (is_ios) {
436 rtc_source_set("apprtcmobile_test_sources") {
kjellander1993b1d2017-03-06 00:29:21 -0800437 testonly = true
kthelgason4065a572017-02-14 04:58:56 -0800438 include_dirs = [
439 "objc/AppRTCMobile",
440 "objc/AppRTCMobile/ios",
441 ]
442 testonly = true
443 sources = [
444 "objc/AppRTCMobile/tests/ARDAppClient_xctest.mm",
445 "objc/AppRTCMobile/tests/ARDSDPUtils_xctest.mm",
446 "objc/AppRTCMobile/tests/ARDSettingsModel_xctest.mm",
447 ]
kjellander1993b1d2017-03-06 00:29:21 -0800448 deps = [
449 "//webrtc/base:rtc_base",
450 ]
kthelgason4065a572017-02-14 04:58:56 -0800451 public_deps = [
452 ":AppRTCMobile_ios_frameworks",
453 ":AppRTCMobile_lib",
454 "//build/config/ios:xctest",
455 "//third_party/ocmock",
456 ]
457 configs += [ "//build/config/compiler:enable_arc" ]
adam.fedorbcc5d872016-11-07 14:53:28 -0800458 }
459
kthelgason4065a572017-02-14 04:58:56 -0800460 rtc_ios_xctest_test("apprtcmobile_tests") {
461 info_plist = "objc/AppRTCMobile/ios/Info.plist"
462 sources = [
463 "objc/AppRTCMobile/ios/main.m",
464 ]
465 deps = [
466 ":apprtcmobile_test_sources",
467 ]
468 ldflags = [ "-all_load" ]
469 }
adam.fedorbcc5d872016-11-07 14:53:28 -0800470 }
471 }
tkchin2ddfdba2016-08-07 21:37:45 -0700472}
kthelgason0727f152016-08-08 09:03:23 -0700473
474if (is_linux || is_win) {
ehmaldonadod02fe4b2016-08-26 13:31:24 -0700475 config("peerconnection_client_warnings_config") {
kjellander4a9abad2016-09-18 08:12:29 -0700476 cflags = []
ehmaldonadod02fe4b2016-08-26 13:31:24 -0700477 if (is_win && is_clang) {
kjellander4a9abad2016-09-18 08:12:29 -0700478 cflags += [
ehmaldonadod02fe4b2016-08-26 13:31:24 -0700479 # Disable warnings failing when compiling with Clang on Windows.
480 # https://bugs.chromium.org/p/webrtc/issues/detail?id=5366
481 "-Wno-format",
482
483 # See https://bugs.chromium.org/p/webrtc/issues/detail?id=6271
484 # for -Wno-reorder and -Wno-sign-compare
485 "-Wno-reorder",
486 "-Wno-sign-compare",
487 ]
488 }
kjellanderd4626e52016-09-07 02:33:01 -0700489 if (is_linux && target_cpu == "x86") {
kjellander4a9abad2016-09-18 08:12:29 -0700490 cflags += [
kjellanderd4626e52016-09-07 02:33:01 -0700491 # Needed to compile on Linux 32-bit.
492 "-Wno-sentinel",
493 ]
494 }
kjellander4a9abad2016-09-18 08:12:29 -0700495
496 if (is_clang) {
497 # TODO(ehmaldonado): Make peerconnection_client compile with the standard
498 # set of warnings.
499 # See https://bugs.chromium.org/p/webrtc/issues/detail?id=6306
500 cflags += [ "-Wno-inconsistent-missing-override" ]
501 }
ehmaldonadod02fe4b2016-08-26 13:31:24 -0700502 }
503
ehmaldonado38a21322016-09-02 04:10:34 -0700504 rtc_executable("peerconnection_client") {
kjellander1993b1d2017-03-06 00:29:21 -0800505 testonly = true
kthelgason0727f152016-08-08 09:03:23 -0700506 sources = [
507 "peerconnection/client/conductor.cc",
508 "peerconnection/client/conductor.h",
509 "peerconnection/client/defaults.cc",
510 "peerconnection/client/defaults.h",
511 "peerconnection/client/peer_connection_client.cc",
512 "peerconnection/client/peer_connection_client.h",
513 ]
ehmaldonado7a2ce0b2016-09-05 01:35:44 -0700514
kjellandere40a7ee2016-10-16 23:56:12 -0700515 if (!build_with_chromium && is_clang) {
516 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
ehmaldonado38a21322016-09-02 04:10:34 -0700517 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
kthelgason0727f152016-08-08 09:03:23 -0700518 }
kjellander1993b1d2017-03-06 00:29:21 -0800519 deps = []
kthelgason0727f152016-08-08 09:03:23 -0700520 if (is_win) {
521 sources += [
522 "peerconnection/client/flagdefs.h",
523 "peerconnection/client/main.cc",
524 "peerconnection/client/main_wnd.cc",
525 "peerconnection/client/main_wnd.h",
526 ]
527 cflags = [ "/wd4245" ]
528 configs += [ "//build/config/win:windowed" ]
kjellander1993b1d2017-03-06 00:29:21 -0800529 deps += [ "//webrtc/media:rtc_media_base" ]
kthelgason0727f152016-08-08 09:03:23 -0700530 }
531 if (is_linux) {
532 sources += [
533 "peerconnection/client/linux/main.cc",
534 "peerconnection/client/linux/main_wnd.cc",
535 "peerconnection/client/linux/main_wnd.h",
536 ]
537 libs = [
538 "X11",
539 "Xcomposite",
540 "Xext",
541 "Xrender",
542 ]
thomasandersonef16e992016-12-13 02:57:43 -0800543 deps += [ "//build/config/linux/gtk" ]
kthelgason0727f152016-08-08 09:03:23 -0700544 }
ehmaldonadod02fe4b2016-08-26 13:31:24 -0700545 configs += [ ":peerconnection_client_warnings_config" ]
kjellander1993b1d2017-03-06 00:29:21 -0800546
547 deps += [
548 "//third_party/libyuv",
549 "//webrtc/api:libjingle_peerconnection_test_api",
550 "//webrtc/api:video_frame_api",
551 "//webrtc/base:rtc_base",
552 "//webrtc/base:rtc_base_approved",
553 "//webrtc/media:rtc_media",
554 "//webrtc/modules/video_capture:video_capture_module",
555 "//webrtc/pc:libjingle_peerconnection",
556 "//webrtc/system_wrappers:field_trial_default",
557 "//webrtc/system_wrappers:metrics_default",
558 ]
kthelgason0727f152016-08-08 09:03:23 -0700559 if (rtc_build_json) {
560 deps += [ "//third_party/jsoncpp" ]
561 }
562 }
kjellanderd4626e52016-09-07 02:33:01 -0700563
ehmaldonado38a21322016-09-02 04:10:34 -0700564 rtc_executable("peerconnection_server") {
kjellander1993b1d2017-03-06 00:29:21 -0800565 testonly = true
kthelgason0727f152016-08-08 09:03:23 -0700566 sources = [
567 "peerconnection/server/data_socket.cc",
568 "peerconnection/server/data_socket.h",
569 "peerconnection/server/main.cc",
570 "peerconnection/server/peer_channel.cc",
571 "peerconnection/server/peer_channel.h",
572 "peerconnection/server/utils.cc",
573 "peerconnection/server/utils.h",
574 ]
575 deps = [
576 "//webrtc:webrtc_common",
577 "//webrtc/base:rtc_base_approved",
578 "//webrtc/tools:command_line_parser",
579 ]
kjellandere40a7ee2016-10-16 23:56:12 -0700580 if (!build_with_chromium && is_clang) {
581 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
ehmaldonado38a21322016-09-02 04:10:34 -0700582 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
kthelgason0727f152016-08-08 09:03:23 -0700583 }
584 }
ehmaldonado38a21322016-09-02 04:10:34 -0700585 rtc_executable("relayserver") {
kjellander1993b1d2017-03-06 00:29:21 -0800586 testonly = true
kthelgason0727f152016-08-08 09:03:23 -0700587 sources = [
588 "relayserver/relayserver_main.cc",
589 ]
590 deps = [
kjellander1993b1d2017-03-06 00:29:21 -0800591 "../base:rtc_base",
kthelgason0727f152016-08-08 09:03:23 -0700592 "//webrtc/base:rtc_base_approved",
kjellander1993b1d2017-03-06 00:29:21 -0800593 "//webrtc/p2p:rtc_p2p",
kthelgason0727f152016-08-08 09:03:23 -0700594 "//webrtc/pc:rtc_pc",
595 "//webrtc/system_wrappers:field_trial_default",
596 "//webrtc/system_wrappers:metrics_default",
597 ]
kjellandere40a7ee2016-10-16 23:56:12 -0700598 if (!build_with_chromium && is_clang) {
599 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
ehmaldonado38a21322016-09-02 04:10:34 -0700600 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
kthelgason0727f152016-08-08 09:03:23 -0700601 }
602 }
ehmaldonado38a21322016-09-02 04:10:34 -0700603 rtc_executable("turnserver") {
kjellander1993b1d2017-03-06 00:29:21 -0800604 testonly = true
kthelgason0727f152016-08-08 09:03:23 -0700605 sources = [
606 "turnserver/turnserver_main.cc",
607 ]
608 deps = [
kjellander1993b1d2017-03-06 00:29:21 -0800609 "../base:rtc_base",
kthelgason0727f152016-08-08 09:03:23 -0700610 "//webrtc/base:rtc_base_approved",
kjellander1993b1d2017-03-06 00:29:21 -0800611 "//webrtc/p2p:rtc_p2p",
kthelgason0727f152016-08-08 09:03:23 -0700612 "//webrtc/pc:rtc_pc",
613 "//webrtc/system_wrappers:field_trial_default",
614 "//webrtc/system_wrappers:metrics_default",
615 ]
kjellandere40a7ee2016-10-16 23:56:12 -0700616 if (!build_with_chromium && is_clang) {
617 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
ehmaldonado38a21322016-09-02 04:10:34 -0700618 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
kthelgason0727f152016-08-08 09:03:23 -0700619 }
620 }
ehmaldonado38a21322016-09-02 04:10:34 -0700621 rtc_executable("stunserver") {
kjellander1993b1d2017-03-06 00:29:21 -0800622 testonly = true
kthelgason0727f152016-08-08 09:03:23 -0700623 sources = [
624 "stunserver/stunserver_main.cc",
625 ]
626 deps = [
kjellander1993b1d2017-03-06 00:29:21 -0800627 "../base:rtc_base",
kthelgason0727f152016-08-08 09:03:23 -0700628 "//webrtc/base:rtc_base_approved",
kjellander1993b1d2017-03-06 00:29:21 -0800629 "//webrtc/p2p:rtc_p2p",
kthelgason0727f152016-08-08 09:03:23 -0700630 "//webrtc/pc:rtc_pc",
631 "//webrtc/system_wrappers:field_trial_default",
632 "//webrtc/system_wrappers:metrics_default",
633 ]
kjellandere40a7ee2016-10-16 23:56:12 -0700634 if (!build_with_chromium && is_clang) {
635 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
ehmaldonado38a21322016-09-02 04:10:34 -0700636 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
kthelgason0727f152016-08-08 09:03:23 -0700637 }
638 }
639}
charujainaca3a242016-11-01 03:09:15 -0700640
641if (!build_with_chromium) {
642 # Doesn't build within Chrome on Win.
643 rtc_executable("stun_prober") {
kjellander1993b1d2017-03-06 00:29:21 -0800644 testonly = true
charujainaca3a242016-11-01 03:09:15 -0700645 sources = [
646 "stunprober/main.cc",
647 ]
648
649 if (!build_with_chromium && is_clang) {
650 # Suppress warnings from Chrome's Clang plugins.
651 # See http://code.google.com/p/webrtc/issues/detail?id=163 for details.
652 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
653 }
654
655 deps = [
kjellander1993b1d2017-03-06 00:29:21 -0800656 "../base:rtc_base",
657 "../base:rtc_base_approved",
charujainaca3a242016-11-01 03:09:15 -0700658 "../p2p:libstunprober",
659 "../p2p:rtc_p2p",
660 "../system_wrappers:field_trial_default",
661 ]
662 }
663}