blob: ebe426f00c18cbcdb494747398c42a7bdf89c4f3 [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",
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200195 "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",
sakalc4adacf2017-03-28 01:22:48 -0700204 "objc/AppRTCMobile/ARDSettingsModel+Private.h",
205 "objc/AppRTCMobile/ARDSettingsModel.h",
206 "objc/AppRTCMobile/ARDSettingsModel.m",
207 "objc/AppRTCMobile/ARDSettingsStore.h",
208 "objc/AppRTCMobile/ARDSettingsStore.m",
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200209 "objc/AppRTCMobile/ARDSignalingChannel.h",
210 "objc/AppRTCMobile/ARDSignalingMessage.h",
211 "objc/AppRTCMobile/ARDSignalingMessage.m",
212 "objc/AppRTCMobile/ARDStatsBuilder.h",
213 "objc/AppRTCMobile/ARDStatsBuilder.m",
kthelgasoncc882af2017-01-13 05:59:46 -0800214 "objc/AppRTCMobile/ARDTURNClient+Internal.h",
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200215 "objc/AppRTCMobile/ARDTURNClient.h",
kthelgasoncc882af2017-01-13 05:59:46 -0800216 "objc/AppRTCMobile/ARDTURNClient.m",
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200217 "objc/AppRTCMobile/ARDWebSocketChannel.h",
218 "objc/AppRTCMobile/ARDWebSocketChannel.m",
219 "objc/AppRTCMobile/RTCIceCandidate+JSON.h",
220 "objc/AppRTCMobile/RTCIceCandidate+JSON.m",
221 "objc/AppRTCMobile/RTCIceServer+JSON.h",
222 "objc/AppRTCMobile/RTCIceServer+JSON.m",
223 "objc/AppRTCMobile/RTCMediaConstraints+JSON.h",
224 "objc/AppRTCMobile/RTCMediaConstraints+JSON.m",
225 "objc/AppRTCMobile/RTCSessionDescription+JSON.h",
226 "objc/AppRTCMobile/RTCSessionDescription+JSON.m",
tkchin2ddfdba2016-08-07 21:37:45 -0700227 ]
kthelgasonb13237b2017-03-30 04:56:05 -0700228 configs += [ "//build/config/compiler:enable_arc" ]
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 ]
kthelgasonb13237b2017-03-30 04:56:05 -0700261 configs += [ "//build/config/compiler:enable_arc" ]
denicija77bfd7c2016-11-15 00:41:26 -0800262
263 deps = [
264 ":apprtc_common",
265 ":apprtc_signaling",
kjellander1993b1d2017-03-06 00:29:21 -0800266 "//webrtc/modules/audio_device",
denicija77bfd7c2016-11-15 00:41:26 -0800267 ]
268 }
269
270 ios_app_bundle("AppRTCMobile") {
kjellander1993b1d2017-03-06 00:29:21 -0800271 testonly = true
denicija77bfd7c2016-11-15 00:41:26 -0800272 sources = [
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200273 "objc/AppRTCMobile/ios/main.m",
tkchin2ddfdba2016-08-07 21:37:45 -0700274 ]
275
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200276 info_plist = "objc/AppRTCMobile/ios/Info.plist"
tkchin2ddfdba2016-08-07 21:37:45 -0700277
denicija77bfd7c2016-11-15 00:41:26 -0800278 configs += [ "..:common_config" ]
tkchin2ddfdba2016-08-07 21:37:45 -0700279 public_configs = [ "..:common_inherited_config" ]
280
281 deps = [
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200282 ":AppRTCMobile_ios_bundle_data",
kthelgasond3adbfb2017-01-26 01:14:04 -0800283 ":AppRTCMobile_ios_frameworks",
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
kthelgasond3adbfb2017-01-26 01:14:04 -0800292 bundle_data("AppRTCMobile_ios_frameworks") {
293 public_deps = [
294 "//webrtc/sdk:rtc_sdk_framework_objc+link",
295 ]
296 sources = [
297 "$root_out_dir/WebRTC.framework",
298 ]
299 outputs = [
300 "{{bundle_resources_dir}}/Frameworks/{{source_file_part}}",
301 ]
302 }
303
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200304 bundle_data("AppRTCMobile_ios_bundle_data") {
tkchin2ddfdba2016-08-07 21:37:45 -0700305 sources = [
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200306 "objc/AppRTCMobile/ios/resources/Roboto-Regular.ttf",
307 "objc/AppRTCMobile/ios/resources/iPhone5@2x.png",
308 "objc/AppRTCMobile/ios/resources/iPhone6@2x.png",
309 "objc/AppRTCMobile/ios/resources/iPhone6p@3x.png",
310 "objc/AppRTCMobile/ios/resources/ic_call_end_black_24dp.png",
311 "objc/AppRTCMobile/ios/resources/ic_call_end_black_24dp@2x.png",
312 "objc/AppRTCMobile/ios/resources/ic_clear_black_24dp.png",
313 "objc/AppRTCMobile/ios/resources/ic_clear_black_24dp@2x.png",
denicija6d6762c2016-10-28 04:53:16 -0700314 "objc/AppRTCMobile/ios/resources/ic_settings_black_24dp.png",
315 "objc/AppRTCMobile/ios/resources/ic_settings_black_24dp@2x.png",
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200316 "objc/AppRTCMobile/ios/resources/ic_surround_sound_black_24dp.png",
317 "objc/AppRTCMobile/ios/resources/ic_surround_sound_black_24dp@2x.png",
318 "objc/AppRTCMobile/ios/resources/ic_switch_video_black_24dp.png",
319 "objc/AppRTCMobile/ios/resources/ic_switch_video_black_24dp@2x.png",
320 "objc/AppRTCMobile/ios/resources/mozart.mp3",
tkchin2ddfdba2016-08-07 21:37:45 -0700321 "objc/Icon.png",
322 ]
323 outputs = [
324 "{{bundle_resources_dir}}/{{source_file_part}}",
325 ]
326 }
327 }
328
329 if (is_mac) {
denicija77bfd7c2016-11-15 00:41:26 -0800330 rtc_static_library("AppRTCMobile_lib") {
kjellander1993b1d2017-03-06 00:29:21 -0800331 testonly = true
tkchin2ddfdba2016-08-07 21:37:45 -0700332 sources = [
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200333 "objc/AppRTCMobile/mac/APPRTCAppDelegate.h",
334 "objc/AppRTCMobile/mac/APPRTCAppDelegate.m",
335 "objc/AppRTCMobile/mac/APPRTCViewController.h",
336 "objc/AppRTCMobile/mac/APPRTCViewController.m",
tkchin2ddfdba2016-08-07 21:37:45 -0700337 ]
338 configs += [
kjellander1993b1d2017-03-06 00:29:21 -0800339 "//webrtc:common_objc",
tkchin2ddfdba2016-08-07 21:37:45 -0700340 "//build/config/compiler:enable_arc",
341 ]
342 deps = [
343 ":apprtc_common",
344 ":apprtc_signaling",
345 ]
346 }
347
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200348 mac_app_bundle("AppRTCMobile") {
kjellander1993b1d2017-03-06 00:29:21 -0800349 testonly = true
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200350 output_name = "AppRTCMobile"
tkchin2ddfdba2016-08-07 21:37:45 -0700351
tkchin2ddfdba2016-08-07 21:37:45 -0700352 sources = [
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200353 "objc/AppRTCMobile/mac/main.m",
tkchin2ddfdba2016-08-07 21:37:45 -0700354 ]
355
356 public_configs = [ "..:common_inherited_config" ]
357
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200358 info_plist = "objc/AppRTCMobile/mac/Info.plist"
tkchin2ddfdba2016-08-07 21:37:45 -0700359
360 libs = [ "AppKit.framework" ]
361
362 deps = [
denicija77bfd7c2016-11-15 00:41:26 -0800363 ":AppRTCMobile_lib",
tkchin2ddfdba2016-08-07 21:37:45 -0700364 ]
365 }
366 }
367
368 config("socketrocket_include_config") {
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200369 include_dirs = [ "objc/AppRTCMobile/third_party/SocketRocket" ]
tkchin2ddfdba2016-08-07 21:37:45 -0700370 }
371
372 config("socketrocket_warning_config") {
373 # GN orders flags on a target before flags from configs. The default config
374 # adds these flags so to cancel them out they need to come from a config and
375 # cannot be on the target directly.
376 cflags = [
377 "-Wno-deprecated-declarations",
378 "-Wno-nonnull",
tkchin2ddfdba2016-08-07 21:37:45 -0700379 "-Wno-semicolon-before-method-body",
kthelgasone47de1a2017-02-24 01:56:01 -0800380 "-Wno-unused-variable",
tkchin2ddfdba2016-08-07 21:37:45 -0700381 ]
382
henrika27d8b612016-09-21 04:13:00 -0700383 cflags_objc = [
384 # Enabled for cflags_objc in build/config/compiler/BUILD.gn.
385 "-Wno-objc-missing-property-synthesis",
henrika27d8b612016-09-21 04:13:00 -0700386 ]
tkchin2ddfdba2016-08-07 21:37:45 -0700387 }
388
kjellanderb62dbbe2016-09-23 00:38:52 -0700389 rtc_static_library("socketrocket") {
kjellander1993b1d2017-03-06 00:29:21 -0800390 testonly = true
tkchin2ddfdba2016-08-07 21:37:45 -0700391 sources = [
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200392 "objc/AppRTCMobile/third_party/SocketRocket/SRWebSocket.h",
393 "objc/AppRTCMobile/third_party/SocketRocket/SRWebSocket.m",
tkchin2ddfdba2016-08-07 21:37:45 -0700394 ]
395 configs += [
tkchin2ddfdba2016-08-07 21:37:45 -0700396 "//build/config/compiler:enable_arc",
397 ":socketrocket_warning_config",
398 ]
ehmaldonadoe9cc6862016-09-05 06:10:18 -0700399 public_configs = [ ":socketrocket_include_config" ]
tkchin2ddfdba2016-08-07 21:37:45 -0700400
401 libs = [
402 "CFNetwork.framework",
403 "icucore",
404 ]
405 }
adam.fedorbcc5d872016-11-07 14:53:28 -0800406
407 if (rtc_include_tests) {
kthelgason4065a572017-02-14 04:58:56 -0800408 # TODO(kthelgason): compile xctests on mac when chromium supports it.
409 if (is_ios) {
410 rtc_source_set("apprtcmobile_test_sources") {
kjellander1993b1d2017-03-06 00:29:21 -0800411 testonly = true
kthelgason4065a572017-02-14 04:58:56 -0800412 include_dirs = [
413 "objc/AppRTCMobile",
414 "objc/AppRTCMobile/ios",
415 ]
416 testonly = true
417 sources = [
418 "objc/AppRTCMobile/tests/ARDAppClient_xctest.mm",
419 "objc/AppRTCMobile/tests/ARDSDPUtils_xctest.mm",
420 "objc/AppRTCMobile/tests/ARDSettingsModel_xctest.mm",
421 ]
kjellander1993b1d2017-03-06 00:29:21 -0800422 deps = [
423 "//webrtc/base:rtc_base",
424 ]
kthelgason4065a572017-02-14 04:58:56 -0800425 public_deps = [
426 ":AppRTCMobile_ios_frameworks",
427 ":AppRTCMobile_lib",
428 "//build/config/ios:xctest",
429 "//third_party/ocmock",
430 ]
431 configs += [ "//build/config/compiler:enable_arc" ]
adam.fedorbcc5d872016-11-07 14:53:28 -0800432 }
433
kthelgason4065a572017-02-14 04:58:56 -0800434 rtc_ios_xctest_test("apprtcmobile_tests") {
435 info_plist = "objc/AppRTCMobile/ios/Info.plist"
436 sources = [
437 "objc/AppRTCMobile/ios/main.m",
438 ]
439 deps = [
440 ":apprtcmobile_test_sources",
441 ]
442 ldflags = [ "-all_load" ]
443 }
adam.fedorbcc5d872016-11-07 14:53:28 -0800444 }
445 }
tkchin2ddfdba2016-08-07 21:37:45 -0700446}
kthelgason0727f152016-08-08 09:03:23 -0700447
448if (is_linux || is_win) {
ehmaldonadod02fe4b2016-08-26 13:31:24 -0700449 config("peerconnection_client_warnings_config") {
kjellander4a9abad2016-09-18 08:12:29 -0700450 cflags = []
ehmaldonadod02fe4b2016-08-26 13:31:24 -0700451 if (is_win && is_clang) {
kjellander4a9abad2016-09-18 08:12:29 -0700452 cflags += [
ehmaldonadod02fe4b2016-08-26 13:31:24 -0700453 # Disable warnings failing when compiling with Clang on Windows.
454 # https://bugs.chromium.org/p/webrtc/issues/detail?id=5366
455 "-Wno-format",
456
457 # See https://bugs.chromium.org/p/webrtc/issues/detail?id=6271
458 # for -Wno-reorder and -Wno-sign-compare
459 "-Wno-reorder",
460 "-Wno-sign-compare",
461 ]
462 }
kjellanderd4626e52016-09-07 02:33:01 -0700463 if (is_linux && target_cpu == "x86") {
kjellander4a9abad2016-09-18 08:12:29 -0700464 cflags += [
kjellanderd4626e52016-09-07 02:33:01 -0700465 # Needed to compile on Linux 32-bit.
466 "-Wno-sentinel",
467 ]
468 }
kjellander4a9abad2016-09-18 08:12:29 -0700469
470 if (is_clang) {
471 # TODO(ehmaldonado): Make peerconnection_client compile with the standard
472 # set of warnings.
473 # See https://bugs.chromium.org/p/webrtc/issues/detail?id=6306
474 cflags += [ "-Wno-inconsistent-missing-override" ]
475 }
ehmaldonadod02fe4b2016-08-26 13:31:24 -0700476 }
477
ehmaldonado38a21322016-09-02 04:10:34 -0700478 rtc_executable("peerconnection_client") {
kjellander1993b1d2017-03-06 00:29:21 -0800479 testonly = true
kthelgason0727f152016-08-08 09:03:23 -0700480 sources = [
481 "peerconnection/client/conductor.cc",
482 "peerconnection/client/conductor.h",
483 "peerconnection/client/defaults.cc",
484 "peerconnection/client/defaults.h",
485 "peerconnection/client/peer_connection_client.cc",
486 "peerconnection/client/peer_connection_client.h",
487 ]
ehmaldonado7a2ce0b2016-09-05 01:35:44 -0700488
kjellandere40a7ee2016-10-16 23:56:12 -0700489 if (!build_with_chromium && is_clang) {
490 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
ehmaldonado38a21322016-09-02 04:10:34 -0700491 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
kthelgason0727f152016-08-08 09:03:23 -0700492 }
kjellander1993b1d2017-03-06 00:29:21 -0800493 deps = []
kthelgason0727f152016-08-08 09:03:23 -0700494 if (is_win) {
495 sources += [
496 "peerconnection/client/flagdefs.h",
497 "peerconnection/client/main.cc",
498 "peerconnection/client/main_wnd.cc",
499 "peerconnection/client/main_wnd.h",
500 ]
501 cflags = [ "/wd4245" ]
502 configs += [ "//build/config/win:windowed" ]
kjellander1993b1d2017-03-06 00:29:21 -0800503 deps += [ "//webrtc/media:rtc_media_base" ]
kthelgason0727f152016-08-08 09:03:23 -0700504 }
505 if (is_linux) {
506 sources += [
507 "peerconnection/client/linux/main.cc",
508 "peerconnection/client/linux/main_wnd.cc",
509 "peerconnection/client/linux/main_wnd.h",
510 ]
Henrik Kjellanderefbde2c2017-03-27 08:28:27 +0200511 cflags = [ "-Wno-deprecated-declarations" ]
kthelgason0727f152016-08-08 09:03:23 -0700512 libs = [
513 "X11",
514 "Xcomposite",
515 "Xext",
516 "Xrender",
517 ]
thomasandersonef16e992016-12-13 02:57:43 -0800518 deps += [ "//build/config/linux/gtk" ]
kthelgason0727f152016-08-08 09:03:23 -0700519 }
ehmaldonadod02fe4b2016-08-26 13:31:24 -0700520 configs += [ ":peerconnection_client_warnings_config" ]
kjellander1993b1d2017-03-06 00:29:21 -0800521
522 deps += [
523 "//third_party/libyuv",
524 "//webrtc/api:libjingle_peerconnection_test_api",
525 "//webrtc/api:video_frame_api",
526 "//webrtc/base:rtc_base",
527 "//webrtc/base:rtc_base_approved",
528 "//webrtc/media:rtc_media",
529 "//webrtc/modules/video_capture:video_capture_module",
530 "//webrtc/pc:libjingle_peerconnection",
531 "//webrtc/system_wrappers:field_trial_default",
532 "//webrtc/system_wrappers:metrics_default",
533 ]
kthelgason0727f152016-08-08 09:03:23 -0700534 if (rtc_build_json) {
535 deps += [ "//third_party/jsoncpp" ]
536 }
537 }
kjellanderd4626e52016-09-07 02:33:01 -0700538
ehmaldonado38a21322016-09-02 04:10:34 -0700539 rtc_executable("peerconnection_server") {
kjellander1993b1d2017-03-06 00:29:21 -0800540 testonly = true
kthelgason0727f152016-08-08 09:03:23 -0700541 sources = [
542 "peerconnection/server/data_socket.cc",
543 "peerconnection/server/data_socket.h",
544 "peerconnection/server/main.cc",
545 "peerconnection/server/peer_channel.cc",
546 "peerconnection/server/peer_channel.h",
547 "peerconnection/server/utils.cc",
548 "peerconnection/server/utils.h",
549 ]
550 deps = [
551 "//webrtc:webrtc_common",
552 "//webrtc/base:rtc_base_approved",
553 "//webrtc/tools:command_line_parser",
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("relayserver") {
kjellander1993b1d2017-03-06 00:29:21 -0800561 testonly = true
kthelgason0727f152016-08-08 09:03:23 -0700562 sources = [
563 "relayserver/relayserver_main.cc",
564 ]
565 deps = [
kjellander1993b1d2017-03-06 00:29:21 -0800566 "../base:rtc_base",
kthelgason0727f152016-08-08 09:03:23 -0700567 "//webrtc/base:rtc_base_approved",
kjellander1993b1d2017-03-06 00:29:21 -0800568 "//webrtc/p2p:rtc_p2p",
kthelgason0727f152016-08-08 09:03:23 -0700569 "//webrtc/pc:rtc_pc",
570 "//webrtc/system_wrappers:field_trial_default",
571 "//webrtc/system_wrappers:metrics_default",
572 ]
kjellandere40a7ee2016-10-16 23:56:12 -0700573 if (!build_with_chromium && is_clang) {
574 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
ehmaldonado38a21322016-09-02 04:10:34 -0700575 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
kthelgason0727f152016-08-08 09:03:23 -0700576 }
577 }
ehmaldonado38a21322016-09-02 04:10:34 -0700578 rtc_executable("turnserver") {
kjellander1993b1d2017-03-06 00:29:21 -0800579 testonly = true
kthelgason0727f152016-08-08 09:03:23 -0700580 sources = [
581 "turnserver/turnserver_main.cc",
582 ]
583 deps = [
kjellander1993b1d2017-03-06 00:29:21 -0800584 "../base:rtc_base",
kthelgason0727f152016-08-08 09:03:23 -0700585 "//webrtc/base:rtc_base_approved",
kjellander1993b1d2017-03-06 00:29:21 -0800586 "//webrtc/p2p:rtc_p2p",
kthelgason0727f152016-08-08 09:03:23 -0700587 "//webrtc/pc:rtc_pc",
588 "//webrtc/system_wrappers:field_trial_default",
589 "//webrtc/system_wrappers:metrics_default",
590 ]
kjellandere40a7ee2016-10-16 23:56:12 -0700591 if (!build_with_chromium && is_clang) {
592 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
ehmaldonado38a21322016-09-02 04:10:34 -0700593 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
kthelgason0727f152016-08-08 09:03:23 -0700594 }
595 }
ehmaldonado38a21322016-09-02 04:10:34 -0700596 rtc_executable("stunserver") {
kjellander1993b1d2017-03-06 00:29:21 -0800597 testonly = true
kthelgason0727f152016-08-08 09:03:23 -0700598 sources = [
599 "stunserver/stunserver_main.cc",
600 ]
601 deps = [
kjellander1993b1d2017-03-06 00:29:21 -0800602 "../base:rtc_base",
kthelgason0727f152016-08-08 09:03:23 -0700603 "//webrtc/base:rtc_base_approved",
kjellander1993b1d2017-03-06 00:29:21 -0800604 "//webrtc/p2p:rtc_p2p",
kthelgason0727f152016-08-08 09:03:23 -0700605 "//webrtc/pc:rtc_pc",
606 "//webrtc/system_wrappers:field_trial_default",
607 "//webrtc/system_wrappers:metrics_default",
608 ]
kjellandere40a7ee2016-10-16 23:56:12 -0700609 if (!build_with_chromium && is_clang) {
610 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
ehmaldonado38a21322016-09-02 04:10:34 -0700611 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
kthelgason0727f152016-08-08 09:03:23 -0700612 }
613 }
614}
charujainaca3a242016-11-01 03:09:15 -0700615
616if (!build_with_chromium) {
617 # Doesn't build within Chrome on Win.
618 rtc_executable("stun_prober") {
kjellander1993b1d2017-03-06 00:29:21 -0800619 testonly = true
charujainaca3a242016-11-01 03:09:15 -0700620 sources = [
621 "stunprober/main.cc",
622 ]
623
624 if (!build_with_chromium && is_clang) {
625 # Suppress warnings from Chrome's Clang plugins.
626 # See http://code.google.com/p/webrtc/issues/detail?id=163 for details.
627 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
628 }
629
630 deps = [
kjellander1993b1d2017-03-06 00:29:21 -0800631 "../base:rtc_base",
632 "../base:rtc_base_approved",
charujainaca3a242016-11-01 03:09:15 -0700633 "../p2p:libstunprober",
634 "../p2p:rtc_p2p",
635 "../system_wrappers:field_trial_default",
636 ]
637 }
638}