blob: ccdc21e23262cc9e634b426d81b303d7905aa4b6 [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",
Henrik Kjellanderc0362762017-06-29 08:03:04 +020061 "//webrtc/rtc_base:base_java",
Sami Kalliomaki9c0c75b2016-06-29 14:55:00 +020062 ]
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/examples/androidapp/third_party/autobanh:autobanh_java",
mbonadeib55bd972017-01-23 01:25:53 -080098 "//webrtc/modules/audio_device:audio_device_java",
Henrik Kjellanderc0362762017-06-29 08:03:04 +020099 "//webrtc/rtc_base:base_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/system_wrappers:field_trial_default",
167 "//webrtc/system_wrappers:metrics_default",
tkchin2ddfdba2016-08-07 21:37:45 -0700168 ]
Kári Tristan Helgason946923a2017-06-02 14:05:56 +0200169 if (is_ios) {
170 deps += [ ":AppRTCMobile_ios_frameworks" ]
171 } else {
172 deps += [ "//webrtc/sdk:objc_common" ]
173 }
tkchin2ddfdba2016-08-07 21:37:45 -0700174 }
175
176 config("apprtc_signaling_config") {
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200177 include_dirs = [ "objc/AppRTCMobile" ]
tkchin2ddfdba2016-08-07 21:37:45 -0700178
179 # GN orders flags on a target before flags from configs. The default config
180 # adds these flags so to cancel them out they need to come from a config and
181 # cannot be on the target directly.
182 cflags = [
183 "-Wno-sign-compare",
184 "-Wno-unused-variable",
185 ]
tkchin2ddfdba2016-08-07 21:37:45 -0700186 }
187
kjellanderb62dbbe2016-09-23 00:38:52 -0700188 rtc_static_library("apprtc_signaling") {
kjellander1993b1d2017-03-06 00:29:21 -0800189 testonly = true
tkchin2ddfdba2016-08-07 21:37:45 -0700190 sources = [
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200191 "objc/AppRTCMobile/ARDAppClient+Internal.h",
192 "objc/AppRTCMobile/ARDAppClient.h",
193 "objc/AppRTCMobile/ARDAppClient.m",
194 "objc/AppRTCMobile/ARDAppEngineClient.h",
195 "objc/AppRTCMobile/ARDAppEngineClient.m",
196 "objc/AppRTCMobile/ARDBitrateTracker.h",
197 "objc/AppRTCMobile/ARDBitrateTracker.m",
sakalc522e752017-04-05 12:17:48 -0700198 "objc/AppRTCMobile/ARDCaptureController.h",
199 "objc/AppRTCMobile/ARDCaptureController.m",
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200200 "objc/AppRTCMobile/ARDJoinResponse+Internal.h",
201 "objc/AppRTCMobile/ARDJoinResponse.h",
202 "objc/AppRTCMobile/ARDJoinResponse.m",
203 "objc/AppRTCMobile/ARDMessageResponse+Internal.h",
204 "objc/AppRTCMobile/ARDMessageResponse.h",
205 "objc/AppRTCMobile/ARDMessageResponse.m",
206 "objc/AppRTCMobile/ARDRoomServerClient.h",
207 "objc/AppRTCMobile/ARDSDPUtils.h",
208 "objc/AppRTCMobile/ARDSDPUtils.m",
sakalc4adacf2017-03-28 01:22:48 -0700209 "objc/AppRTCMobile/ARDSettingsModel+Private.h",
210 "objc/AppRTCMobile/ARDSettingsModel.h",
211 "objc/AppRTCMobile/ARDSettingsModel.m",
212 "objc/AppRTCMobile/ARDSettingsStore.h",
213 "objc/AppRTCMobile/ARDSettingsStore.m",
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200214 "objc/AppRTCMobile/ARDSignalingChannel.h",
215 "objc/AppRTCMobile/ARDSignalingMessage.h",
216 "objc/AppRTCMobile/ARDSignalingMessage.m",
217 "objc/AppRTCMobile/ARDStatsBuilder.h",
218 "objc/AppRTCMobile/ARDStatsBuilder.m",
kthelgasoncc882af2017-01-13 05:59:46 -0800219 "objc/AppRTCMobile/ARDTURNClient+Internal.h",
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200220 "objc/AppRTCMobile/ARDTURNClient.h",
kthelgasoncc882af2017-01-13 05:59:46 -0800221 "objc/AppRTCMobile/ARDTURNClient.m",
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200222 "objc/AppRTCMobile/ARDWebSocketChannel.h",
223 "objc/AppRTCMobile/ARDWebSocketChannel.m",
224 "objc/AppRTCMobile/RTCIceCandidate+JSON.h",
225 "objc/AppRTCMobile/RTCIceCandidate+JSON.m",
226 "objc/AppRTCMobile/RTCIceServer+JSON.h",
227 "objc/AppRTCMobile/RTCIceServer+JSON.m",
228 "objc/AppRTCMobile/RTCMediaConstraints+JSON.h",
229 "objc/AppRTCMobile/RTCMediaConstraints+JSON.m",
230 "objc/AppRTCMobile/RTCSessionDescription+JSON.h",
231 "objc/AppRTCMobile/RTCSessionDescription+JSON.m",
tkchin2ddfdba2016-08-07 21:37:45 -0700232 ]
ehmaldonadoe9cc6862016-09-05 06:10:18 -0700233 public_configs = [ ":apprtc_signaling_config" ]
tkchin2ddfdba2016-08-07 21:37:45 -0700234 deps = [
235 ":apprtc_common",
236 ":socketrocket",
237 ]
Kári Tristan Helgason946923a2017-06-02 14:05:56 +0200238 if (is_ios) {
239 deps += [ ":AppRTCMobile_ios_frameworks" ]
240 } else {
241 public_deps = [
242 "//webrtc/sdk:objc_peerconnection",
243 ]
244 }
tkchin2ddfdba2016-08-07 21:37:45 -0700245 libs = [ "QuartzCore.framework" ]
246 }
247
248 if (is_ios) {
denicija77bfd7c2016-11-15 00:41:26 -0800249 rtc_static_library("AppRTCMobile_lib") {
kjellander1993b1d2017-03-06 00:29:21 -0800250 testonly = true
tkchin2ddfdba2016-08-07 21:37:45 -0700251 sources = [
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200252 "objc/AppRTCMobile/ios/ARDAppDelegate.m",
253 "objc/AppRTCMobile/ios/ARDMainView.h",
254 "objc/AppRTCMobile/ios/ARDMainView.m",
255 "objc/AppRTCMobile/ios/ARDMainViewController.h",
256 "objc/AppRTCMobile/ios/ARDMainViewController.m",
denicijad17d5362016-11-02 02:56:09 -0700257 "objc/AppRTCMobile/ios/ARDSettingsViewController.h",
258 "objc/AppRTCMobile/ios/ARDSettingsViewController.m",
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200259 "objc/AppRTCMobile/ios/ARDStatsView.h",
260 "objc/AppRTCMobile/ios/ARDStatsView.m",
261 "objc/AppRTCMobile/ios/ARDVideoCallView.h",
262 "objc/AppRTCMobile/ios/ARDVideoCallView.m",
263 "objc/AppRTCMobile/ios/ARDVideoCallViewController.h",
264 "objc/AppRTCMobile/ios/ARDVideoCallViewController.m",
265 "objc/AppRTCMobile/ios/AppRTCMobile-Prefix.pch",
266 "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 = [
kthelgason2f088792017-05-30 01:48:47 -0700301 "//webrtc/sdk:objc_framework+link",
kthelgasond3adbfb2017-01-26 01:14:04 -0800302 ]
303 sources = [
304 "$root_out_dir/WebRTC.framework",
305 ]
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",
tkchin2ddfdba2016-08-07 21:37:45 -0700328 "objc/Icon.png",
329 ]
330 outputs = [
331 "{{bundle_resources_dir}}/{{source_file_part}}",
332 ]
333 }
334 }
335
336 if (is_mac) {
denicija77bfd7c2016-11-15 00:41:26 -0800337 rtc_static_library("AppRTCMobile_lib") {
kjellander1993b1d2017-03-06 00:29:21 -0800338 testonly = true
tkchin2ddfdba2016-08-07 21:37:45 -0700339 sources = [
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200340 "objc/AppRTCMobile/mac/APPRTCAppDelegate.h",
341 "objc/AppRTCMobile/mac/APPRTCAppDelegate.m",
342 "objc/AppRTCMobile/mac/APPRTCViewController.h",
343 "objc/AppRTCMobile/mac/APPRTCViewController.m",
tkchin2ddfdba2016-08-07 21:37:45 -0700344 ]
kthelgasonc0977102017-04-24 00:57:16 -0700345 configs += [ "//webrtc:common_objc" ]
tkchin2ddfdba2016-08-07 21:37:45 -0700346 deps = [
347 ":apprtc_common",
348 ":apprtc_signaling",
kthelgason2f088792017-05-30 01:48:47 -0700349 "//webrtc/sdk:objc_ui",
tkchin2ddfdba2016-08-07 21:37:45 -0700350 ]
351 }
352
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200353 mac_app_bundle("AppRTCMobile") {
kjellander1993b1d2017-03-06 00:29:21 -0800354 testonly = true
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200355 output_name = "AppRTCMobile"
tkchin2ddfdba2016-08-07 21:37:45 -0700356
tkchin2ddfdba2016-08-07 21:37:45 -0700357 sources = [
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200358 "objc/AppRTCMobile/mac/main.m",
tkchin2ddfdba2016-08-07 21:37:45 -0700359 ]
360
361 public_configs = [ "..:common_inherited_config" ]
362
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200363 info_plist = "objc/AppRTCMobile/mac/Info.plist"
tkchin2ddfdba2016-08-07 21:37:45 -0700364
365 libs = [ "AppKit.framework" ]
366
367 deps = [
denicija77bfd7c2016-11-15 00:41:26 -0800368 ":AppRTCMobile_lib",
tkchin2ddfdba2016-08-07 21:37:45 -0700369 ]
370 }
371 }
372
373 config("socketrocket_include_config") {
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200374 include_dirs = [ "objc/AppRTCMobile/third_party/SocketRocket" ]
tkchin2ddfdba2016-08-07 21:37:45 -0700375 }
376
377 config("socketrocket_warning_config") {
378 # GN orders flags on a target before flags from configs. The default config
379 # adds these flags so to cancel them out they need to come from a config and
380 # cannot be on the target directly.
381 cflags = [
382 "-Wno-deprecated-declarations",
383 "-Wno-nonnull",
tkchin2ddfdba2016-08-07 21:37:45 -0700384 "-Wno-semicolon-before-method-body",
kthelgasone47de1a2017-02-24 01:56:01 -0800385 "-Wno-unused-variable",
tkchin2ddfdba2016-08-07 21:37:45 -0700386 ]
387
henrika27d8b612016-09-21 04:13:00 -0700388 cflags_objc = [
389 # Enabled for cflags_objc in build/config/compiler/BUILD.gn.
390 "-Wno-objc-missing-property-synthesis",
henrika27d8b612016-09-21 04:13:00 -0700391 ]
tkchin2ddfdba2016-08-07 21:37:45 -0700392 }
393
kjellanderb62dbbe2016-09-23 00:38:52 -0700394 rtc_static_library("socketrocket") {
kjellander1993b1d2017-03-06 00:29:21 -0800395 testonly = true
tkchin2ddfdba2016-08-07 21:37:45 -0700396 sources = [
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200397 "objc/AppRTCMobile/third_party/SocketRocket/SRWebSocket.h",
398 "objc/AppRTCMobile/third_party/SocketRocket/SRWebSocket.m",
tkchin2ddfdba2016-08-07 21:37:45 -0700399 ]
kthelgasonc0977102017-04-24 00:57:16 -0700400 configs += [ ":socketrocket_warning_config" ]
ehmaldonadoe9cc6862016-09-05 06:10:18 -0700401 public_configs = [ ":socketrocket_include_config" ]
tkchin2ddfdba2016-08-07 21:37:45 -0700402
403 libs = [
404 "CFNetwork.framework",
405 "icucore",
406 ]
407 }
adam.fedorbcc5d872016-11-07 14:53:28 -0800408
409 if (rtc_include_tests) {
kthelgason4065a572017-02-14 04:58:56 -0800410 # TODO(kthelgason): compile xctests on mac when chromium supports it.
411 if (is_ios) {
412 rtc_source_set("apprtcmobile_test_sources") {
kjellander1993b1d2017-03-06 00:29:21 -0800413 testonly = true
kthelgason4065a572017-02-14 04:58:56 -0800414 include_dirs = [
415 "objc/AppRTCMobile",
416 "objc/AppRTCMobile/ios",
417 ]
418 testonly = true
419 sources = [
420 "objc/AppRTCMobile/tests/ARDAppClient_xctest.mm",
421 "objc/AppRTCMobile/tests/ARDSDPUtils_xctest.mm",
422 "objc/AppRTCMobile/tests/ARDSettingsModel_xctest.mm",
423 ]
kjellander1993b1d2017-03-06 00:29:21 -0800424 deps = [
425 "//webrtc/base:rtc_base",
426 ]
kthelgason4065a572017-02-14 04:58:56 -0800427 public_deps = [
428 ":AppRTCMobile_ios_frameworks",
429 ":AppRTCMobile_lib",
430 "//build/config/ios:xctest",
431 "//third_party/ocmock",
432 ]
adam.fedorbcc5d872016-11-07 14:53:28 -0800433 }
434
kthelgason4065a572017-02-14 04:58:56 -0800435 rtc_ios_xctest_test("apprtcmobile_tests") {
436 info_plist = "objc/AppRTCMobile/ios/Info.plist"
437 sources = [
438 "objc/AppRTCMobile/ios/main.m",
439 ]
440 deps = [
441 ":apprtcmobile_test_sources",
442 ]
443 ldflags = [ "-all_load" ]
444 }
adam.fedorbcc5d872016-11-07 14:53:28 -0800445 }
446 }
tkchin2ddfdba2016-08-07 21:37:45 -0700447}
kthelgason0727f152016-08-08 09:03:23 -0700448
449if (is_linux || is_win) {
ehmaldonadod02fe4b2016-08-26 13:31:24 -0700450 config("peerconnection_client_warnings_config") {
kjellander4a9abad2016-09-18 08:12:29 -0700451 cflags = []
ehmaldonadod02fe4b2016-08-26 13:31:24 -0700452 if (is_win && is_clang) {
kjellander4a9abad2016-09-18 08:12:29 -0700453 cflags += [
ehmaldonadod02fe4b2016-08-26 13:31:24 -0700454 # Disable warnings failing when compiling with Clang on Windows.
455 # https://bugs.chromium.org/p/webrtc/issues/detail?id=5366
456 "-Wno-format",
457
458 # See https://bugs.chromium.org/p/webrtc/issues/detail?id=6271
459 # for -Wno-reorder and -Wno-sign-compare
460 "-Wno-reorder",
461 "-Wno-sign-compare",
462 ]
463 }
kjellanderd4626e52016-09-07 02:33:01 -0700464 if (is_linux && target_cpu == "x86") {
kjellander4a9abad2016-09-18 08:12:29 -0700465 cflags += [
kjellanderd4626e52016-09-07 02:33:01 -0700466 # Needed to compile on Linux 32-bit.
467 "-Wno-sentinel",
468 ]
469 }
kjellander4a9abad2016-09-18 08:12:29 -0700470
471 if (is_clang) {
472 # TODO(ehmaldonado): Make peerconnection_client compile with the standard
473 # set of warnings.
474 # See https://bugs.chromium.org/p/webrtc/issues/detail?id=6306
475 cflags += [ "-Wno-inconsistent-missing-override" ]
476 }
ehmaldonadod02fe4b2016-08-26 13:31:24 -0700477 }
478
ehmaldonado38a21322016-09-02 04:10:34 -0700479 rtc_executable("peerconnection_client") {
kjellander1993b1d2017-03-06 00:29:21 -0800480 testonly = true
kthelgason0727f152016-08-08 09:03:23 -0700481 sources = [
482 "peerconnection/client/conductor.cc",
483 "peerconnection/client/conductor.h",
484 "peerconnection/client/defaults.cc",
485 "peerconnection/client/defaults.h",
486 "peerconnection/client/peer_connection_client.cc",
487 "peerconnection/client/peer_connection_client.h",
488 ]
ehmaldonado7a2ce0b2016-09-05 01:35:44 -0700489
kjellandere40a7ee2016-10-16 23:56:12 -0700490 if (!build_with_chromium && is_clang) {
491 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
ehmaldonado38a21322016-09-02 04:10:34 -0700492 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
kthelgason0727f152016-08-08 09:03:23 -0700493 }
kjellander1993b1d2017-03-06 00:29:21 -0800494 deps = []
kthelgason0727f152016-08-08 09:03:23 -0700495 if (is_win) {
496 sources += [
497 "peerconnection/client/flagdefs.h",
498 "peerconnection/client/main.cc",
499 "peerconnection/client/main_wnd.cc",
500 "peerconnection/client/main_wnd.h",
501 ]
502 cflags = [ "/wd4245" ]
503 configs += [ "//build/config/win:windowed" ]
kjellander1993b1d2017-03-06 00:29:21 -0800504 deps += [ "//webrtc/media:rtc_media_base" ]
kthelgason0727f152016-08-08 09:03:23 -0700505 }
506 if (is_linux) {
507 sources += [
508 "peerconnection/client/linux/main.cc",
509 "peerconnection/client/linux/main_wnd.cc",
510 "peerconnection/client/linux/main_wnd.h",
511 ]
Henrik Kjellanderefbde2c2017-03-27 08:28:27 +0200512 cflags = [ "-Wno-deprecated-declarations" ]
kthelgason0727f152016-08-08 09:03:23 -0700513 libs = [
514 "X11",
515 "Xcomposite",
516 "Xext",
517 "Xrender",
518 ]
thomasandersonef16e992016-12-13 02:57:43 -0800519 deps += [ "//build/config/linux/gtk" ]
kthelgason0727f152016-08-08 09:03:23 -0700520 }
ehmaldonadod02fe4b2016-08-26 13:31:24 -0700521 configs += [ ":peerconnection_client_warnings_config" ]
kjellander1993b1d2017-03-06 00:29:21 -0800522
523 deps += [
524 "//third_party/libyuv",
525 "//webrtc/api:libjingle_peerconnection_test_api",
526 "//webrtc/api:video_frame_api",
527 "//webrtc/base:rtc_base",
528 "//webrtc/base:rtc_base_approved",
zhihuang44d305a2017-04-24 12:05:06 -0700529 "//webrtc/base:rtc_json",
kjellander1993b1d2017-03-06 00:29:21 -0800530 "//webrtc/media:rtc_media",
531 "//webrtc/modules/video_capture:video_capture_module",
532 "//webrtc/pc:libjingle_peerconnection",
533 "//webrtc/system_wrappers:field_trial_default",
534 "//webrtc/system_wrappers:metrics_default",
535 ]
kthelgason0727f152016-08-08 09:03:23 -0700536 }
kjellanderd4626e52016-09-07 02:33:01 -0700537
ehmaldonado38a21322016-09-02 04:10:34 -0700538 rtc_executable("peerconnection_server") {
kjellander1993b1d2017-03-06 00:29:21 -0800539 testonly = true
kthelgason0727f152016-08-08 09:03:23 -0700540 sources = [
541 "peerconnection/server/data_socket.cc",
542 "peerconnection/server/data_socket.h",
543 "peerconnection/server/main.cc",
544 "peerconnection/server/peer_channel.cc",
545 "peerconnection/server/peer_channel.h",
546 "peerconnection/server/utils.cc",
547 "peerconnection/server/utils.h",
548 ]
549 deps = [
550 "//webrtc:webrtc_common",
551 "//webrtc/base:rtc_base_approved",
552 "//webrtc/tools:command_line_parser",
553 ]
kjellandere40a7ee2016-10-16 23:56:12 -0700554 if (!build_with_chromium && is_clang) {
555 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
ehmaldonado38a21322016-09-02 04:10:34 -0700556 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
kthelgason0727f152016-08-08 09:03:23 -0700557 }
558 }
ehmaldonado38a21322016-09-02 04:10:34 -0700559 rtc_executable("relayserver") {
kjellander1993b1d2017-03-06 00:29:21 -0800560 testonly = true
kthelgason0727f152016-08-08 09:03:23 -0700561 sources = [
562 "relayserver/relayserver_main.cc",
563 ]
564 deps = [
kjellander1993b1d2017-03-06 00:29:21 -0800565 "../base:rtc_base",
kthelgason0727f152016-08-08 09:03:23 -0700566 "//webrtc/base:rtc_base_approved",
kjellander1993b1d2017-03-06 00:29:21 -0800567 "//webrtc/p2p:rtc_p2p",
kthelgason0727f152016-08-08 09:03:23 -0700568 "//webrtc/pc:rtc_pc",
569 "//webrtc/system_wrappers:field_trial_default",
570 "//webrtc/system_wrappers:metrics_default",
571 ]
kjellandere40a7ee2016-10-16 23:56:12 -0700572 if (!build_with_chromium && is_clang) {
573 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
ehmaldonado38a21322016-09-02 04:10:34 -0700574 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
kthelgason0727f152016-08-08 09:03:23 -0700575 }
576 }
ehmaldonado38a21322016-09-02 04:10:34 -0700577 rtc_executable("turnserver") {
kjellander1993b1d2017-03-06 00:29:21 -0800578 testonly = true
kthelgason0727f152016-08-08 09:03:23 -0700579 sources = [
580 "turnserver/turnserver_main.cc",
581 ]
582 deps = [
kjellander1993b1d2017-03-06 00:29:21 -0800583 "../base:rtc_base",
kthelgason0727f152016-08-08 09:03:23 -0700584 "//webrtc/base:rtc_base_approved",
kjellander1993b1d2017-03-06 00:29:21 -0800585 "//webrtc/p2p:rtc_p2p",
kthelgason0727f152016-08-08 09:03:23 -0700586 "//webrtc/pc:rtc_pc",
587 "//webrtc/system_wrappers:field_trial_default",
588 "//webrtc/system_wrappers:metrics_default",
589 ]
kjellandere40a7ee2016-10-16 23:56:12 -0700590 if (!build_with_chromium && is_clang) {
591 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
ehmaldonado38a21322016-09-02 04:10:34 -0700592 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
kthelgason0727f152016-08-08 09:03:23 -0700593 }
594 }
ehmaldonado38a21322016-09-02 04:10:34 -0700595 rtc_executable("stunserver") {
kjellander1993b1d2017-03-06 00:29:21 -0800596 testonly = true
kthelgason0727f152016-08-08 09:03:23 -0700597 sources = [
598 "stunserver/stunserver_main.cc",
599 ]
600 deps = [
kjellander1993b1d2017-03-06 00:29:21 -0800601 "../base:rtc_base",
kthelgason0727f152016-08-08 09:03:23 -0700602 "//webrtc/base:rtc_base_approved",
kjellander1993b1d2017-03-06 00:29:21 -0800603 "//webrtc/p2p:rtc_p2p",
kthelgason0727f152016-08-08 09:03:23 -0700604 "//webrtc/pc:rtc_pc",
605 "//webrtc/system_wrappers:field_trial_default",
606 "//webrtc/system_wrappers:metrics_default",
607 ]
kjellandere40a7ee2016-10-16 23:56:12 -0700608 if (!build_with_chromium && is_clang) {
609 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
ehmaldonado38a21322016-09-02 04:10:34 -0700610 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
kthelgason0727f152016-08-08 09:03:23 -0700611 }
612 }
613}
charujainaca3a242016-11-01 03:09:15 -0700614
gyzhouad7cad82017-05-11 16:10:03 -0700615if (is_win) {
616 rtc_shared_library("webrtc_unity_plugin") {
617 testonly = true
618 sources = [
619 "unityplugin/simple_peer_connection.cc",
620 "unityplugin/simple_peer_connection.h",
621 "unityplugin/unity_plugin_apis.cc",
622 "unityplugin/unity_plugin_apis.h",
623 ]
624 if (!build_with_chromium && is_clang) {
625 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
626 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
627 }
628 cflags = [ "/wd4245" ]
629 configs += [
630 "//build/config/win:windowed",
631 ":peerconnection_client_warnings_config",
632 ]
633 deps = [
634 "//webrtc/api:libjingle_peerconnection_test_api",
635 "//webrtc/api:video_frame_api",
636 "//webrtc/base:rtc_base",
637 "//webrtc/base:rtc_base_approved",
638 "//webrtc/base:rtc_json",
639 "//webrtc/media:rtc_media",
640 "//webrtc/media:rtc_media_base",
641 "//webrtc/modules/video_capture:video_capture_module",
642 "//webrtc/pc:libjingle_peerconnection",
643 "//webrtc/system_wrappers:field_trial_default",
644 "//webrtc/system_wrappers:metrics_default",
645 ]
646 }
647}
648
charujainaca3a242016-11-01 03:09:15 -0700649if (!build_with_chromium) {
650 # Doesn't build within Chrome on Win.
651 rtc_executable("stun_prober") {
kjellander1993b1d2017-03-06 00:29:21 -0800652 testonly = true
charujainaca3a242016-11-01 03:09:15 -0700653 sources = [
654 "stunprober/main.cc",
655 ]
656
657 if (!build_with_chromium && is_clang) {
658 # Suppress warnings from Chrome's Clang plugins.
659 # See http://code.google.com/p/webrtc/issues/detail?id=163 for details.
660 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
661 }
662
663 deps = [
kjellander1993b1d2017-03-06 00:29:21 -0800664 "../base:rtc_base",
665 "../base:rtc_base_approved",
charujainaca3a242016-11-01 03:09:15 -0700666 "../p2p:libstunprober",
667 "../p2p:rtc_p2p",
668 "../system_wrappers:field_trial_default",
669 ]
670 }
671}