blob: 01d73a48dc2936aaf739f21a5b79f9d6ba8323e5 [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) {
Sami Kalliomäki19b76142017-10-30 13:54:21 +010052 rtc_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",
jianjun.zhuc0247402017-07-11 06:20:45 -070060 "../rtc_base:base_java",
Sami Kalliomaki9c0c75b2016-06-29 14:55:00 +020061 "//base:base_java",
Sami Kalliomaki9c0c75b2016-06-29 14:55:00 +020062 ]
63
jianjun.zhuc0247402017-07-11 06:20:45 -070064 shared_libraries = [ "../sdk/android:libjingle_peerconnection_so" ]
Sami Kalliomaki9c0c75b2016-06-29 14:55:00 +020065 }
66
Sami Kalliomäki19b76142017-10-30 13:54:21 +010067 rtc_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",
jianjun.zhuc0247402017-07-11 06:20:45 -070097 "../modules/audio_device:audio_device_java",
98 "../rtc_base:base_java",
99 "../sdk/android:libjingle_peerconnection_java",
100 "../sdk/android:libjingle_peerconnection_metrics_default_java",
101 "androidapp/third_party/autobanh:autobanh_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
Sami Kalliomäki19b76142017-10-30 13:54:21 +0100111 rtc_instrumentation_test_apk("AppRTCMobileTest") {
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200112 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",
jianjun.zhuc0247402017-07-11 06:20:45 -0700121 "../sdk/android:libjingle_peerconnection_java",
sakalcb79d512017-01-11 06:21:26 -0800122 "//third_party/android_support_test_runner:runner_java",
123 "//third_party/junit",
Sami Kalliomaki9c0c75b2016-06-29 14:55:00 +0200124 ]
125 }
mandermoa6069e82017-01-16 02:23:09 -0800126
Sami Kalliomäki19b76142017-10-30 13:54:21 +0100127 rtc_instrumentation_test_apk("AppRTCMobileTestStubbedVideoIO") {
mandermoa6069e82017-01-16 02:23:09 -0800128 apk_name = "AppRTCMobileTestStubbedVideoIO"
129 android_manifest = "androidtests/AndroidManifest.xml"
130
oprypin30cda5e2017-04-24 04:15:13 -0700131 java_files = [ "androidtests/src/org/appspot/apprtc/test/CallActivityStubbedInputOutputTest.java" ]
mandermoa6069e82017-01-16 02:23:09 -0800132
133 apk_under_test = ":AppRTCMobile"
134
135 deps = [
136 ":AppRTCMobile_javalib",
jianjun.zhuc0247402017-07-11 06:20:45 -0700137 "../sdk/android:libjingle_peerconnection_java",
mandermoa6069e82017-01-16 02:23:09 -0800138 "//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",
mandermoa6069e82017-01-16 02:23:09 -0800143 ]
144
145 data = [
Mirko Bonadei92ea95e2017-09-15 06:47:31 +0200146 "../resources/reference_video_640x360_30fps.y4m",
mandermoa6069e82017-01-16 02:23:09 -0800147 ]
148 }
Sami Kalliomaki9c0c75b2016-06-29 14:55:00 +0200149}
tkchin2ddfdba2016-08-07 21:37:45 -0700150
151if (is_ios || (is_mac && target_cpu != "x86")) {
tkchin2ddfdba2016-08-07 21:37:45 -0700152 config("apprtc_common_config") {
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200153 include_dirs = [ "objc/AppRTCMobile/common" ]
tkchin2ddfdba2016-08-07 21:37:45 -0700154 }
155
kjellanderb62dbbe2016-09-23 00:38:52 -0700156 rtc_static_library("apprtc_common") {
kjellander1993b1d2017-03-06 00:29:21 -0800157 testonly = true
tkchin2ddfdba2016-08-07 21:37:45 -0700158 sources = [
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200159 "objc/AppRTCMobile/common/ARDUtilities.h",
160 "objc/AppRTCMobile/common/ARDUtilities.m",
tkchin2ddfdba2016-08-07 21:37:45 -0700161 ]
ehmaldonadoe9cc6862016-09-05 06:10:18 -0700162 public_configs = [ ":apprtc_common_config" ]
tkchin2ddfdba2016-08-07 21:37:45 -0700163
Kári Tristan Helgason946923a2017-06-02 14:05:56 +0200164 if (is_ios) {
kthelgason5901d9d2017-08-16 07:28:03 -0700165 deps = [
166 ":AppRTCMobile_ios_frameworks",
167 ]
Kári Tristan Helgason946923a2017-06-02 14:05:56 +0200168 } else {
kthelgason5901d9d2017-08-16 07:28:03 -0700169 deps = [
kthelgason36d658d2017-08-24 05:43:45 -0700170 "../sdk:common_objc",
kthelgason5901d9d2017-08-16 07:28:03 -0700171 "../system_wrappers:field_trial_default",
172 "../system_wrappers:metrics_default",
173 ]
Kári Tristan Helgason946923a2017-06-02 14:05:56 +0200174 }
tkchin2ddfdba2016-08-07 21:37:45 -0700175 }
176
177 config("apprtc_signaling_config") {
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200178 include_dirs = [ "objc/AppRTCMobile" ]
tkchin2ddfdba2016-08-07 21:37:45 -0700179
180 # GN orders flags on a target before flags from configs. The default config
181 # adds these flags so to cancel them out they need to come from a config and
182 # cannot be on the target directly.
183 cflags = [
184 "-Wno-sign-compare",
185 "-Wno-unused-variable",
186 ]
tkchin2ddfdba2016-08-07 21:37:45 -0700187 }
188
kjellanderb62dbbe2016-09-23 00:38:52 -0700189 rtc_static_library("apprtc_signaling") {
kjellander1993b1d2017-03-06 00:29:21 -0800190 testonly = true
tkchin2ddfdba2016-08-07 21:37:45 -0700191 sources = [
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200192 "objc/AppRTCMobile/ARDAppClient+Internal.h",
193 "objc/AppRTCMobile/ARDAppClient.h",
194 "objc/AppRTCMobile/ARDAppClient.m",
195 "objc/AppRTCMobile/ARDAppEngineClient.h",
196 "objc/AppRTCMobile/ARDAppEngineClient.m",
197 "objc/AppRTCMobile/ARDBitrateTracker.h",
198 "objc/AppRTCMobile/ARDBitrateTracker.m",
sakalc522e752017-04-05 12:17:48 -0700199 "objc/AppRTCMobile/ARDCaptureController.h",
200 "objc/AppRTCMobile/ARDCaptureController.m",
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200201 "objc/AppRTCMobile/ARDJoinResponse+Internal.h",
202 "objc/AppRTCMobile/ARDJoinResponse.h",
203 "objc/AppRTCMobile/ARDJoinResponse.m",
204 "objc/AppRTCMobile/ARDMessageResponse+Internal.h",
205 "objc/AppRTCMobile/ARDMessageResponse.h",
206 "objc/AppRTCMobile/ARDMessageResponse.m",
207 "objc/AppRTCMobile/ARDRoomServerClient.h",
sakalc4adacf2017-03-28 01:22:48 -0700208 "objc/AppRTCMobile/ARDSettingsModel+Private.h",
209 "objc/AppRTCMobile/ARDSettingsModel.h",
210 "objc/AppRTCMobile/ARDSettingsModel.m",
211 "objc/AppRTCMobile/ARDSettingsStore.h",
212 "objc/AppRTCMobile/ARDSettingsStore.m",
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200213 "objc/AppRTCMobile/ARDSignalingChannel.h",
214 "objc/AppRTCMobile/ARDSignalingMessage.h",
215 "objc/AppRTCMobile/ARDSignalingMessage.m",
216 "objc/AppRTCMobile/ARDStatsBuilder.h",
217 "objc/AppRTCMobile/ARDStatsBuilder.m",
kthelgasoncc882af2017-01-13 05:59:46 -0800218 "objc/AppRTCMobile/ARDTURNClient+Internal.h",
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200219 "objc/AppRTCMobile/ARDTURNClient.h",
kthelgasoncc882af2017-01-13 05:59:46 -0800220 "objc/AppRTCMobile/ARDTURNClient.m",
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200221 "objc/AppRTCMobile/ARDWebSocketChannel.h",
222 "objc/AppRTCMobile/ARDWebSocketChannel.m",
223 "objc/AppRTCMobile/RTCIceCandidate+JSON.h",
224 "objc/AppRTCMobile/RTCIceCandidate+JSON.m",
225 "objc/AppRTCMobile/RTCIceServer+JSON.h",
226 "objc/AppRTCMobile/RTCIceServer+JSON.m",
227 "objc/AppRTCMobile/RTCMediaConstraints+JSON.h",
228 "objc/AppRTCMobile/RTCMediaConstraints+JSON.m",
229 "objc/AppRTCMobile/RTCSessionDescription+JSON.h",
230 "objc/AppRTCMobile/RTCSessionDescription+JSON.m",
tkchin2ddfdba2016-08-07 21:37:45 -0700231 ]
ehmaldonadoe9cc6862016-09-05 06:10:18 -0700232 public_configs = [ ":apprtc_signaling_config" ]
tkchin2ddfdba2016-08-07 21:37:45 -0700233 deps = [
234 ":apprtc_common",
235 ":socketrocket",
236 ]
Kári Tristan Helgason946923a2017-06-02 14:05:56 +0200237 if (is_ios) {
238 deps += [ ":AppRTCMobile_ios_frameworks" ]
239 } else {
240 public_deps = [
kthelgason36d658d2017-08-24 05:43:45 -0700241 "../sdk:peerconnection_objc",
Kári Tristan Helgason946923a2017-06-02 14:05:56 +0200242 ]
243 }
tkchin2ddfdba2016-08-07 21:37:45 -0700244 libs = [ "QuartzCore.framework" ]
245 }
246
247 if (is_ios) {
denicija77bfd7c2016-11-15 00:41:26 -0800248 rtc_static_library("AppRTCMobile_lib") {
kjellander1993b1d2017-03-06 00:29:21 -0800249 testonly = true
tkchin2ddfdba2016-08-07 21:37:45 -0700250 sources = [
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200251 "objc/AppRTCMobile/ios/ARDAppDelegate.m",
252 "objc/AppRTCMobile/ios/ARDMainView.h",
253 "objc/AppRTCMobile/ios/ARDMainView.m",
254 "objc/AppRTCMobile/ios/ARDMainViewController.h",
255 "objc/AppRTCMobile/ios/ARDMainViewController.m",
denicijad17d5362016-11-02 02:56:09 -0700256 "objc/AppRTCMobile/ios/ARDSettingsViewController.h",
257 "objc/AppRTCMobile/ios/ARDSettingsViewController.m",
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200258 "objc/AppRTCMobile/ios/ARDStatsView.h",
259 "objc/AppRTCMobile/ios/ARDStatsView.m",
260 "objc/AppRTCMobile/ios/ARDVideoCallView.h",
261 "objc/AppRTCMobile/ios/ARDVideoCallView.m",
262 "objc/AppRTCMobile/ios/ARDVideoCallViewController.h",
263 "objc/AppRTCMobile/ios/ARDVideoCallViewController.m",
Anders Carlsson6bf43d22017-10-16 13:51:43 +0200264 "objc/AppRTCMobile/ios/RTCVideoCodecInfo+HumanReadable.h",
265 "objc/AppRTCMobile/ios/RTCVideoCodecInfo+HumanReadable.m",
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200266 "objc/AppRTCMobile/ios/UIImage+ARDUtilities.h",
267 "objc/AppRTCMobile/ios/UIImage+ARDUtilities.m",
denicija77bfd7c2016-11-15 00:41:26 -0800268 ]
denicija77bfd7c2016-11-15 00:41:26 -0800269
270 deps = [
Kári Tristan Helgason946923a2017-06-02 14:05:56 +0200271 ":AppRTCMobile_ios_frameworks",
denicija77bfd7c2016-11-15 00:41:26 -0800272 ":apprtc_common",
273 ":apprtc_signaling",
274 ]
275 }
276
277 ios_app_bundle("AppRTCMobile") {
kjellander1993b1d2017-03-06 00:29:21 -0800278 testonly = true
denicija77bfd7c2016-11-15 00:41:26 -0800279 sources = [
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200280 "objc/AppRTCMobile/ios/main.m",
tkchin2ddfdba2016-08-07 21:37:45 -0700281 ]
282
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200283 info_plist = "objc/AppRTCMobile/ios/Info.plist"
tkchin2ddfdba2016-08-07 21:37:45 -0700284
denicija77bfd7c2016-11-15 00:41:26 -0800285 configs += [ "..:common_config" ]
tkchin2ddfdba2016-08-07 21:37:45 -0700286 public_configs = [ "..:common_inherited_config" ]
287
288 deps = [
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200289 ":AppRTCMobile_ios_bundle_data",
kthelgasond3adbfb2017-01-26 01:14:04 -0800290 ":AppRTCMobile_ios_frameworks",
denicija77bfd7c2016-11-15 00:41:26 -0800291 ":AppRTCMobile_lib",
tkchin2ddfdba2016-08-07 21:37:45 -0700292 ]
293
294 if (target_cpu == "x86") {
295 deps += [ "//testing/iossim:iossim" ]
296 }
297 }
298
kthelgasond3adbfb2017-01-26 01:14:04 -0800299 bundle_data("AppRTCMobile_ios_frameworks") {
300 public_deps = [
kthelgason36d658d2017-08-24 05:43:45 -0700301 "../sdk:framework_objc+link",
kthelgasond3adbfb2017-01-26 01:14:04 -0800302 ]
303 sources = [
wjywbsbef8a5d2017-10-09 02:32:28 -0400304 "$root_build_dir/WebRTC.framework",
kthelgasond3adbfb2017-01-26 01:14:04 -0800305 ]
306 outputs = [
307 "{{bundle_resources_dir}}/Frameworks/{{source_file_part}}",
308 ]
309 }
310
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200311 bundle_data("AppRTCMobile_ios_bundle_data") {
tkchin2ddfdba2016-08-07 21:37:45 -0700312 sources = [
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200313 "objc/AppRTCMobile/ios/resources/Roboto-Regular.ttf",
314 "objc/AppRTCMobile/ios/resources/iPhone5@2x.png",
315 "objc/AppRTCMobile/ios/resources/iPhone6@2x.png",
316 "objc/AppRTCMobile/ios/resources/iPhone6p@3x.png",
317 "objc/AppRTCMobile/ios/resources/ic_call_end_black_24dp.png",
318 "objc/AppRTCMobile/ios/resources/ic_call_end_black_24dp@2x.png",
319 "objc/AppRTCMobile/ios/resources/ic_clear_black_24dp.png",
320 "objc/AppRTCMobile/ios/resources/ic_clear_black_24dp@2x.png",
denicija6d6762c2016-10-28 04:53:16 -0700321 "objc/AppRTCMobile/ios/resources/ic_settings_black_24dp.png",
322 "objc/AppRTCMobile/ios/resources/ic_settings_black_24dp@2x.png",
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200323 "objc/AppRTCMobile/ios/resources/ic_surround_sound_black_24dp.png",
324 "objc/AppRTCMobile/ios/resources/ic_surround_sound_black_24dp@2x.png",
325 "objc/AppRTCMobile/ios/resources/ic_switch_video_black_24dp.png",
326 "objc/AppRTCMobile/ios/resources/ic_switch_video_black_24dp@2x.png",
327 "objc/AppRTCMobile/ios/resources/mozart.mp3",
anderscb5ed9052017-08-15 04:07:12 -0700328 "objc/Icon-120.png",
329 "objc/Icon-180.png",
tkchin2ddfdba2016-08-07 21:37:45 -0700330 "objc/Icon.png",
331 ]
332 outputs = [
333 "{{bundle_resources_dir}}/{{source_file_part}}",
334 ]
335 }
336 }
337
338 if (is_mac) {
denicija77bfd7c2016-11-15 00:41:26 -0800339 rtc_static_library("AppRTCMobile_lib") {
kjellander1993b1d2017-03-06 00:29:21 -0800340 testonly = true
tkchin2ddfdba2016-08-07 21:37:45 -0700341 sources = [
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200342 "objc/AppRTCMobile/mac/APPRTCAppDelegate.h",
343 "objc/AppRTCMobile/mac/APPRTCAppDelegate.m",
344 "objc/AppRTCMobile/mac/APPRTCViewController.h",
345 "objc/AppRTCMobile/mac/APPRTCViewController.m",
tkchin2ddfdba2016-08-07 21:37:45 -0700346 ]
jianjun.zhuc0247402017-07-11 06:20:45 -0700347 configs += [ "..:common_objc" ]
tkchin2ddfdba2016-08-07 21:37:45 -0700348 deps = [
349 ":apprtc_common",
350 ":apprtc_signaling",
kthelgason36d658d2017-08-24 05:43:45 -0700351 "../sdk:ui_objc",
tkchin2ddfdba2016-08-07 21:37:45 -0700352 ]
353 }
354
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200355 mac_app_bundle("AppRTCMobile") {
kjellander1993b1d2017-03-06 00:29:21 -0800356 testonly = true
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200357 output_name = "AppRTCMobile"
tkchin2ddfdba2016-08-07 21:37:45 -0700358
tkchin2ddfdba2016-08-07 21:37:45 -0700359 sources = [
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200360 "objc/AppRTCMobile/mac/main.m",
tkchin2ddfdba2016-08-07 21:37:45 -0700361 ]
362
363 public_configs = [ "..:common_inherited_config" ]
364
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200365 info_plist = "objc/AppRTCMobile/mac/Info.plist"
tkchin2ddfdba2016-08-07 21:37:45 -0700366
367 libs = [ "AppKit.framework" ]
368
369 deps = [
denicija77bfd7c2016-11-15 00:41:26 -0800370 ":AppRTCMobile_lib",
tkchin2ddfdba2016-08-07 21:37:45 -0700371 ]
372 }
373 }
374
375 config("socketrocket_include_config") {
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200376 include_dirs = [ "objc/AppRTCMobile/third_party/SocketRocket" ]
tkchin2ddfdba2016-08-07 21:37:45 -0700377 }
378
379 config("socketrocket_warning_config") {
380 # GN orders flags on a target before flags from configs. The default config
381 # adds these flags so to cancel them out they need to come from a config and
382 # cannot be on the target directly.
383 cflags = [
384 "-Wno-deprecated-declarations",
385 "-Wno-nonnull",
tkchin2ddfdba2016-08-07 21:37:45 -0700386 "-Wno-semicolon-before-method-body",
kthelgasone47de1a2017-02-24 01:56:01 -0800387 "-Wno-unused-variable",
tkchin2ddfdba2016-08-07 21:37:45 -0700388 ]
389
henrika27d8b612016-09-21 04:13:00 -0700390 cflags_objc = [
391 # Enabled for cflags_objc in build/config/compiler/BUILD.gn.
392 "-Wno-objc-missing-property-synthesis",
henrika27d8b612016-09-21 04:13:00 -0700393 ]
tkchin2ddfdba2016-08-07 21:37:45 -0700394 }
395
kjellanderb62dbbe2016-09-23 00:38:52 -0700396 rtc_static_library("socketrocket") {
kjellander1993b1d2017-03-06 00:29:21 -0800397 testonly = true
tkchin2ddfdba2016-08-07 21:37:45 -0700398 sources = [
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200399 "objc/AppRTCMobile/third_party/SocketRocket/SRWebSocket.h",
400 "objc/AppRTCMobile/third_party/SocketRocket/SRWebSocket.m",
tkchin2ddfdba2016-08-07 21:37:45 -0700401 ]
kthelgasonc0977102017-04-24 00:57:16 -0700402 configs += [ ":socketrocket_warning_config" ]
ehmaldonadoe9cc6862016-09-05 06:10:18 -0700403 public_configs = [ ":socketrocket_include_config" ]
tkchin2ddfdba2016-08-07 21:37:45 -0700404
405 libs = [
406 "CFNetwork.framework",
407 "icucore",
408 ]
409 }
adam.fedorbcc5d872016-11-07 14:53:28 -0800410
411 if (rtc_include_tests) {
kthelgason4065a572017-02-14 04:58:56 -0800412 # TODO(kthelgason): compile xctests on mac when chromium supports it.
413 if (is_ios) {
414 rtc_source_set("apprtcmobile_test_sources") {
kjellander1993b1d2017-03-06 00:29:21 -0800415 testonly = true
kthelgason4065a572017-02-14 04:58:56 -0800416 include_dirs = [
417 "objc/AppRTCMobile",
418 "objc/AppRTCMobile/ios",
419 ]
420 testonly = true
421 sources = [
422 "objc/AppRTCMobile/tests/ARDAppClient_xctest.mm",
kthelgason4065a572017-02-14 04:58:56 -0800423 "objc/AppRTCMobile/tests/ARDSettingsModel_xctest.mm",
424 ]
kjellander1993b1d2017-03-06 00:29:21 -0800425 deps = [
jianjun.zhuc0247402017-07-11 06:20:45 -0700426 "../rtc_base:rtc_base",
kjellander1993b1d2017-03-06 00:29:21 -0800427 ]
kthelgason4065a572017-02-14 04:58:56 -0800428 public_deps = [
429 ":AppRTCMobile_ios_frameworks",
430 ":AppRTCMobile_lib",
431 "//build/config/ios:xctest",
432 "//third_party/ocmock",
433 ]
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" ]
jianjun.zhuc0247402017-07-11 06:20:45 -0700505 deps += [ "../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 += [
jianjun.zhuc0247402017-07-11 06:20:45 -0700525 "../api:libjingle_peerconnection_test_api",
526 "../api:video_frame_api",
Karl Wiberg1b0eae32017-10-17 14:48:54 +0200527 "../api/audio_codecs:builtin_audio_decoder_factory",
528 "../api/audio_codecs:builtin_audio_encoder_factory",
jianjun.zhuc0247402017-07-11 06:20:45 -0700529 "../media:rtc_media",
530 "../modules/video_capture:video_capture_module",
531 "../pc:libjingle_peerconnection",
ehmaldonadof6a861a2017-07-19 10:40:47 -0700532 "../rtc_base:rtc_base",
533 "../rtc_base:rtc_base_approved",
534 "../rtc_base:rtc_json",
jianjun.zhuc0247402017-07-11 06:20:45 -0700535 "../system_wrappers:field_trial_default",
536 "../system_wrappers:metrics_default",
kjellander1993b1d2017-03-06 00:29:21 -0800537 "//third_party/libyuv",
kjellander1993b1d2017-03-06 00:29:21 -0800538 ]
kthelgason0727f152016-08-08 09:03:23 -0700539 }
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 = [
jianjun.zhuc0247402017-07-11 06:20:45 -0700553 "..:webrtc_common",
ehmaldonadof6a861a2017-07-19 10:40:47 -0700554 "../rtc_base:rtc_base_approved",
jianjun.zhuc0247402017-07-11 06:20:45 -0700555 "../rtc_tools:command_line_parser",
kthelgason0727f152016-08-08 09:03:23 -0700556 ]
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 = [
jianjun.zhuc0247402017-07-11 06:20:45 -0700568 "../p2p:rtc_p2p",
569 "../pc:rtc_pc",
ehmaldonadof6a861a2017-07-19 10:40:47 -0700570 "../rtc_base:rtc_base",
571 "../rtc_base:rtc_base_approved",
jianjun.zhuc0247402017-07-11 06:20:45 -0700572 "../system_wrappers:field_trial_default",
573 "../system_wrappers:metrics_default",
kthelgason0727f152016-08-08 09:03:23 -0700574 ]
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 = [
jianjun.zhuc0247402017-07-11 06:20:45 -0700586 "../p2p:rtc_p2p",
587 "../pc:rtc_pc",
ehmaldonadof6a861a2017-07-19 10:40:47 -0700588 "../rtc_base:rtc_base",
589 "../rtc_base:rtc_base_approved",
jianjun.zhuc0247402017-07-11 06:20:45 -0700590 "../system_wrappers:field_trial_default",
591 "../system_wrappers:metrics_default",
kthelgason0727f152016-08-08 09:03:23 -0700592 ]
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 = [
jianjun.zhuc0247402017-07-11 06:20:45 -0700604 "../p2p:rtc_p2p",
605 "../pc:rtc_pc",
ehmaldonadof6a861a2017-07-19 10:40:47 -0700606 "../rtc_base:rtc_base",
607 "../rtc_base:rtc_base_approved",
jianjun.zhuc0247402017-07-11 06:20:45 -0700608 "../system_wrappers:field_trial_default",
609 "../system_wrappers:metrics_default",
kthelgason0727f152016-08-08 09:03:23 -0700610 ]
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
qiangchen42f96d52017-08-08 17:08:03 -0700618if (is_win || is_android) {
gyzhouad7cad82017-05-11 16:10:03 -0700619 rtc_shared_library("webrtc_unity_plugin") {
620 testonly = true
621 sources = [
622 "unityplugin/simple_peer_connection.cc",
623 "unityplugin/simple_peer_connection.h",
624 "unityplugin/unity_plugin_apis.cc",
625 "unityplugin/unity_plugin_apis.h",
gyzhoub38f3862017-07-25 16:04:31 -0700626 "unityplugin/video_observer.cc",
627 "unityplugin/video_observer.h",
gyzhouad7cad82017-05-11 16:10:03 -0700628 ]
qiangchen42f96d52017-08-08 17:08:03 -0700629
630 if (is_android) {
631 sources += [
632 "unityplugin/classreferenceholder.cc",
633 "unityplugin/classreferenceholder.h",
634 "unityplugin/jni_onload.cc",
635 ]
636 }
637
gyzhouad7cad82017-05-11 16:10:03 -0700638 if (!build_with_chromium && is_clang) {
639 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
640 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
641 }
qiangchen42f96d52017-08-08 17:08:03 -0700642 if (is_win) {
643 cflags = [ "/wd4245" ]
644 configs += [
645 "//build/config/win:windowed",
646 ":peerconnection_client_warnings_config",
647 ]
648 }
gyzhouad7cad82017-05-11 16:10:03 -0700649 deps = [
jianjun.zhuc0247402017-07-11 06:20:45 -0700650 "../api:libjingle_peerconnection_test_api",
651 "../api:video_frame_api",
jianjun.zhuc0247402017-07-11 06:20:45 -0700652 "../media:rtc_media",
653 "../media:rtc_media_base",
654 "../modules/video_capture:video_capture_module",
655 "../pc:libjingle_peerconnection",
qiangchen42f96d52017-08-08 17:08:03 -0700656 "../rtc_base:rtc_base",
jianjun.zhuc0247402017-07-11 06:20:45 -0700657 "../system_wrappers:field_trial_default",
658 "../system_wrappers:metrics_default",
gyzhouad7cad82017-05-11 16:10:03 -0700659 ]
qiangchen42f96d52017-08-08 17:08:03 -0700660 if (is_android) {
661 deps += [ "../sdk/android:libjingle_peerconnection_jni" ]
662 }
663 }
664}
665
666if (is_android) {
Sami Kalliomäki19b76142017-10-30 13:54:21 +0100667 rtc_android_library("webrtc_unity_java") {
qiangchen42f96d52017-08-08 17:08:03 -0700668 java_files = [ "unityplugin/java/src/org/webrtc/UnityUtility.java" ]
669 deps = [
670 "../rtc_base:base_java",
671 "../sdk/android:libjingle_peerconnection_java",
672 ]
673 }
674
675 dist_jar("libwebrtc_unity") {
676 _target_dir_name = get_label_info(":$target_name", "dir")
677 output = "${root_out_dir}/lib.java${_target_dir_name}/${target_name}.jar"
678 direct_deps_only = true
679 use_interface_jars = false
Oleh Prypin86021d92017-09-24 22:29:06 +0200680 requires_android = true
qiangchen42f96d52017-08-08 17:08:03 -0700681 deps = [
682 ":webrtc_unity_java",
683 "../modules/audio_device:audio_device_java",
684 "../rtc_base:base_java",
685 "../sdk/android:libjingle_peerconnection_java",
686 "../sdk/android:libjingle_peerconnection_metrics_default_java",
687 ]
gyzhouad7cad82017-05-11 16:10:03 -0700688 }
689}
690
charujainaca3a242016-11-01 03:09:15 -0700691if (!build_with_chromium) {
692 # Doesn't build within Chrome on Win.
693 rtc_executable("stun_prober") {
kjellander1993b1d2017-03-06 00:29:21 -0800694 testonly = true
charujainaca3a242016-11-01 03:09:15 -0700695 sources = [
696 "stunprober/main.cc",
697 ]
698
699 if (!build_with_chromium && is_clang) {
700 # Suppress warnings from Chrome's Clang plugins.
701 # See http://code.google.com/p/webrtc/issues/detail?id=163 for details.
702 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
703 }
704
705 deps = [
706 "../p2p:libstunprober",
707 "../p2p:rtc_p2p",
ehmaldonadof6a861a2017-07-19 10:40:47 -0700708 "../rtc_base:rtc_base",
709 "../rtc_base:rtc_base_approved",
charujainaca3a242016-11-01 03:09:15 -0700710 "../system_wrappers:field_trial_default",
711 ]
712 }
713}