blob: 10deaf27c42294e40868a989c5af43bd0638c5c7 [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")) {
tkchin2ddfdba2016-08-07 21:37:45 -0700153 config("apprtc_common_config") {
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200154 include_dirs = [ "objc/AppRTCMobile/common" ]
tkchin2ddfdba2016-08-07 21:37:45 -0700155 }
156
kjellanderb62dbbe2016-09-23 00:38:52 -0700157 rtc_static_library("apprtc_common") {
kjellander1993b1d2017-03-06 00:29:21 -0800158 testonly = true
tkchin2ddfdba2016-08-07 21:37:45 -0700159 sources = [
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200160 "objc/AppRTCMobile/common/ARDUtilities.h",
161 "objc/AppRTCMobile/common/ARDUtilities.m",
tkchin2ddfdba2016-08-07 21:37:45 -0700162 ]
kthelgasonb13237b2017-03-30 04:56:05 -0700163 configs += [ "//build/config/compiler:enable_arc" ]
ehmaldonadoe9cc6862016-09-05 06:10:18 -0700164 public_configs = [ ":apprtc_common_config" ]
tkchin2ddfdba2016-08-07 21:37:45 -0700165
166 deps = [
kjellander1993b1d2017-03-06 00:29:21 -0800167 "//webrtc/sdk:rtc_sdk_common_objc",
168 "//webrtc/system_wrappers:field_trial_default",
169 "//webrtc/system_wrappers:metrics_default",
tkchin2ddfdba2016-08-07 21:37:45 -0700170 ]
171 }
172
173 config("apprtc_signaling_config") {
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200174 include_dirs = [ "objc/AppRTCMobile" ]
tkchin2ddfdba2016-08-07 21:37:45 -0700175
176 # GN orders flags on a target before flags from configs. The default config
177 # adds these flags so to cancel them out they need to come from a config and
178 # cannot be on the target directly.
179 cflags = [
180 "-Wno-sign-compare",
181 "-Wno-unused-variable",
182 ]
tkchin2ddfdba2016-08-07 21:37:45 -0700183 }
184
kjellanderb62dbbe2016-09-23 00:38:52 -0700185 rtc_static_library("apprtc_signaling") {
kjellander1993b1d2017-03-06 00:29:21 -0800186 testonly = true
tkchin2ddfdba2016-08-07 21:37:45 -0700187 sources = [
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200188 "objc/AppRTCMobile/ARDAppClient+Internal.h",
189 "objc/AppRTCMobile/ARDAppClient.h",
190 "objc/AppRTCMobile/ARDAppClient.m",
191 "objc/AppRTCMobile/ARDAppEngineClient.h",
192 "objc/AppRTCMobile/ARDAppEngineClient.m",
193 "objc/AppRTCMobile/ARDBitrateTracker.h",
194 "objc/AppRTCMobile/ARDBitrateTracker.m",
sakalc522e752017-04-05 12:17:48 -0700195 "objc/AppRTCMobile/ARDCaptureController.h",
196 "objc/AppRTCMobile/ARDCaptureController.m",
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200197 "objc/AppRTCMobile/ARDJoinResponse+Internal.h",
198 "objc/AppRTCMobile/ARDJoinResponse.h",
199 "objc/AppRTCMobile/ARDJoinResponse.m",
200 "objc/AppRTCMobile/ARDMessageResponse+Internal.h",
201 "objc/AppRTCMobile/ARDMessageResponse.h",
202 "objc/AppRTCMobile/ARDMessageResponse.m",
203 "objc/AppRTCMobile/ARDRoomServerClient.h",
204 "objc/AppRTCMobile/ARDSDPUtils.h",
205 "objc/AppRTCMobile/ARDSDPUtils.m",
sakalc4adacf2017-03-28 01:22:48 -0700206 "objc/AppRTCMobile/ARDSettingsModel+Private.h",
207 "objc/AppRTCMobile/ARDSettingsModel.h",
208 "objc/AppRTCMobile/ARDSettingsModel.m",
209 "objc/AppRTCMobile/ARDSettingsStore.h",
210 "objc/AppRTCMobile/ARDSettingsStore.m",
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200211 "objc/AppRTCMobile/ARDSignalingChannel.h",
212 "objc/AppRTCMobile/ARDSignalingMessage.h",
213 "objc/AppRTCMobile/ARDSignalingMessage.m",
214 "objc/AppRTCMobile/ARDStatsBuilder.h",
215 "objc/AppRTCMobile/ARDStatsBuilder.m",
kthelgasoncc882af2017-01-13 05:59:46 -0800216 "objc/AppRTCMobile/ARDTURNClient+Internal.h",
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200217 "objc/AppRTCMobile/ARDTURNClient.h",
kthelgasoncc882af2017-01-13 05:59:46 -0800218 "objc/AppRTCMobile/ARDTURNClient.m",
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200219 "objc/AppRTCMobile/ARDWebSocketChannel.h",
220 "objc/AppRTCMobile/ARDWebSocketChannel.m",
221 "objc/AppRTCMobile/RTCIceCandidate+JSON.h",
222 "objc/AppRTCMobile/RTCIceCandidate+JSON.m",
223 "objc/AppRTCMobile/RTCIceServer+JSON.h",
224 "objc/AppRTCMobile/RTCIceServer+JSON.m",
225 "objc/AppRTCMobile/RTCMediaConstraints+JSON.h",
226 "objc/AppRTCMobile/RTCMediaConstraints+JSON.m",
227 "objc/AppRTCMobile/RTCSessionDescription+JSON.h",
228 "objc/AppRTCMobile/RTCSessionDescription+JSON.m",
tkchin2ddfdba2016-08-07 21:37:45 -0700229 ]
kthelgasonb13237b2017-03-30 04:56:05 -0700230 configs += [ "//build/config/compiler:enable_arc" ]
ehmaldonadoe9cc6862016-09-05 06:10:18 -0700231 public_configs = [ ":apprtc_signaling_config" ]
tkchin2ddfdba2016-08-07 21:37:45 -0700232 deps = [
233 ":apprtc_common",
234 ":socketrocket",
235 ]
236 public_deps = [
kjellander1993b1d2017-03-06 00:29:21 -0800237 "//webrtc/sdk:rtc_sdk_peerconnection_objc",
tkchin2ddfdba2016-08-07 21:37:45 -0700238 ]
239 libs = [ "QuartzCore.framework" ]
240 }
241
242 if (is_ios) {
denicija77bfd7c2016-11-15 00:41:26 -0800243 rtc_static_library("AppRTCMobile_lib") {
kjellander1993b1d2017-03-06 00:29:21 -0800244 testonly = true
tkchin2ddfdba2016-08-07 21:37:45 -0700245 sources = [
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200246 "objc/AppRTCMobile/ios/ARDAppDelegate.m",
247 "objc/AppRTCMobile/ios/ARDMainView.h",
248 "objc/AppRTCMobile/ios/ARDMainView.m",
249 "objc/AppRTCMobile/ios/ARDMainViewController.h",
250 "objc/AppRTCMobile/ios/ARDMainViewController.m",
denicijad17d5362016-11-02 02:56:09 -0700251 "objc/AppRTCMobile/ios/ARDSettingsViewController.h",
252 "objc/AppRTCMobile/ios/ARDSettingsViewController.m",
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200253 "objc/AppRTCMobile/ios/ARDStatsView.h",
254 "objc/AppRTCMobile/ios/ARDStatsView.m",
255 "objc/AppRTCMobile/ios/ARDVideoCallView.h",
256 "objc/AppRTCMobile/ios/ARDVideoCallView.m",
257 "objc/AppRTCMobile/ios/ARDVideoCallViewController.h",
258 "objc/AppRTCMobile/ios/ARDVideoCallViewController.m",
259 "objc/AppRTCMobile/ios/AppRTCMobile-Prefix.pch",
260 "objc/AppRTCMobile/ios/UIImage+ARDUtilities.h",
261 "objc/AppRTCMobile/ios/UIImage+ARDUtilities.m",
denicija77bfd7c2016-11-15 00:41:26 -0800262 ]
kthelgasonb13237b2017-03-30 04:56:05 -0700263 configs += [ "//build/config/compiler:enable_arc" ]
denicija77bfd7c2016-11-15 00:41:26 -0800264
265 deps = [
266 ":apprtc_common",
267 ":apprtc_signaling",
kjellander1993b1d2017-03-06 00:29:21 -0800268 "//webrtc/modules/audio_device",
denicija77bfd7c2016-11-15 00:41:26 -0800269 ]
270 }
271
272 ios_app_bundle("AppRTCMobile") {
kjellander1993b1d2017-03-06 00:29:21 -0800273 testonly = true
denicija77bfd7c2016-11-15 00:41:26 -0800274 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",
kthelgasond3adbfb2017-01-26 01:14:04 -0800285 ":AppRTCMobile_ios_frameworks",
denicija77bfd7c2016-11-15 00:41:26 -0800286 ":AppRTCMobile_lib",
tkchin2ddfdba2016-08-07 21:37:45 -0700287 ]
288
289 if (target_cpu == "x86") {
290 deps += [ "//testing/iossim:iossim" ]
291 }
292 }
293
kthelgasond3adbfb2017-01-26 01:14:04 -0800294 bundle_data("AppRTCMobile_ios_frameworks") {
295 public_deps = [
296 "//webrtc/sdk:rtc_sdk_framework_objc+link",
297 ]
298 sources = [
299 "$root_out_dir/WebRTC.framework",
300 ]
301 outputs = [
302 "{{bundle_resources_dir}}/Frameworks/{{source_file_part}}",
303 ]
304 }
305
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200306 bundle_data("AppRTCMobile_ios_bundle_data") {
tkchin2ddfdba2016-08-07 21:37:45 -0700307 sources = [
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200308 "objc/AppRTCMobile/ios/resources/Roboto-Regular.ttf",
309 "objc/AppRTCMobile/ios/resources/iPhone5@2x.png",
310 "objc/AppRTCMobile/ios/resources/iPhone6@2x.png",
311 "objc/AppRTCMobile/ios/resources/iPhone6p@3x.png",
312 "objc/AppRTCMobile/ios/resources/ic_call_end_black_24dp.png",
313 "objc/AppRTCMobile/ios/resources/ic_call_end_black_24dp@2x.png",
314 "objc/AppRTCMobile/ios/resources/ic_clear_black_24dp.png",
315 "objc/AppRTCMobile/ios/resources/ic_clear_black_24dp@2x.png",
denicija6d6762c2016-10-28 04:53:16 -0700316 "objc/AppRTCMobile/ios/resources/ic_settings_black_24dp.png",
317 "objc/AppRTCMobile/ios/resources/ic_settings_black_24dp@2x.png",
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200318 "objc/AppRTCMobile/ios/resources/ic_surround_sound_black_24dp.png",
319 "objc/AppRTCMobile/ios/resources/ic_surround_sound_black_24dp@2x.png",
320 "objc/AppRTCMobile/ios/resources/ic_switch_video_black_24dp.png",
321 "objc/AppRTCMobile/ios/resources/ic_switch_video_black_24dp@2x.png",
322 "objc/AppRTCMobile/ios/resources/mozart.mp3",
tkchin2ddfdba2016-08-07 21:37:45 -0700323 "objc/Icon.png",
324 ]
325 outputs = [
326 "{{bundle_resources_dir}}/{{source_file_part}}",
327 ]
328 }
329 }
330
331 if (is_mac) {
denicija77bfd7c2016-11-15 00:41:26 -0800332 rtc_static_library("AppRTCMobile_lib") {
kjellander1993b1d2017-03-06 00:29:21 -0800333 testonly = true
tkchin2ddfdba2016-08-07 21:37:45 -0700334 sources = [
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200335 "objc/AppRTCMobile/mac/APPRTCAppDelegate.h",
336 "objc/AppRTCMobile/mac/APPRTCAppDelegate.m",
337 "objc/AppRTCMobile/mac/APPRTCViewController.h",
338 "objc/AppRTCMobile/mac/APPRTCViewController.m",
tkchin2ddfdba2016-08-07 21:37:45 -0700339 ]
340 configs += [
kjellander1993b1d2017-03-06 00:29:21 -0800341 "//webrtc:common_objc",
tkchin2ddfdba2016-08-07 21:37:45 -0700342 "//build/config/compiler:enable_arc",
343 ]
344 deps = [
345 ":apprtc_common",
346 ":apprtc_signaling",
347 ]
348 }
349
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200350 mac_app_bundle("AppRTCMobile") {
kjellander1993b1d2017-03-06 00:29:21 -0800351 testonly = true
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200352 output_name = "AppRTCMobile"
tkchin2ddfdba2016-08-07 21:37:45 -0700353
tkchin2ddfdba2016-08-07 21:37:45 -0700354 sources = [
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200355 "objc/AppRTCMobile/mac/main.m",
tkchin2ddfdba2016-08-07 21:37:45 -0700356 ]
357
358 public_configs = [ "..:common_inherited_config" ]
359
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200360 info_plist = "objc/AppRTCMobile/mac/Info.plist"
tkchin2ddfdba2016-08-07 21:37:45 -0700361
362 libs = [ "AppKit.framework" ]
363
364 deps = [
denicija77bfd7c2016-11-15 00:41:26 -0800365 ":AppRTCMobile_lib",
tkchin2ddfdba2016-08-07 21:37:45 -0700366 ]
367 }
368 }
369
370 config("socketrocket_include_config") {
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200371 include_dirs = [ "objc/AppRTCMobile/third_party/SocketRocket" ]
tkchin2ddfdba2016-08-07 21:37:45 -0700372 }
373
374 config("socketrocket_warning_config") {
375 # GN orders flags on a target before flags from configs. The default config
376 # adds these flags so to cancel them out they need to come from a config and
377 # cannot be on the target directly.
378 cflags = [
379 "-Wno-deprecated-declarations",
380 "-Wno-nonnull",
tkchin2ddfdba2016-08-07 21:37:45 -0700381 "-Wno-semicolon-before-method-body",
kthelgasone47de1a2017-02-24 01:56:01 -0800382 "-Wno-unused-variable",
tkchin2ddfdba2016-08-07 21:37:45 -0700383 ]
384
henrika27d8b612016-09-21 04:13:00 -0700385 cflags_objc = [
386 # Enabled for cflags_objc in build/config/compiler/BUILD.gn.
387 "-Wno-objc-missing-property-synthesis",
henrika27d8b612016-09-21 04:13:00 -0700388 ]
tkchin2ddfdba2016-08-07 21:37:45 -0700389 }
390
kjellanderb62dbbe2016-09-23 00:38:52 -0700391 rtc_static_library("socketrocket") {
kjellander1993b1d2017-03-06 00:29:21 -0800392 testonly = true
tkchin2ddfdba2016-08-07 21:37:45 -0700393 sources = [
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200394 "objc/AppRTCMobile/third_party/SocketRocket/SRWebSocket.h",
395 "objc/AppRTCMobile/third_party/SocketRocket/SRWebSocket.m",
tkchin2ddfdba2016-08-07 21:37:45 -0700396 ]
397 configs += [
tkchin2ddfdba2016-08-07 21:37:45 -0700398 "//build/config/compiler:enable_arc",
399 ":socketrocket_warning_config",
400 ]
ehmaldonadoe9cc6862016-09-05 06:10:18 -0700401 public_configs = [ ":socketrocket_include_config" ]
tkchin2ddfdba2016-08-07 21:37:45 -0700402
403 libs = [
404 "CFNetwork.framework",
405 "icucore",
406 ]
407 }
adam.fedorbcc5d872016-11-07 14:53:28 -0800408
409 if (rtc_include_tests) {
kthelgason4065a572017-02-14 04:58:56 -0800410 # TODO(kthelgason): compile xctests on mac when chromium supports it.
411 if (is_ios) {
412 rtc_source_set("apprtcmobile_test_sources") {
kjellander1993b1d2017-03-06 00:29:21 -0800413 testonly = true
kthelgason4065a572017-02-14 04:58:56 -0800414 include_dirs = [
415 "objc/AppRTCMobile",
416 "objc/AppRTCMobile/ios",
417 ]
418 testonly = true
419 sources = [
420 "objc/AppRTCMobile/tests/ARDAppClient_xctest.mm",
421 "objc/AppRTCMobile/tests/ARDSDPUtils_xctest.mm",
422 "objc/AppRTCMobile/tests/ARDSettingsModel_xctest.mm",
423 ]
kjellander1993b1d2017-03-06 00:29:21 -0800424 deps = [
425 "//webrtc/base:rtc_base",
426 ]
kthelgason4065a572017-02-14 04:58:56 -0800427 public_deps = [
428 ":AppRTCMobile_ios_frameworks",
429 ":AppRTCMobile_lib",
430 "//build/config/ios:xctest",
431 "//third_party/ocmock",
432 ]
433 configs += [ "//build/config/compiler:enable_arc" ]
adam.fedorbcc5d872016-11-07 14:53:28 -0800434 }
435
kthelgason4065a572017-02-14 04:58:56 -0800436 rtc_ios_xctest_test("apprtcmobile_tests") {
437 info_plist = "objc/AppRTCMobile/ios/Info.plist"
438 sources = [
439 "objc/AppRTCMobile/ios/main.m",
440 ]
441 deps = [
442 ":apprtcmobile_test_sources",
443 ]
444 ldflags = [ "-all_load" ]
445 }
adam.fedorbcc5d872016-11-07 14:53:28 -0800446 }
447 }
tkchin2ddfdba2016-08-07 21:37:45 -0700448}
kthelgason0727f152016-08-08 09:03:23 -0700449
450if (is_linux || is_win) {
ehmaldonadod02fe4b2016-08-26 13:31:24 -0700451 config("peerconnection_client_warnings_config") {
kjellander4a9abad2016-09-18 08:12:29 -0700452 cflags = []
ehmaldonadod02fe4b2016-08-26 13:31:24 -0700453 if (is_win && is_clang) {
kjellander4a9abad2016-09-18 08:12:29 -0700454 cflags += [
ehmaldonadod02fe4b2016-08-26 13:31:24 -0700455 # Disable warnings failing when compiling with Clang on Windows.
456 # https://bugs.chromium.org/p/webrtc/issues/detail?id=5366
457 "-Wno-format",
458
459 # See https://bugs.chromium.org/p/webrtc/issues/detail?id=6271
460 # for -Wno-reorder and -Wno-sign-compare
461 "-Wno-reorder",
462 "-Wno-sign-compare",
463 ]
464 }
kjellanderd4626e52016-09-07 02:33:01 -0700465 if (is_linux && target_cpu == "x86") {
kjellander4a9abad2016-09-18 08:12:29 -0700466 cflags += [
kjellanderd4626e52016-09-07 02:33:01 -0700467 # Needed to compile on Linux 32-bit.
468 "-Wno-sentinel",
469 ]
470 }
kjellander4a9abad2016-09-18 08:12:29 -0700471
472 if (is_clang) {
473 # TODO(ehmaldonado): Make peerconnection_client compile with the standard
474 # set of warnings.
475 # See https://bugs.chromium.org/p/webrtc/issues/detail?id=6306
476 cflags += [ "-Wno-inconsistent-missing-override" ]
477 }
ehmaldonadod02fe4b2016-08-26 13:31:24 -0700478 }
479
ehmaldonado38a21322016-09-02 04:10:34 -0700480 rtc_executable("peerconnection_client") {
kjellander1993b1d2017-03-06 00:29:21 -0800481 testonly = true
kthelgason0727f152016-08-08 09:03:23 -0700482 sources = [
483 "peerconnection/client/conductor.cc",
484 "peerconnection/client/conductor.h",
485 "peerconnection/client/defaults.cc",
486 "peerconnection/client/defaults.h",
487 "peerconnection/client/peer_connection_client.cc",
488 "peerconnection/client/peer_connection_client.h",
489 ]
ehmaldonado7a2ce0b2016-09-05 01:35:44 -0700490
kjellandere40a7ee2016-10-16 23:56:12 -0700491 if (!build_with_chromium && is_clang) {
492 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
ehmaldonado38a21322016-09-02 04:10:34 -0700493 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
kthelgason0727f152016-08-08 09:03:23 -0700494 }
kjellander1993b1d2017-03-06 00:29:21 -0800495 deps = []
kthelgason0727f152016-08-08 09:03:23 -0700496 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" ]
kjellander1993b1d2017-03-06 00:29:21 -0800505 deps += [ "//webrtc/media:rtc_media_base" ]
kthelgason0727f152016-08-08 09:03:23 -0700506 }
507 if (is_linux) {
508 sources += [
509 "peerconnection/client/linux/main.cc",
510 "peerconnection/client/linux/main_wnd.cc",
511 "peerconnection/client/linux/main_wnd.h",
512 ]
Henrik Kjellanderefbde2c2017-03-27 08:28:27 +0200513 cflags = [ "-Wno-deprecated-declarations" ]
kthelgason0727f152016-08-08 09:03:23 -0700514 libs = [
515 "X11",
516 "Xcomposite",
517 "Xext",
518 "Xrender",
519 ]
thomasandersonef16e992016-12-13 02:57:43 -0800520 deps += [ "//build/config/linux/gtk" ]
kthelgason0727f152016-08-08 09:03:23 -0700521 }
ehmaldonadod02fe4b2016-08-26 13:31:24 -0700522 configs += [ ":peerconnection_client_warnings_config" ]
kjellander1993b1d2017-03-06 00:29:21 -0800523
524 deps += [
525 "//third_party/libyuv",
526 "//webrtc/api:libjingle_peerconnection_test_api",
527 "//webrtc/api:video_frame_api",
528 "//webrtc/base:rtc_base",
529 "//webrtc/base:rtc_base_approved",
530 "//webrtc/media:rtc_media",
531 "//webrtc/modules/video_capture:video_capture_module",
532 "//webrtc/pc:libjingle_peerconnection",
533 "//webrtc/system_wrappers:field_trial_default",
534 "//webrtc/system_wrappers:metrics_default",
535 ]
kthelgason0727f152016-08-08 09:03:23 -0700536 if (rtc_build_json) {
537 deps += [ "//third_party/jsoncpp" ]
538 }
539 }
kjellanderd4626e52016-09-07 02:33:01 -0700540
ehmaldonado38a21322016-09-02 04:10:34 -0700541 rtc_executable("peerconnection_server") {
kjellander1993b1d2017-03-06 00:29:21 -0800542 testonly = true
kthelgason0727f152016-08-08 09:03:23 -0700543 sources = [
544 "peerconnection/server/data_socket.cc",
545 "peerconnection/server/data_socket.h",
546 "peerconnection/server/main.cc",
547 "peerconnection/server/peer_channel.cc",
548 "peerconnection/server/peer_channel.h",
549 "peerconnection/server/utils.cc",
550 "peerconnection/server/utils.h",
551 ]
552 deps = [
553 "//webrtc:webrtc_common",
554 "//webrtc/base:rtc_base_approved",
555 "//webrtc/tools:command_line_parser",
556 ]
kjellandere40a7ee2016-10-16 23:56:12 -0700557 if (!build_with_chromium && is_clang) {
558 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
ehmaldonado38a21322016-09-02 04:10:34 -0700559 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
kthelgason0727f152016-08-08 09:03:23 -0700560 }
561 }
ehmaldonado38a21322016-09-02 04:10:34 -0700562 rtc_executable("relayserver") {
kjellander1993b1d2017-03-06 00:29:21 -0800563 testonly = true
kthelgason0727f152016-08-08 09:03:23 -0700564 sources = [
565 "relayserver/relayserver_main.cc",
566 ]
567 deps = [
kjellander1993b1d2017-03-06 00:29:21 -0800568 "../base:rtc_base",
kthelgason0727f152016-08-08 09:03:23 -0700569 "//webrtc/base:rtc_base_approved",
kjellander1993b1d2017-03-06 00:29:21 -0800570 "//webrtc/p2p:rtc_p2p",
kthelgason0727f152016-08-08 09:03:23 -0700571 "//webrtc/pc:rtc_pc",
572 "//webrtc/system_wrappers:field_trial_default",
573 "//webrtc/system_wrappers:metrics_default",
574 ]
kjellandere40a7ee2016-10-16 23:56:12 -0700575 if (!build_with_chromium && is_clang) {
576 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
ehmaldonado38a21322016-09-02 04:10:34 -0700577 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
kthelgason0727f152016-08-08 09:03:23 -0700578 }
579 }
ehmaldonado38a21322016-09-02 04:10:34 -0700580 rtc_executable("turnserver") {
kjellander1993b1d2017-03-06 00:29:21 -0800581 testonly = true
kthelgason0727f152016-08-08 09:03:23 -0700582 sources = [
583 "turnserver/turnserver_main.cc",
584 ]
585 deps = [
kjellander1993b1d2017-03-06 00:29:21 -0800586 "../base:rtc_base",
kthelgason0727f152016-08-08 09:03:23 -0700587 "//webrtc/base:rtc_base_approved",
kjellander1993b1d2017-03-06 00:29:21 -0800588 "//webrtc/p2p:rtc_p2p",
kthelgason0727f152016-08-08 09:03:23 -0700589 "//webrtc/pc:rtc_pc",
590 "//webrtc/system_wrappers:field_trial_default",
591 "//webrtc/system_wrappers:metrics_default",
592 ]
kjellandere40a7ee2016-10-16 23:56:12 -0700593 if (!build_with_chromium && is_clang) {
594 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
ehmaldonado38a21322016-09-02 04:10:34 -0700595 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
kthelgason0727f152016-08-08 09:03:23 -0700596 }
597 }
ehmaldonado38a21322016-09-02 04:10:34 -0700598 rtc_executable("stunserver") {
kjellander1993b1d2017-03-06 00:29:21 -0800599 testonly = true
kthelgason0727f152016-08-08 09:03:23 -0700600 sources = [
601 "stunserver/stunserver_main.cc",
602 ]
603 deps = [
kjellander1993b1d2017-03-06 00:29:21 -0800604 "../base:rtc_base",
kthelgason0727f152016-08-08 09:03:23 -0700605 "//webrtc/base:rtc_base_approved",
kjellander1993b1d2017-03-06 00:29:21 -0800606 "//webrtc/p2p:rtc_p2p",
kthelgason0727f152016-08-08 09:03:23 -0700607 "//webrtc/pc:rtc_pc",
608 "//webrtc/system_wrappers:field_trial_default",
609 "//webrtc/system_wrappers:metrics_default",
610 ]
kjellandere40a7ee2016-10-16 23:56:12 -0700611 if (!build_with_chromium && is_clang) {
612 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
ehmaldonado38a21322016-09-02 04:10:34 -0700613 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
kthelgason0727f152016-08-08 09:03:23 -0700614 }
615 }
616}
charujainaca3a242016-11-01 03:09:15 -0700617
618if (!build_with_chromium) {
619 # Doesn't build within Chrome on Win.
620 rtc_executable("stun_prober") {
kjellander1993b1d2017-03-06 00:29:21 -0800621 testonly = true
charujainaca3a242016-11-01 03:09:15 -0700622 sources = [
623 "stunprober/main.cc",
624 ]
625
626 if (!build_with_chromium && is_clang) {
627 # Suppress warnings from Chrome's Clang plugins.
628 # See http://code.google.com/p/webrtc/issues/detail?id=163 for details.
629 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
630 }
631
632 deps = [
kjellander1993b1d2017-03-06 00:29:21 -0800633 "../base:rtc_base",
634 "../base:rtc_base_approved",
charujainaca3a242016-11-01 03:09:15 -0700635 "../p2p:libstunprober",
636 "../p2p:rtc_p2p",
637 "../system_wrappers:field_trial_default",
638 ]
639 }
640}