blob: 80b3efaf81d4c4e7b7e2c0201f40f059f5f8ce8c [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
oprypin30cda5e2017-04-24 04:15:13 -0700132 java_files = [ "androidtests/src/org/appspot/apprtc/test/CallActivityStubbedInputOutputTest.java" ]
mandermoa6069e82017-01-16 02:23:09 -0800133
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 ]
ehmaldonadoe9cc6862016-09-05 06:10:18 -0700163 public_configs = [ ":apprtc_common_config" ]
tkchin2ddfdba2016-08-07 21:37:45 -0700164
165 deps = [
kjellander1993b1d2017-03-06 00:29:21 -0800166 "//webrtc/sdk:rtc_sdk_common_objc",
167 "//webrtc/system_wrappers:field_trial_default",
168 "//webrtc/system_wrappers:metrics_default",
tkchin2ddfdba2016-08-07 21:37:45 -0700169 ]
170 }
171
172 config("apprtc_signaling_config") {
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200173 include_dirs = [ "objc/AppRTCMobile" ]
tkchin2ddfdba2016-08-07 21:37:45 -0700174
175 # GN orders flags on a target before flags from configs. The default config
176 # adds these flags so to cancel them out they need to come from a config and
177 # cannot be on the target directly.
178 cflags = [
179 "-Wno-sign-compare",
180 "-Wno-unused-variable",
181 ]
tkchin2ddfdba2016-08-07 21:37:45 -0700182 }
183
kjellanderb62dbbe2016-09-23 00:38:52 -0700184 rtc_static_library("apprtc_signaling") {
kjellander1993b1d2017-03-06 00:29:21 -0800185 testonly = true
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",
sakalc522e752017-04-05 12:17:48 -0700194 "objc/AppRTCMobile/ARDCaptureController.h",
195 "objc/AppRTCMobile/ARDCaptureController.m",
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200196 "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",
sakalc4adacf2017-03-28 01:22:48 -0700205 "objc/AppRTCMobile/ARDSettingsModel+Private.h",
206 "objc/AppRTCMobile/ARDSettingsModel.h",
207 "objc/AppRTCMobile/ARDSettingsModel.m",
208 "objc/AppRTCMobile/ARDSettingsStore.h",
209 "objc/AppRTCMobile/ARDSettingsStore.m",
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200210 "objc/AppRTCMobile/ARDSignalingChannel.h",
211 "objc/AppRTCMobile/ARDSignalingMessage.h",
212 "objc/AppRTCMobile/ARDSignalingMessage.m",
213 "objc/AppRTCMobile/ARDStatsBuilder.h",
214 "objc/AppRTCMobile/ARDStatsBuilder.m",
kthelgasoncc882af2017-01-13 05:59:46 -0800215 "objc/AppRTCMobile/ARDTURNClient+Internal.h",
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200216 "objc/AppRTCMobile/ARDTURNClient.h",
kthelgasoncc882af2017-01-13 05:59:46 -0800217 "objc/AppRTCMobile/ARDTURNClient.m",
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200218 "objc/AppRTCMobile/ARDWebSocketChannel.h",
219 "objc/AppRTCMobile/ARDWebSocketChannel.m",
220 "objc/AppRTCMobile/RTCIceCandidate+JSON.h",
221 "objc/AppRTCMobile/RTCIceCandidate+JSON.m",
222 "objc/AppRTCMobile/RTCIceServer+JSON.h",
223 "objc/AppRTCMobile/RTCIceServer+JSON.m",
224 "objc/AppRTCMobile/RTCMediaConstraints+JSON.h",
225 "objc/AppRTCMobile/RTCMediaConstraints+JSON.m",
226 "objc/AppRTCMobile/RTCSessionDescription+JSON.h",
227 "objc/AppRTCMobile/RTCSessionDescription+JSON.m",
tkchin2ddfdba2016-08-07 21:37:45 -0700228 ]
ehmaldonadoe9cc6862016-09-05 06:10:18 -0700229 public_configs = [ ":apprtc_signaling_config" ]
tkchin2ddfdba2016-08-07 21:37:45 -0700230 deps = [
231 ":apprtc_common",
232 ":socketrocket",
233 ]
234 public_deps = [
kjellander1993b1d2017-03-06 00:29:21 -0800235 "//webrtc/sdk:rtc_sdk_peerconnection_objc",
tkchin2ddfdba2016-08-07 21:37:45 -0700236 ]
237 libs = [ "QuartzCore.framework" ]
238 }
239
240 if (is_ios) {
denicija77bfd7c2016-11-15 00:41:26 -0800241 rtc_static_library("AppRTCMobile_lib") {
kjellander1993b1d2017-03-06 00:29:21 -0800242 testonly = true
tkchin2ddfdba2016-08-07 21:37:45 -0700243 sources = [
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200244 "objc/AppRTCMobile/ios/ARDAppDelegate.m",
245 "objc/AppRTCMobile/ios/ARDMainView.h",
246 "objc/AppRTCMobile/ios/ARDMainView.m",
247 "objc/AppRTCMobile/ios/ARDMainViewController.h",
248 "objc/AppRTCMobile/ios/ARDMainViewController.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 ]
denicija77bfd7c2016-11-15 00:41:26 -0800261
262 deps = [
263 ":apprtc_common",
264 ":apprtc_signaling",
kjellander1993b1d2017-03-06 00:29:21 -0800265 "//webrtc/modules/audio_device",
denicija77bfd7c2016-11-15 00:41:26 -0800266 ]
267 }
268
269 ios_app_bundle("AppRTCMobile") {
kjellander1993b1d2017-03-06 00:29:21 -0800270 testonly = true
denicija77bfd7c2016-11-15 00:41:26 -0800271 sources = [
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200272 "objc/AppRTCMobile/ios/main.m",
tkchin2ddfdba2016-08-07 21:37:45 -0700273 ]
274
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200275 info_plist = "objc/AppRTCMobile/ios/Info.plist"
tkchin2ddfdba2016-08-07 21:37:45 -0700276
denicija77bfd7c2016-11-15 00:41:26 -0800277 configs += [ "..:common_config" ]
tkchin2ddfdba2016-08-07 21:37:45 -0700278 public_configs = [ "..:common_inherited_config" ]
279
280 deps = [
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200281 ":AppRTCMobile_ios_bundle_data",
kthelgasond3adbfb2017-01-26 01:14:04 -0800282 ":AppRTCMobile_ios_frameworks",
denicija77bfd7c2016-11-15 00:41:26 -0800283 ":AppRTCMobile_lib",
tkchin2ddfdba2016-08-07 21:37:45 -0700284 ]
285
286 if (target_cpu == "x86") {
287 deps += [ "//testing/iossim:iossim" ]
288 }
289 }
290
kthelgasond3adbfb2017-01-26 01:14:04 -0800291 bundle_data("AppRTCMobile_ios_frameworks") {
292 public_deps = [
293 "//webrtc/sdk:rtc_sdk_framework_objc+link",
294 ]
295 sources = [
296 "$root_out_dir/WebRTC.framework",
297 ]
298 outputs = [
299 "{{bundle_resources_dir}}/Frameworks/{{source_file_part}}",
300 ]
301 }
302
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200303 bundle_data("AppRTCMobile_ios_bundle_data") {
tkchin2ddfdba2016-08-07 21:37:45 -0700304 sources = [
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200305 "objc/AppRTCMobile/ios/resources/Roboto-Regular.ttf",
306 "objc/AppRTCMobile/ios/resources/iPhone5@2x.png",
307 "objc/AppRTCMobile/ios/resources/iPhone6@2x.png",
308 "objc/AppRTCMobile/ios/resources/iPhone6p@3x.png",
309 "objc/AppRTCMobile/ios/resources/ic_call_end_black_24dp.png",
310 "objc/AppRTCMobile/ios/resources/ic_call_end_black_24dp@2x.png",
311 "objc/AppRTCMobile/ios/resources/ic_clear_black_24dp.png",
312 "objc/AppRTCMobile/ios/resources/ic_clear_black_24dp@2x.png",
denicija6d6762c2016-10-28 04:53:16 -0700313 "objc/AppRTCMobile/ios/resources/ic_settings_black_24dp.png",
314 "objc/AppRTCMobile/ios/resources/ic_settings_black_24dp@2x.png",
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200315 "objc/AppRTCMobile/ios/resources/ic_surround_sound_black_24dp.png",
316 "objc/AppRTCMobile/ios/resources/ic_surround_sound_black_24dp@2x.png",
317 "objc/AppRTCMobile/ios/resources/ic_switch_video_black_24dp.png",
318 "objc/AppRTCMobile/ios/resources/ic_switch_video_black_24dp@2x.png",
319 "objc/AppRTCMobile/ios/resources/mozart.mp3",
tkchin2ddfdba2016-08-07 21:37:45 -0700320 "objc/Icon.png",
321 ]
322 outputs = [
323 "{{bundle_resources_dir}}/{{source_file_part}}",
324 ]
325 }
326 }
327
328 if (is_mac) {
denicija77bfd7c2016-11-15 00:41:26 -0800329 rtc_static_library("AppRTCMobile_lib") {
kjellander1993b1d2017-03-06 00:29:21 -0800330 testonly = true
tkchin2ddfdba2016-08-07 21:37:45 -0700331 sources = [
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200332 "objc/AppRTCMobile/mac/APPRTCAppDelegate.h",
333 "objc/AppRTCMobile/mac/APPRTCAppDelegate.m",
334 "objc/AppRTCMobile/mac/APPRTCViewController.h",
335 "objc/AppRTCMobile/mac/APPRTCViewController.m",
tkchin2ddfdba2016-08-07 21:37:45 -0700336 ]
kthelgasonc0977102017-04-24 00:57:16 -0700337 configs += [ "//webrtc:common_objc" ]
tkchin2ddfdba2016-08-07 21:37:45 -0700338 deps = [
339 ":apprtc_common",
340 ":apprtc_signaling",
341 ]
342 }
343
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200344 mac_app_bundle("AppRTCMobile") {
kjellander1993b1d2017-03-06 00:29:21 -0800345 testonly = true
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200346 output_name = "AppRTCMobile"
tkchin2ddfdba2016-08-07 21:37:45 -0700347
tkchin2ddfdba2016-08-07 21:37:45 -0700348 sources = [
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200349 "objc/AppRTCMobile/mac/main.m",
tkchin2ddfdba2016-08-07 21:37:45 -0700350 ]
351
352 public_configs = [ "..:common_inherited_config" ]
353
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200354 info_plist = "objc/AppRTCMobile/mac/Info.plist"
tkchin2ddfdba2016-08-07 21:37:45 -0700355
356 libs = [ "AppKit.framework" ]
357
358 deps = [
denicija77bfd7c2016-11-15 00:41:26 -0800359 ":AppRTCMobile_lib",
tkchin2ddfdba2016-08-07 21:37:45 -0700360 ]
361 }
362 }
363
364 config("socketrocket_include_config") {
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200365 include_dirs = [ "objc/AppRTCMobile/third_party/SocketRocket" ]
tkchin2ddfdba2016-08-07 21:37:45 -0700366 }
367
368 config("socketrocket_warning_config") {
369 # GN orders flags on a target before flags from configs. The default config
370 # adds these flags so to cancel them out they need to come from a config and
371 # cannot be on the target directly.
372 cflags = [
373 "-Wno-deprecated-declarations",
374 "-Wno-nonnull",
tkchin2ddfdba2016-08-07 21:37:45 -0700375 "-Wno-semicolon-before-method-body",
kthelgasone47de1a2017-02-24 01:56:01 -0800376 "-Wno-unused-variable",
tkchin2ddfdba2016-08-07 21:37:45 -0700377 ]
378
henrika27d8b612016-09-21 04:13:00 -0700379 cflags_objc = [
380 # Enabled for cflags_objc in build/config/compiler/BUILD.gn.
381 "-Wno-objc-missing-property-synthesis",
henrika27d8b612016-09-21 04:13:00 -0700382 ]
tkchin2ddfdba2016-08-07 21:37:45 -0700383 }
384
kjellanderb62dbbe2016-09-23 00:38:52 -0700385 rtc_static_library("socketrocket") {
kjellander1993b1d2017-03-06 00:29:21 -0800386 testonly = true
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 ]
kthelgasonc0977102017-04-24 00:57:16 -0700391 configs += [ ":socketrocket_warning_config" ]
ehmaldonadoe9cc6862016-09-05 06:10:18 -0700392 public_configs = [ ":socketrocket_include_config" ]
tkchin2ddfdba2016-08-07 21:37:45 -0700393
394 libs = [
395 "CFNetwork.framework",
396 "icucore",
397 ]
398 }
adam.fedorbcc5d872016-11-07 14:53:28 -0800399
400 if (rtc_include_tests) {
kthelgason4065a572017-02-14 04:58:56 -0800401 # TODO(kthelgason): compile xctests on mac when chromium supports it.
402 if (is_ios) {
403 rtc_source_set("apprtcmobile_test_sources") {
kjellander1993b1d2017-03-06 00:29:21 -0800404 testonly = true
kthelgason4065a572017-02-14 04:58:56 -0800405 include_dirs = [
406 "objc/AppRTCMobile",
407 "objc/AppRTCMobile/ios",
408 ]
409 testonly = true
410 sources = [
411 "objc/AppRTCMobile/tests/ARDAppClient_xctest.mm",
412 "objc/AppRTCMobile/tests/ARDSDPUtils_xctest.mm",
413 "objc/AppRTCMobile/tests/ARDSettingsModel_xctest.mm",
414 ]
kjellander1993b1d2017-03-06 00:29:21 -0800415 deps = [
416 "//webrtc/base:rtc_base",
417 ]
kthelgason4065a572017-02-14 04:58:56 -0800418 public_deps = [
419 ":AppRTCMobile_ios_frameworks",
420 ":AppRTCMobile_lib",
421 "//build/config/ios:xctest",
422 "//third_party/ocmock",
423 ]
adam.fedorbcc5d872016-11-07 14:53:28 -0800424 }
425
kthelgason4065a572017-02-14 04:58:56 -0800426 rtc_ios_xctest_test("apprtcmobile_tests") {
427 info_plist = "objc/AppRTCMobile/ios/Info.plist"
428 sources = [
429 "objc/AppRTCMobile/ios/main.m",
430 ]
431 deps = [
432 ":apprtcmobile_test_sources",
433 ]
434 ldflags = [ "-all_load" ]
435 }
adam.fedorbcc5d872016-11-07 14:53:28 -0800436 }
437 }
tkchin2ddfdba2016-08-07 21:37:45 -0700438}
kthelgason0727f152016-08-08 09:03:23 -0700439
440if (is_linux || is_win) {
ehmaldonadod02fe4b2016-08-26 13:31:24 -0700441 config("peerconnection_client_warnings_config") {
kjellander4a9abad2016-09-18 08:12:29 -0700442 cflags = []
ehmaldonadod02fe4b2016-08-26 13:31:24 -0700443 if (is_win && is_clang) {
kjellander4a9abad2016-09-18 08:12:29 -0700444 cflags += [
ehmaldonadod02fe4b2016-08-26 13:31:24 -0700445 # Disable warnings failing when compiling with Clang on Windows.
446 # https://bugs.chromium.org/p/webrtc/issues/detail?id=5366
447 "-Wno-format",
448
449 # See https://bugs.chromium.org/p/webrtc/issues/detail?id=6271
450 # for -Wno-reorder and -Wno-sign-compare
451 "-Wno-reorder",
452 "-Wno-sign-compare",
453 ]
454 }
kjellanderd4626e52016-09-07 02:33:01 -0700455 if (is_linux && target_cpu == "x86") {
kjellander4a9abad2016-09-18 08:12:29 -0700456 cflags += [
kjellanderd4626e52016-09-07 02:33:01 -0700457 # Needed to compile on Linux 32-bit.
458 "-Wno-sentinel",
459 ]
460 }
kjellander4a9abad2016-09-18 08:12:29 -0700461
462 if (is_clang) {
463 # TODO(ehmaldonado): Make peerconnection_client compile with the standard
464 # set of warnings.
465 # See https://bugs.chromium.org/p/webrtc/issues/detail?id=6306
466 cflags += [ "-Wno-inconsistent-missing-override" ]
467 }
ehmaldonadod02fe4b2016-08-26 13:31:24 -0700468 }
469
ehmaldonado38a21322016-09-02 04:10:34 -0700470 rtc_executable("peerconnection_client") {
kjellander1993b1d2017-03-06 00:29:21 -0800471 testonly = true
kthelgason0727f152016-08-08 09:03:23 -0700472 sources = [
473 "peerconnection/client/conductor.cc",
474 "peerconnection/client/conductor.h",
475 "peerconnection/client/defaults.cc",
476 "peerconnection/client/defaults.h",
477 "peerconnection/client/peer_connection_client.cc",
478 "peerconnection/client/peer_connection_client.h",
479 ]
ehmaldonado7a2ce0b2016-09-05 01:35:44 -0700480
kjellandere40a7ee2016-10-16 23:56:12 -0700481 if (!build_with_chromium && is_clang) {
482 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
ehmaldonado38a21322016-09-02 04:10:34 -0700483 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
kthelgason0727f152016-08-08 09:03:23 -0700484 }
kjellander1993b1d2017-03-06 00:29:21 -0800485 deps = []
kthelgason0727f152016-08-08 09:03:23 -0700486 if (is_win) {
487 sources += [
488 "peerconnection/client/flagdefs.h",
489 "peerconnection/client/main.cc",
490 "peerconnection/client/main_wnd.cc",
491 "peerconnection/client/main_wnd.h",
492 ]
493 cflags = [ "/wd4245" ]
494 configs += [ "//build/config/win:windowed" ]
kjellander1993b1d2017-03-06 00:29:21 -0800495 deps += [ "//webrtc/media:rtc_media_base" ]
kthelgason0727f152016-08-08 09:03:23 -0700496 }
497 if (is_linux) {
498 sources += [
499 "peerconnection/client/linux/main.cc",
500 "peerconnection/client/linux/main_wnd.cc",
501 "peerconnection/client/linux/main_wnd.h",
502 ]
Henrik Kjellanderefbde2c2017-03-27 08:28:27 +0200503 cflags = [ "-Wno-deprecated-declarations" ]
kthelgason0727f152016-08-08 09:03:23 -0700504 libs = [
505 "X11",
506 "Xcomposite",
507 "Xext",
508 "Xrender",
509 ]
thomasandersonef16e992016-12-13 02:57:43 -0800510 deps += [ "//build/config/linux/gtk" ]
kthelgason0727f152016-08-08 09:03:23 -0700511 }
ehmaldonadod02fe4b2016-08-26 13:31:24 -0700512 configs += [ ":peerconnection_client_warnings_config" ]
kjellander1993b1d2017-03-06 00:29:21 -0800513
514 deps += [
515 "//third_party/libyuv",
516 "//webrtc/api:libjingle_peerconnection_test_api",
517 "//webrtc/api:video_frame_api",
518 "//webrtc/base:rtc_base",
519 "//webrtc/base:rtc_base_approved",
zhihuang44d305a2017-04-24 12:05:06 -0700520 "//webrtc/base:rtc_json",
kjellander1993b1d2017-03-06 00:29:21 -0800521 "//webrtc/media:rtc_media",
522 "//webrtc/modules/video_capture:video_capture_module",
523 "//webrtc/pc:libjingle_peerconnection",
524 "//webrtc/system_wrappers:field_trial_default",
525 "//webrtc/system_wrappers:metrics_default",
526 ]
kthelgason0727f152016-08-08 09:03:23 -0700527 }
kjellanderd4626e52016-09-07 02:33:01 -0700528
ehmaldonado38a21322016-09-02 04:10:34 -0700529 rtc_executable("peerconnection_server") {
kjellander1993b1d2017-03-06 00:29:21 -0800530 testonly = true
kthelgason0727f152016-08-08 09:03:23 -0700531 sources = [
532 "peerconnection/server/data_socket.cc",
533 "peerconnection/server/data_socket.h",
534 "peerconnection/server/main.cc",
535 "peerconnection/server/peer_channel.cc",
536 "peerconnection/server/peer_channel.h",
537 "peerconnection/server/utils.cc",
538 "peerconnection/server/utils.h",
539 ]
540 deps = [
541 "//webrtc:webrtc_common",
542 "//webrtc/base:rtc_base_approved",
543 "//webrtc/tools:command_line_parser",
544 ]
kjellandere40a7ee2016-10-16 23:56:12 -0700545 if (!build_with_chromium && is_clang) {
546 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
ehmaldonado38a21322016-09-02 04:10:34 -0700547 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
kthelgason0727f152016-08-08 09:03:23 -0700548 }
549 }
ehmaldonado38a21322016-09-02 04:10:34 -0700550 rtc_executable("relayserver") {
kjellander1993b1d2017-03-06 00:29:21 -0800551 testonly = true
kthelgason0727f152016-08-08 09:03:23 -0700552 sources = [
553 "relayserver/relayserver_main.cc",
554 ]
555 deps = [
kjellander1993b1d2017-03-06 00:29:21 -0800556 "../base:rtc_base",
kthelgason0727f152016-08-08 09:03:23 -0700557 "//webrtc/base:rtc_base_approved",
kjellander1993b1d2017-03-06 00:29:21 -0800558 "//webrtc/p2p:rtc_p2p",
kthelgason0727f152016-08-08 09:03:23 -0700559 "//webrtc/pc:rtc_pc",
560 "//webrtc/system_wrappers:field_trial_default",
561 "//webrtc/system_wrappers:metrics_default",
562 ]
kjellandere40a7ee2016-10-16 23:56:12 -0700563 if (!build_with_chromium && is_clang) {
564 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
ehmaldonado38a21322016-09-02 04:10:34 -0700565 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
kthelgason0727f152016-08-08 09:03:23 -0700566 }
567 }
ehmaldonado38a21322016-09-02 04:10:34 -0700568 rtc_executable("turnserver") {
kjellander1993b1d2017-03-06 00:29:21 -0800569 testonly = true
kthelgason0727f152016-08-08 09:03:23 -0700570 sources = [
571 "turnserver/turnserver_main.cc",
572 ]
573 deps = [
kjellander1993b1d2017-03-06 00:29:21 -0800574 "../base:rtc_base",
kthelgason0727f152016-08-08 09:03:23 -0700575 "//webrtc/base:rtc_base_approved",
kjellander1993b1d2017-03-06 00:29:21 -0800576 "//webrtc/p2p:rtc_p2p",
kthelgason0727f152016-08-08 09:03:23 -0700577 "//webrtc/pc:rtc_pc",
578 "//webrtc/system_wrappers:field_trial_default",
579 "//webrtc/system_wrappers:metrics_default",
580 ]
kjellandere40a7ee2016-10-16 23:56:12 -0700581 if (!build_with_chromium && is_clang) {
582 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
ehmaldonado38a21322016-09-02 04:10:34 -0700583 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
kthelgason0727f152016-08-08 09:03:23 -0700584 }
585 }
ehmaldonado38a21322016-09-02 04:10:34 -0700586 rtc_executable("stunserver") {
kjellander1993b1d2017-03-06 00:29:21 -0800587 testonly = true
kthelgason0727f152016-08-08 09:03:23 -0700588 sources = [
589 "stunserver/stunserver_main.cc",
590 ]
591 deps = [
kjellander1993b1d2017-03-06 00:29:21 -0800592 "../base:rtc_base",
kthelgason0727f152016-08-08 09:03:23 -0700593 "//webrtc/base:rtc_base_approved",
kjellander1993b1d2017-03-06 00:29:21 -0800594 "//webrtc/p2p:rtc_p2p",
kthelgason0727f152016-08-08 09:03:23 -0700595 "//webrtc/pc:rtc_pc",
596 "//webrtc/system_wrappers:field_trial_default",
597 "//webrtc/system_wrappers:metrics_default",
598 ]
kjellandere40a7ee2016-10-16 23:56:12 -0700599 if (!build_with_chromium && is_clang) {
600 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
ehmaldonado38a21322016-09-02 04:10:34 -0700601 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
kthelgason0727f152016-08-08 09:03:23 -0700602 }
603 }
604}
charujainaca3a242016-11-01 03:09:15 -0700605
606if (!build_with_chromium) {
607 # Doesn't build within Chrome on Win.
608 rtc_executable("stun_prober") {
kjellander1993b1d2017-03-06 00:29:21 -0800609 testonly = true
charujainaca3a242016-11-01 03:09:15 -0700610 sources = [
611 "stunprober/main.cc",
612 ]
613
614 if (!build_with_chromium && is_clang) {
615 # Suppress warnings from Chrome's Clang plugins.
616 # See http://code.google.com/p/webrtc/issues/detail?id=163 for details.
617 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
618 }
619
620 deps = [
kjellander1993b1d2017-03-06 00:29:21 -0800621 "../base:rtc_base",
622 "../base:rtc_base_approved",
charujainaca3a242016-11-01 03:09:15 -0700623 "../p2p:libstunprober",
624 "../p2p:rtc_p2p",
625 "../system_wrappers:field_trial_default",
626 ]
627 }
628}