blob: e6138f10e69080c1dc67a33f593ffe0cf8500713 [file] [log] [blame]
Sami Kalliomaki9c0c75b2016-06-29 14:55:00 +02001# Copyright (c) 2016 The WebRTC project authors. All Rights Reserved.
2#
3# Use of this source code is governed by a BSD-style license
4# that can be found in the LICENSE file in the root of the source
5# tree. An additional intellectual property rights grant can be found
6# in the file PATENTS. All contributing project authors may
7# be found in the AUTHORS file in the root of the source tree.
8
mbonadei9aa3f0a2017-01-24 06:58:22 -08009import("../webrtc.gni")
Sami Kalliomaki9c0c75b2016-06-29 14:55:00 +020010if (is_android) {
11 import("//build/config/android/config.gni")
12 import("//build/config/android/rules.gni")
tkchin2ddfdba2016-08-07 21:37:45 -070013} else if (is_mac) {
14 import("//build/config/mac/rules.gni")
15} else if (is_ios) {
16 import("//build/config/ios/rules.gni")
Sami Kalliomaki9c0c75b2016-06-29 14:55:00 +020017}
18
19group("examples") {
kjellander6ceab082016-10-28 05:44:03 -070020 # This target shall build all targets in examples.
21 testonly = true
kjellander705ecc52016-09-15 00:53:26 -070022 public_deps = []
Sami Kalliomaki9c0c75b2016-06-29 14:55:00 +020023
tkchin2ddfdba2016-08-07 21:37:45 -070024 if (is_android) {
kjellander6ceab082016-10-28 05:44:03 -070025 public_deps += [
26 ":AppRTCMobile",
27 ":AppRTCMobileTest",
mandermoa6069e82017-01-16 02:23:09 -080028 ":AppRTCMobileTestStubbedVideoIO",
kjellander6ceab082016-10-28 05:44:03 -070029 ]
30 }
31
charujainaca3a242016-11-01 03:09:15 -070032 if (!build_with_chromium) {
33 public_deps += [ ":stun_prober" ]
34 }
35
kjellander6ceab082016-10-28 05:44:03 -070036 if (is_ios || (is_mac && target_cpu != "x86")) {
Magnus Jedvertc1815cf2016-09-27 10:10:41 +020037 public_deps += [ ":AppRTCMobile" ]
Sami Kalliomaki9c0c75b2016-06-29 14:55:00 +020038 }
kjellander6ceab082016-10-28 05:44:03 -070039
40 if (is_linux || is_win) {
kjellander705ecc52016-09-15 00:53:26 -070041 public_deps += [
kthelgason0727f152016-08-08 09:03:23 -070042 ":peerconnection_client",
43 ":peerconnection_server",
44 ":relayserver",
45 ":stunserver",
46 ":turnserver",
47 ]
48 }
Sami Kalliomaki9c0c75b2016-06-29 14:55:00 +020049}
50
tkchin2ddfdba2016-08-07 21:37:45 -070051if (is_android) {
Magnus Jedvertc1815cf2016-09-27 10:10:41 +020052 android_apk("AppRTCMobile") {
kjellander1993b1d2017-03-06 00:29:21 -080053 testonly = true
Magnus Jedvertc1815cf2016-09-27 10:10:41 +020054 apk_name = "AppRTCMobile"
Sami Kalliomaki9c0c75b2016-06-29 14:55:00 +020055 android_manifest = "androidapp/AndroidManifest.xml"
56
57 deps = [
Magnus Jedvertc1815cf2016-09-27 10:10:41 +020058 ":AppRTCMobile_javalib",
59 ":AppRTCMobile_resources",
Sami Kalliomaki9c0c75b2016-06-29 14:55:00 +020060 "//base:base_java",
61 "//webrtc/base:base_java",
62 ]
63
magjed768c6482016-12-06 04:29:37 -080064 shared_libraries = [ "//webrtc/sdk/android:libjingle_peerconnection_so" ]
Sami Kalliomaki9c0c75b2016-06-29 14:55:00 +020065 }
66
Magnus Jedvertc1815cf2016-09-27 10:10:41 +020067 android_library("AppRTCMobile_javalib") {
kjellander1993b1d2017-03-06 00:29:21 -080068 testonly = true
sakal07a050f2017-02-13 05:58:27 -080069 android_manifest = "androidapp/AndroidManifest.xml"
70
Sami Kalliomaki9c0c75b2016-06-29 14:55:00 +020071 java_files = [
72 "androidapp/src/org/appspot/apprtc/AppRTCAudioManager.java",
henrikac3c2f312016-12-14 07:36:56 -080073 "androidapp/src/org/appspot/apprtc/AppRTCBluetoothManager.java",
Sami Kalliomaki9c0c75b2016-06-29 14:55:00 +020074 "androidapp/src/org/appspot/apprtc/AppRTCClient.java",
75 "androidapp/src/org/appspot/apprtc/AppRTCProximitySensor.java",
76 "androidapp/src/org/appspot/apprtc/CallActivity.java",
77 "androidapp/src/org/appspot/apprtc/CallFragment.java",
78 "androidapp/src/org/appspot/apprtc/CaptureQualityController.java",
79 "androidapp/src/org/appspot/apprtc/ConnectActivity.java",
80 "androidapp/src/org/appspot/apprtc/CpuMonitor.java",
81 "androidapp/src/org/appspot/apprtc/DirectRTCClient.java",
82 "androidapp/src/org/appspot/apprtc/HudFragment.java",
83 "androidapp/src/org/appspot/apprtc/PeerConnectionClient.java",
Sami Kalliomaki9c0c75b2016-06-29 14:55:00 +020084 "androidapp/src/org/appspot/apprtc/RoomParametersFetcher.java",
85 "androidapp/src/org/appspot/apprtc/SettingsActivity.java",
86 "androidapp/src/org/appspot/apprtc/SettingsFragment.java",
87 "androidapp/src/org/appspot/apprtc/TCPChannelClient.java",
88 "androidapp/src/org/appspot/apprtc/UnhandledExceptionHandler.java",
89 "androidapp/src/org/appspot/apprtc/WebSocketChannelClient.java",
90 "androidapp/src/org/appspot/apprtc/WebSocketRTCClient.java",
91 "androidapp/src/org/appspot/apprtc/util/AppRTCUtils.java",
92 "androidapp/src/org/appspot/apprtc/util/AsyncHttpURLConnection.java",
Sami Kalliomaki9c0c75b2016-06-29 14:55:00 +020093 ]
94
95 deps = [
Magnus Jedvertc1815cf2016-09-27 10:10:41 +020096 ":AppRTCMobile_resources",
Sami Kalliomaki9c0c75b2016-06-29 14:55:00 +020097 "//webrtc/base:base_java",
98 "//webrtc/examples/androidapp/third_party/autobanh:autobanh_java",
mbonadeib55bd972017-01-23 01:25:53 -080099 "//webrtc/modules/audio_device:audio_device_java",
magjed768c6482016-12-06 04:29:37 -0800100 "//webrtc/sdk/android:libjingle_peerconnection_java",
101 "//webrtc/sdk/android:libjingle_peerconnection_metrics_default_java",
Sami Kalliomaki9c0c75b2016-06-29 14:55:00 +0200102 ]
103 }
104
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200105 android_resources("AppRTCMobile_resources") {
kjellander1993b1d2017-03-06 00:29:21 -0800106 testonly = true
Sami Kalliomaki9c0c75b2016-06-29 14:55:00 +0200107 resource_dirs = [ "androidapp/res" ]
108 custom_package = "org.appspot.apprtc"
109 }
110
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200111 instrumentation_test_apk("AppRTCMobileTest") {
112 apk_name = "AppRTCMobileTest"
Sami Kalliomaki9c0c75b2016-06-29 14:55:00 +0200113 android_manifest = "androidtests/AndroidManifest.xml"
114
sakale8aca242017-01-17 03:32:06 -0800115 java_files = [ "androidtests/src/org/appspot/apprtc/test/PeerConnectionClientTest.java" ]
Sami Kalliomaki9c0c75b2016-06-29 14:55:00 +0200116
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200117 apk_under_test = ":AppRTCMobile"
Sami Kalliomaki9c0c75b2016-06-29 14:55:00 +0200118
119 deps = [
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200120 ":AppRTCMobile_javalib",
sakalcb79d512017-01-11 06:21:26 -0800121 "//base:base_java_test_support",
122 "//third_party/android_support_test_runner:runner_java",
123 "//third_party/junit",
magjed768c6482016-12-06 04:29:37 -0800124 "//webrtc/sdk/android:libjingle_peerconnection_java",
Sami Kalliomaki9c0c75b2016-06-29 14:55:00 +0200125 ]
126 }
mandermoa6069e82017-01-16 02:23:09 -0800127
128 instrumentation_test_apk("AppRTCMobileTestStubbedVideoIO") {
129 apk_name = "AppRTCMobileTestStubbedVideoIO"
130 android_manifest = "androidtests/AndroidManifest.xml"
131
oprypin30cda5e2017-04-24 04:15:13 -0700132 java_files = [ "androidtests/src/org/appspot/apprtc/test/CallActivityStubbedInputOutputTest.java" ]
mandermoa6069e82017-01-16 02:23:09 -0800133
134 apk_under_test = ":AppRTCMobile"
135
136 deps = [
137 ":AppRTCMobile_javalib",
138 "//third_party/android_support_test_runner:rules_java",
139 "//third_party/android_support_test_runner:runner_java",
140 "//third_party/espresso:espresso_all_java",
141 "//third_party/hamcrest:hamcrest_java",
142 "//third_party/junit",
143 "//webrtc/sdk/android:libjingle_peerconnection_java",
144 ]
145
146 data = [
147 "//resources/reference_video_640x360_30fps.y4m",
148 ]
149 }
Sami Kalliomaki9c0c75b2016-06-29 14:55:00 +0200150}
tkchin2ddfdba2016-08-07 21:37:45 -0700151
152if (is_ios || (is_mac && target_cpu != "x86")) {
tkchin2ddfdba2016-08-07 21:37:45 -0700153 config("apprtc_common_config") {
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200154 include_dirs = [ "objc/AppRTCMobile/common" ]
tkchin2ddfdba2016-08-07 21:37:45 -0700155 }
156
kjellanderb62dbbe2016-09-23 00:38:52 -0700157 rtc_static_library("apprtc_common") {
kjellander1993b1d2017-03-06 00:29:21 -0800158 testonly = true
tkchin2ddfdba2016-08-07 21:37:45 -0700159 sources = [
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200160 "objc/AppRTCMobile/common/ARDUtilities.h",
161 "objc/AppRTCMobile/common/ARDUtilities.m",
tkchin2ddfdba2016-08-07 21:37:45 -0700162 ]
ehmaldonadoe9cc6862016-09-05 06:10:18 -0700163 public_configs = [ ":apprtc_common_config" ]
tkchin2ddfdba2016-08-07 21:37:45 -0700164
165 deps = [
kjellander1993b1d2017-03-06 00:29:21 -0800166 "//webrtc/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",
Kári Tristan Helgason946923a2017-06-02 14:05:56 +0200274
275 # TODO(kthelgason): Remove this dep when audio_device has been
276 # moved to sdk.
277 "//webrtc/modules/audio_device:audio_device",
denicija77bfd7c2016-11-15 00:41:26 -0800278 ]
279 }
280
281 ios_app_bundle("AppRTCMobile") {
kjellander1993b1d2017-03-06 00:29:21 -0800282 testonly = true
denicija77bfd7c2016-11-15 00:41:26 -0800283 sources = [
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200284 "objc/AppRTCMobile/ios/main.m",
tkchin2ddfdba2016-08-07 21:37:45 -0700285 ]
286
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200287 info_plist = "objc/AppRTCMobile/ios/Info.plist"
tkchin2ddfdba2016-08-07 21:37:45 -0700288
denicija77bfd7c2016-11-15 00:41:26 -0800289 configs += [ "..:common_config" ]
tkchin2ddfdba2016-08-07 21:37:45 -0700290 public_configs = [ "..:common_inherited_config" ]
291
292 deps = [
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200293 ":AppRTCMobile_ios_bundle_data",
kthelgasond3adbfb2017-01-26 01:14:04 -0800294 ":AppRTCMobile_ios_frameworks",
denicija77bfd7c2016-11-15 00:41:26 -0800295 ":AppRTCMobile_lib",
tkchin2ddfdba2016-08-07 21:37:45 -0700296 ]
297
298 if (target_cpu == "x86") {
299 deps += [ "//testing/iossim:iossim" ]
300 }
301 }
302
kthelgasond3adbfb2017-01-26 01:14:04 -0800303 bundle_data("AppRTCMobile_ios_frameworks") {
304 public_deps = [
kthelgason2f088792017-05-30 01:48:47 -0700305 "//webrtc/sdk:objc_framework+link",
kthelgasond3adbfb2017-01-26 01:14:04 -0800306 ]
307 sources = [
308 "$root_out_dir/WebRTC.framework",
309 ]
310 outputs = [
311 "{{bundle_resources_dir}}/Frameworks/{{source_file_part}}",
312 ]
313 }
314
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200315 bundle_data("AppRTCMobile_ios_bundle_data") {
tkchin2ddfdba2016-08-07 21:37:45 -0700316 sources = [
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200317 "objc/AppRTCMobile/ios/resources/Roboto-Regular.ttf",
318 "objc/AppRTCMobile/ios/resources/iPhone5@2x.png",
319 "objc/AppRTCMobile/ios/resources/iPhone6@2x.png",
320 "objc/AppRTCMobile/ios/resources/iPhone6p@3x.png",
321 "objc/AppRTCMobile/ios/resources/ic_call_end_black_24dp.png",
322 "objc/AppRTCMobile/ios/resources/ic_call_end_black_24dp@2x.png",
323 "objc/AppRTCMobile/ios/resources/ic_clear_black_24dp.png",
324 "objc/AppRTCMobile/ios/resources/ic_clear_black_24dp@2x.png",
denicija6d6762c2016-10-28 04:53:16 -0700325 "objc/AppRTCMobile/ios/resources/ic_settings_black_24dp.png",
326 "objc/AppRTCMobile/ios/resources/ic_settings_black_24dp@2x.png",
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200327 "objc/AppRTCMobile/ios/resources/ic_surround_sound_black_24dp.png",
328 "objc/AppRTCMobile/ios/resources/ic_surround_sound_black_24dp@2x.png",
329 "objc/AppRTCMobile/ios/resources/ic_switch_video_black_24dp.png",
330 "objc/AppRTCMobile/ios/resources/ic_switch_video_black_24dp@2x.png",
331 "objc/AppRTCMobile/ios/resources/mozart.mp3",
tkchin2ddfdba2016-08-07 21:37:45 -0700332 "objc/Icon.png",
333 ]
334 outputs = [
335 "{{bundle_resources_dir}}/{{source_file_part}}",
336 ]
337 }
338 }
339
340 if (is_mac) {
denicija77bfd7c2016-11-15 00:41:26 -0800341 rtc_static_library("AppRTCMobile_lib") {
kjellander1993b1d2017-03-06 00:29:21 -0800342 testonly = true
tkchin2ddfdba2016-08-07 21:37:45 -0700343 sources = [
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200344 "objc/AppRTCMobile/mac/APPRTCAppDelegate.h",
345 "objc/AppRTCMobile/mac/APPRTCAppDelegate.m",
346 "objc/AppRTCMobile/mac/APPRTCViewController.h",
347 "objc/AppRTCMobile/mac/APPRTCViewController.m",
tkchin2ddfdba2016-08-07 21:37:45 -0700348 ]
kthelgasonc0977102017-04-24 00:57:16 -0700349 configs += [ "//webrtc:common_objc" ]
tkchin2ddfdba2016-08-07 21:37:45 -0700350 deps = [
351 ":apprtc_common",
352 ":apprtc_signaling",
kthelgason2f088792017-05-30 01:48:47 -0700353 "//webrtc/sdk:objc_ui",
tkchin2ddfdba2016-08-07 21:37:45 -0700354 ]
355 }
356
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200357 mac_app_bundle("AppRTCMobile") {
kjellander1993b1d2017-03-06 00:29:21 -0800358 testonly = true
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200359 output_name = "AppRTCMobile"
tkchin2ddfdba2016-08-07 21:37:45 -0700360
tkchin2ddfdba2016-08-07 21:37:45 -0700361 sources = [
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200362 "objc/AppRTCMobile/mac/main.m",
tkchin2ddfdba2016-08-07 21:37:45 -0700363 ]
364
365 public_configs = [ "..:common_inherited_config" ]
366
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200367 info_plist = "objc/AppRTCMobile/mac/Info.plist"
tkchin2ddfdba2016-08-07 21:37:45 -0700368
369 libs = [ "AppKit.framework" ]
370
371 deps = [
denicija77bfd7c2016-11-15 00:41:26 -0800372 ":AppRTCMobile_lib",
tkchin2ddfdba2016-08-07 21:37:45 -0700373 ]
374 }
375 }
376
377 config("socketrocket_include_config") {
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200378 include_dirs = [ "objc/AppRTCMobile/third_party/SocketRocket" ]
tkchin2ddfdba2016-08-07 21:37:45 -0700379 }
380
381 config("socketrocket_warning_config") {
382 # GN orders flags on a target before flags from configs. The default config
383 # adds these flags so to cancel them out they need to come from a config and
384 # cannot be on the target directly.
385 cflags = [
386 "-Wno-deprecated-declarations",
387 "-Wno-nonnull",
tkchin2ddfdba2016-08-07 21:37:45 -0700388 "-Wno-semicolon-before-method-body",
kthelgasone47de1a2017-02-24 01:56:01 -0800389 "-Wno-unused-variable",
tkchin2ddfdba2016-08-07 21:37:45 -0700390 ]
391
henrika27d8b612016-09-21 04:13:00 -0700392 cflags_objc = [
393 # Enabled for cflags_objc in build/config/compiler/BUILD.gn.
394 "-Wno-objc-missing-property-synthesis",
henrika27d8b612016-09-21 04:13:00 -0700395 ]
tkchin2ddfdba2016-08-07 21:37:45 -0700396 }
397
kjellanderb62dbbe2016-09-23 00:38:52 -0700398 rtc_static_library("socketrocket") {
kjellander1993b1d2017-03-06 00:29:21 -0800399 testonly = true
tkchin2ddfdba2016-08-07 21:37:45 -0700400 sources = [
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200401 "objc/AppRTCMobile/third_party/SocketRocket/SRWebSocket.h",
402 "objc/AppRTCMobile/third_party/SocketRocket/SRWebSocket.m",
tkchin2ddfdba2016-08-07 21:37:45 -0700403 ]
kthelgasonc0977102017-04-24 00:57:16 -0700404 configs += [ ":socketrocket_warning_config" ]
ehmaldonadoe9cc6862016-09-05 06:10:18 -0700405 public_configs = [ ":socketrocket_include_config" ]
tkchin2ddfdba2016-08-07 21:37:45 -0700406
407 libs = [
408 "CFNetwork.framework",
409 "icucore",
410 ]
411 }
adam.fedorbcc5d872016-11-07 14:53:28 -0800412
413 if (rtc_include_tests) {
kthelgason4065a572017-02-14 04:58:56 -0800414 # TODO(kthelgason): compile xctests on mac when chromium supports it.
415 if (is_ios) {
416 rtc_source_set("apprtcmobile_test_sources") {
kjellander1993b1d2017-03-06 00:29:21 -0800417 testonly = true
kthelgason4065a572017-02-14 04:58:56 -0800418 include_dirs = [
419 "objc/AppRTCMobile",
420 "objc/AppRTCMobile/ios",
421 ]
422 testonly = true
423 sources = [
424 "objc/AppRTCMobile/tests/ARDAppClient_xctest.mm",
425 "objc/AppRTCMobile/tests/ARDSDPUtils_xctest.mm",
426 "objc/AppRTCMobile/tests/ARDSettingsModel_xctest.mm",
427 ]
kjellander1993b1d2017-03-06 00:29:21 -0800428 deps = [
429 "//webrtc/base:rtc_base",
430 ]
kthelgason4065a572017-02-14 04:58:56 -0800431 public_deps = [
432 ":AppRTCMobile_ios_frameworks",
433 ":AppRTCMobile_lib",
434 "//build/config/ios:xctest",
435 "//third_party/ocmock",
436 ]
adam.fedorbcc5d872016-11-07 14:53:28 -0800437 }
438
kthelgason4065a572017-02-14 04:58:56 -0800439 rtc_ios_xctest_test("apprtcmobile_tests") {
440 info_plist = "objc/AppRTCMobile/ios/Info.plist"
441 sources = [
442 "objc/AppRTCMobile/ios/main.m",
443 ]
444 deps = [
445 ":apprtcmobile_test_sources",
446 ]
447 ldflags = [ "-all_load" ]
448 }
adam.fedorbcc5d872016-11-07 14:53:28 -0800449 }
450 }
tkchin2ddfdba2016-08-07 21:37:45 -0700451}
kthelgason0727f152016-08-08 09:03:23 -0700452
453if (is_linux || is_win) {
ehmaldonadod02fe4b2016-08-26 13:31:24 -0700454 config("peerconnection_client_warnings_config") {
kjellander4a9abad2016-09-18 08:12:29 -0700455 cflags = []
ehmaldonadod02fe4b2016-08-26 13:31:24 -0700456 if (is_win && is_clang) {
kjellander4a9abad2016-09-18 08:12:29 -0700457 cflags += [
ehmaldonadod02fe4b2016-08-26 13:31:24 -0700458 # Disable warnings failing when compiling with Clang on Windows.
459 # https://bugs.chromium.org/p/webrtc/issues/detail?id=5366
460 "-Wno-format",
461
462 # See https://bugs.chromium.org/p/webrtc/issues/detail?id=6271
463 # for -Wno-reorder and -Wno-sign-compare
464 "-Wno-reorder",
465 "-Wno-sign-compare",
466 ]
467 }
kjellanderd4626e52016-09-07 02:33:01 -0700468 if (is_linux && target_cpu == "x86") {
kjellander4a9abad2016-09-18 08:12:29 -0700469 cflags += [
kjellanderd4626e52016-09-07 02:33:01 -0700470 # Needed to compile on Linux 32-bit.
471 "-Wno-sentinel",
472 ]
473 }
kjellander4a9abad2016-09-18 08:12:29 -0700474
475 if (is_clang) {
476 # TODO(ehmaldonado): Make peerconnection_client compile with the standard
477 # set of warnings.
478 # See https://bugs.chromium.org/p/webrtc/issues/detail?id=6306
479 cflags += [ "-Wno-inconsistent-missing-override" ]
480 }
ehmaldonadod02fe4b2016-08-26 13:31:24 -0700481 }
482
ehmaldonado38a21322016-09-02 04:10:34 -0700483 rtc_executable("peerconnection_client") {
kjellander1993b1d2017-03-06 00:29:21 -0800484 testonly = true
kthelgason0727f152016-08-08 09:03:23 -0700485 sources = [
486 "peerconnection/client/conductor.cc",
487 "peerconnection/client/conductor.h",
488 "peerconnection/client/defaults.cc",
489 "peerconnection/client/defaults.h",
490 "peerconnection/client/peer_connection_client.cc",
491 "peerconnection/client/peer_connection_client.h",
492 ]
ehmaldonado7a2ce0b2016-09-05 01:35:44 -0700493
kjellandere40a7ee2016-10-16 23:56:12 -0700494 if (!build_with_chromium && is_clang) {
495 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
ehmaldonado38a21322016-09-02 04:10:34 -0700496 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
kthelgason0727f152016-08-08 09:03:23 -0700497 }
kjellander1993b1d2017-03-06 00:29:21 -0800498 deps = []
kthelgason0727f152016-08-08 09:03:23 -0700499 if (is_win) {
500 sources += [
501 "peerconnection/client/flagdefs.h",
502 "peerconnection/client/main.cc",
503 "peerconnection/client/main_wnd.cc",
504 "peerconnection/client/main_wnd.h",
505 ]
506 cflags = [ "/wd4245" ]
507 configs += [ "//build/config/win:windowed" ]
kjellander1993b1d2017-03-06 00:29:21 -0800508 deps += [ "//webrtc/media:rtc_media_base" ]
kthelgason0727f152016-08-08 09:03:23 -0700509 }
510 if (is_linux) {
511 sources += [
512 "peerconnection/client/linux/main.cc",
513 "peerconnection/client/linux/main_wnd.cc",
514 "peerconnection/client/linux/main_wnd.h",
515 ]
Henrik Kjellanderefbde2c2017-03-27 08:28:27 +0200516 cflags = [ "-Wno-deprecated-declarations" ]
kthelgason0727f152016-08-08 09:03:23 -0700517 libs = [
518 "X11",
519 "Xcomposite",
520 "Xext",
521 "Xrender",
522 ]
thomasandersonef16e992016-12-13 02:57:43 -0800523 deps += [ "//build/config/linux/gtk" ]
kthelgason0727f152016-08-08 09:03:23 -0700524 }
ehmaldonadod02fe4b2016-08-26 13:31:24 -0700525 configs += [ ":peerconnection_client_warnings_config" ]
kjellander1993b1d2017-03-06 00:29:21 -0800526
527 deps += [
528 "//third_party/libyuv",
529 "//webrtc/api:libjingle_peerconnection_test_api",
530 "//webrtc/api:video_frame_api",
531 "//webrtc/base:rtc_base",
532 "//webrtc/base:rtc_base_approved",
zhihuang44d305a2017-04-24 12:05:06 -0700533 "//webrtc/base:rtc_json",
kjellander1993b1d2017-03-06 00:29:21 -0800534 "//webrtc/media:rtc_media",
535 "//webrtc/modules/video_capture:video_capture_module",
536 "//webrtc/pc:libjingle_peerconnection",
537 "//webrtc/system_wrappers:field_trial_default",
538 "//webrtc/system_wrappers:metrics_default",
539 ]
kthelgason0727f152016-08-08 09:03:23 -0700540 }
kjellanderd4626e52016-09-07 02:33:01 -0700541
ehmaldonado38a21322016-09-02 04:10:34 -0700542 rtc_executable("peerconnection_server") {
kjellander1993b1d2017-03-06 00:29:21 -0800543 testonly = true
kthelgason0727f152016-08-08 09:03:23 -0700544 sources = [
545 "peerconnection/server/data_socket.cc",
546 "peerconnection/server/data_socket.h",
547 "peerconnection/server/main.cc",
548 "peerconnection/server/peer_channel.cc",
549 "peerconnection/server/peer_channel.h",
550 "peerconnection/server/utils.cc",
551 "peerconnection/server/utils.h",
552 ]
553 deps = [
554 "//webrtc:webrtc_common",
555 "//webrtc/base:rtc_base_approved",
556 "//webrtc/tools:command_line_parser",
557 ]
kjellandere40a7ee2016-10-16 23:56:12 -0700558 if (!build_with_chromium && is_clang) {
559 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
ehmaldonado38a21322016-09-02 04:10:34 -0700560 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
kthelgason0727f152016-08-08 09:03:23 -0700561 }
562 }
ehmaldonado38a21322016-09-02 04:10:34 -0700563 rtc_executable("relayserver") {
kjellander1993b1d2017-03-06 00:29:21 -0800564 testonly = true
kthelgason0727f152016-08-08 09:03:23 -0700565 sources = [
566 "relayserver/relayserver_main.cc",
567 ]
568 deps = [
kjellander1993b1d2017-03-06 00:29:21 -0800569 "../base:rtc_base",
kthelgason0727f152016-08-08 09:03:23 -0700570 "//webrtc/base:rtc_base_approved",
kjellander1993b1d2017-03-06 00:29:21 -0800571 "//webrtc/p2p:rtc_p2p",
kthelgason0727f152016-08-08 09:03:23 -0700572 "//webrtc/pc:rtc_pc",
573 "//webrtc/system_wrappers:field_trial_default",
574 "//webrtc/system_wrappers:metrics_default",
575 ]
kjellandere40a7ee2016-10-16 23:56:12 -0700576 if (!build_with_chromium && is_clang) {
577 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
ehmaldonado38a21322016-09-02 04:10:34 -0700578 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
kthelgason0727f152016-08-08 09:03:23 -0700579 }
580 }
ehmaldonado38a21322016-09-02 04:10:34 -0700581 rtc_executable("turnserver") {
kjellander1993b1d2017-03-06 00:29:21 -0800582 testonly = true
kthelgason0727f152016-08-08 09:03:23 -0700583 sources = [
584 "turnserver/turnserver_main.cc",
585 ]
586 deps = [
kjellander1993b1d2017-03-06 00:29:21 -0800587 "../base:rtc_base",
kthelgason0727f152016-08-08 09:03:23 -0700588 "//webrtc/base:rtc_base_approved",
kjellander1993b1d2017-03-06 00:29:21 -0800589 "//webrtc/p2p:rtc_p2p",
kthelgason0727f152016-08-08 09:03:23 -0700590 "//webrtc/pc:rtc_pc",
591 "//webrtc/system_wrappers:field_trial_default",
592 "//webrtc/system_wrappers:metrics_default",
593 ]
kjellandere40a7ee2016-10-16 23:56:12 -0700594 if (!build_with_chromium && is_clang) {
595 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
ehmaldonado38a21322016-09-02 04:10:34 -0700596 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
kthelgason0727f152016-08-08 09:03:23 -0700597 }
598 }
ehmaldonado38a21322016-09-02 04:10:34 -0700599 rtc_executable("stunserver") {
kjellander1993b1d2017-03-06 00:29:21 -0800600 testonly = true
kthelgason0727f152016-08-08 09:03:23 -0700601 sources = [
602 "stunserver/stunserver_main.cc",
603 ]
604 deps = [
kjellander1993b1d2017-03-06 00:29:21 -0800605 "../base:rtc_base",
kthelgason0727f152016-08-08 09:03:23 -0700606 "//webrtc/base:rtc_base_approved",
kjellander1993b1d2017-03-06 00:29:21 -0800607 "//webrtc/p2p:rtc_p2p",
kthelgason0727f152016-08-08 09:03:23 -0700608 "//webrtc/pc:rtc_pc",
609 "//webrtc/system_wrappers:field_trial_default",
610 "//webrtc/system_wrappers:metrics_default",
611 ]
kjellandere40a7ee2016-10-16 23:56:12 -0700612 if (!build_with_chromium && is_clang) {
613 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
ehmaldonado38a21322016-09-02 04:10:34 -0700614 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
kthelgason0727f152016-08-08 09:03:23 -0700615 }
616 }
617}
charujainaca3a242016-11-01 03:09:15 -0700618
gyzhouad7cad82017-05-11 16:10:03 -0700619if (is_win) {
620 rtc_shared_library("webrtc_unity_plugin") {
621 testonly = true
622 sources = [
623 "unityplugin/simple_peer_connection.cc",
624 "unityplugin/simple_peer_connection.h",
625 "unityplugin/unity_plugin_apis.cc",
626 "unityplugin/unity_plugin_apis.h",
627 ]
628 if (!build_with_chromium && is_clang) {
629 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
630 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
631 }
632 cflags = [ "/wd4245" ]
633 configs += [
634 "//build/config/win:windowed",
635 ":peerconnection_client_warnings_config",
636 ]
637 deps = [
638 "//webrtc/api:libjingle_peerconnection_test_api",
639 "//webrtc/api:video_frame_api",
640 "//webrtc/base:rtc_base",
641 "//webrtc/base:rtc_base_approved",
642 "//webrtc/base:rtc_json",
643 "//webrtc/media:rtc_media",
644 "//webrtc/media:rtc_media_base",
645 "//webrtc/modules/video_capture:video_capture_module",
646 "//webrtc/pc:libjingle_peerconnection",
647 "//webrtc/system_wrappers:field_trial_default",
648 "//webrtc/system_wrappers:metrics_default",
649 ]
650 }
651}
652
charujainaca3a242016-11-01 03:09:15 -0700653if (!build_with_chromium) {
654 # Doesn't build within Chrome on Win.
655 rtc_executable("stun_prober") {
kjellander1993b1d2017-03-06 00:29:21 -0800656 testonly = true
charujainaca3a242016-11-01 03:09:15 -0700657 sources = [
658 "stunprober/main.cc",
659 ]
660
661 if (!build_with_chromium && is_clang) {
662 # Suppress warnings from Chrome's Clang plugins.
663 # See http://code.google.com/p/webrtc/issues/detail?id=163 for details.
664 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
665 }
666
667 deps = [
kjellander1993b1d2017-03-06 00:29:21 -0800668 "../base:rtc_base",
669 "../base:rtc_base_approved",
charujainaca3a242016-11-01 03:09:15 -0700670 "../p2p:libstunprober",
671 "../p2p:rtc_p2p",
672 "../system_wrappers:field_trial_default",
673 ]
674 }
675}