blob: 428498d1edd267eb6b9428e00793118a5a20d0cf [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
ehmaldonado38a21322016-09-02 04:10:34 -07009import("../build/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") {
53 apk_name = "AppRTCMobile"
Sami Kalliomaki9c0c75b2016-06-29 14:55:00 +020054 android_manifest = "androidapp/AndroidManifest.xml"
55
56 deps = [
Magnus Jedvertc1815cf2016-09-27 10:10:41 +020057 ":AppRTCMobile_javalib",
58 ":AppRTCMobile_resources",
Sami Kalliomaki9c0c75b2016-06-29 14:55:00 +020059 "//base:base_java",
60 "//webrtc/base:base_java",
61 ]
62
magjed768c6482016-12-06 04:29:37 -080063 shared_libraries = [ "//webrtc/sdk/android:libjingle_peerconnection_so" ]
Sami Kalliomaki9c0c75b2016-06-29 14:55:00 +020064 }
65
Magnus Jedvertc1815cf2016-09-27 10:10:41 +020066 android_library("AppRTCMobile_javalib") {
Sami Kalliomaki9c0c75b2016-06-29 14:55:00 +020067 java_files = [
68 "androidapp/src/org/appspot/apprtc/AppRTCAudioManager.java",
henrikac3c2f312016-12-14 07:36:56 -080069 "androidapp/src/org/appspot/apprtc/AppRTCBluetoothManager.java",
Sami Kalliomaki9c0c75b2016-06-29 14:55:00 +020070 "androidapp/src/org/appspot/apprtc/AppRTCClient.java",
71 "androidapp/src/org/appspot/apprtc/AppRTCProximitySensor.java",
72 "androidapp/src/org/appspot/apprtc/CallActivity.java",
73 "androidapp/src/org/appspot/apprtc/CallFragment.java",
74 "androidapp/src/org/appspot/apprtc/CaptureQualityController.java",
75 "androidapp/src/org/appspot/apprtc/ConnectActivity.java",
76 "androidapp/src/org/appspot/apprtc/CpuMonitor.java",
77 "androidapp/src/org/appspot/apprtc/DirectRTCClient.java",
78 "androidapp/src/org/appspot/apprtc/HudFragment.java",
79 "androidapp/src/org/appspot/apprtc/PeerConnectionClient.java",
80 "androidapp/src/org/appspot/apprtc/PercentFrameLayout.java",
81 "androidapp/src/org/appspot/apprtc/RoomParametersFetcher.java",
82 "androidapp/src/org/appspot/apprtc/SettingsActivity.java",
83 "androidapp/src/org/appspot/apprtc/SettingsFragment.java",
84 "androidapp/src/org/appspot/apprtc/TCPChannelClient.java",
85 "androidapp/src/org/appspot/apprtc/UnhandledExceptionHandler.java",
86 "androidapp/src/org/appspot/apprtc/WebSocketChannelClient.java",
87 "androidapp/src/org/appspot/apprtc/WebSocketRTCClient.java",
88 "androidapp/src/org/appspot/apprtc/util/AppRTCUtils.java",
89 "androidapp/src/org/appspot/apprtc/util/AsyncHttpURLConnection.java",
Sami Kalliomaki9c0c75b2016-06-29 14:55:00 +020090 ]
91
92 deps = [
Magnus Jedvertc1815cf2016-09-27 10:10:41 +020093 ":AppRTCMobile_resources",
Sami Kalliomaki9c0c75b2016-06-29 14:55:00 +020094 "//webrtc/base:base_java",
95 "//webrtc/examples/androidapp/third_party/autobanh:autobanh_java",
magjed768c6482016-12-06 04:29:37 -080096 "//webrtc/sdk/android:libjingle_peerconnection_java",
97 "//webrtc/sdk/android:libjingle_peerconnection_metrics_default_java",
Sami Kalliomaki9c0c75b2016-06-29 14:55:00 +020098 ]
99 }
100
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200101 android_resources("AppRTCMobile_resources") {
Sami Kalliomaki9c0c75b2016-06-29 14:55:00 +0200102 resource_dirs = [ "androidapp/res" ]
103 custom_package = "org.appspot.apprtc"
104 }
105
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200106 instrumentation_test_apk("AppRTCMobileTest") {
107 apk_name = "AppRTCMobileTest"
Sami Kalliomaki9c0c75b2016-06-29 14:55:00 +0200108 android_manifest = "androidtests/AndroidManifest.xml"
109
mandermoa8bec8d2016-10-26 01:47:07 -0700110 java_files = [
mandermo9890a582016-10-27 07:26:36 -0700111 "androidtests/src/org/appspot/apprtc/test/FileVideoCapturerTest.java",
mandermoa8bec8d2016-10-26 01:47:07 -0700112 "androidtests/src/org/appspot/apprtc/test/PeerConnectionClientTest.java",
113 "androidtests/src/org/appspot/apprtc/test/VideoFileRendererTest.java",
114 ]
Sami Kalliomaki9c0c75b2016-06-29 14:55:00 +0200115
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200116 apk_under_test = ":AppRTCMobile"
Sami Kalliomaki9c0c75b2016-06-29 14:55:00 +0200117
118 deps = [
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200119 ":AppRTCMobile_javalib",
sakalcb79d512017-01-11 06:21:26 -0800120 "//base:base_java_test_support",
121 "//third_party/android_support_test_runner:runner_java",
122 "//third_party/junit",
magjed768c6482016-12-06 04:29:37 -0800123 "//webrtc/sdk/android:libjingle_peerconnection_java",
Sami Kalliomaki9c0c75b2016-06-29 14:55:00 +0200124 ]
mandermo9890a582016-10-27 07:26:36 -0700125
126 data = [
127 "//webrtc/examples/androidtests/src/org/appspot/apprtc/test/capturetestvideo.y4m",
128 ]
Sami Kalliomaki9c0c75b2016-06-29 14:55:00 +0200129 }
mandermoa6069e82017-01-16 02:23:09 -0800130
131 instrumentation_test_apk("AppRTCMobileTestStubbedVideoIO") {
132 apk_name = "AppRTCMobileTestStubbedVideoIO"
133 android_manifest = "androidtests/AndroidManifest.xml"
134
135 java_files = [ "androidtests/src/org/appspot/apprtc/test/ConnectActivityStubbedInputOutputTest.java" ]
136
137 apk_under_test = ":AppRTCMobile"
138
139 deps = [
140 ":AppRTCMobile_javalib",
141 "//third_party/android_support_test_runner:rules_java",
142 "//third_party/android_support_test_runner:runner_java",
143 "//third_party/espresso:espresso_all_java",
144 "//third_party/hamcrest:hamcrest_java",
145 "//third_party/junit",
146 "//webrtc/sdk/android:libjingle_peerconnection_java",
147 ]
148
149 data = [
150 "//resources/reference_video_640x360_30fps.y4m",
151 ]
152 }
Sami Kalliomaki9c0c75b2016-06-29 14:55:00 +0200153}
tkchin2ddfdba2016-08-07 21:37:45 -0700154
155if (is_ios || (is_mac && target_cpu != "x86")) {
156 config("warnings_config") {
157 # GN orders flags on a target before flags from configs. The default config
158 # adds these flags so to cancel them out they need to come from a config and
159 # cannot be on the target directly.
160 if (is_ios) {
161 # Suppress compiler warnings about deprecated that triggered
162 # when moving from ios_deployment_target 7.0 to 9.0.
163 # See webrtc:5549 for more details.
164 cflags = [ "-Wno-deprecated-declarations" ]
Henrik Kjellander91a57592016-10-12 20:25:34 -0700165 cflags_objc = [
166 # Enabled for cflags_objc in build/config/compiler/BUILD.gn.
167 # See webrtc:6520.
168 "-Wno-objc-missing-property-synthesis",
169 ]
tkchin2ddfdba2016-08-07 21:37:45 -0700170 }
171 }
172
173 config("apprtc_common_config") {
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200174 include_dirs = [ "objc/AppRTCMobile/common" ]
tkchin2ddfdba2016-08-07 21:37:45 -0700175 }
176
kjellanderb62dbbe2016-09-23 00:38:52 -0700177 rtc_static_library("apprtc_common") {
tkchin2ddfdba2016-08-07 21:37:45 -0700178 sources = [
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200179 "objc/AppRTCMobile/common/ARDUtilities.h",
180 "objc/AppRTCMobile/common/ARDUtilities.m",
tkchin2ddfdba2016-08-07 21:37:45 -0700181 ]
182 configs += [
tkchin2ddfdba2016-08-07 21:37:45 -0700183 ":warnings_config",
184 "//build/config/compiler:enable_arc",
185 ]
ehmaldonadoe9cc6862016-09-05 06:10:18 -0700186 public_configs = [ ":apprtc_common_config" ]
tkchin2ddfdba2016-08-07 21:37:45 -0700187
188 deps = [
189 "../sdk:rtc_sdk_common_objc",
190 "../system_wrappers:field_trial_default",
191 "../system_wrappers:metrics_default",
192 ]
193 }
194
195 config("apprtc_signaling_config") {
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200196 include_dirs = [ "objc/AppRTCMobile" ]
tkchin2ddfdba2016-08-07 21:37:45 -0700197
198 # GN orders flags on a target before flags from configs. The default config
199 # adds these flags so to cancel them out they need to come from a config and
200 # cannot be on the target directly.
201 cflags = [
202 "-Wno-sign-compare",
203 "-Wno-unused-variable",
204 ]
205 if (is_mac) {
206 cflags += [ "-Wno-partial-availability" ]
207 }
208 }
209
kjellanderb62dbbe2016-09-23 00:38:52 -0700210 rtc_static_library("apprtc_signaling") {
tkchin2ddfdba2016-08-07 21:37:45 -0700211 sources = [
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200212 "objc/AppRTCMobile/ARDAppClient+Internal.h",
213 "objc/AppRTCMobile/ARDAppClient.h",
214 "objc/AppRTCMobile/ARDAppClient.m",
215 "objc/AppRTCMobile/ARDAppEngineClient.h",
216 "objc/AppRTCMobile/ARDAppEngineClient.m",
217 "objc/AppRTCMobile/ARDBitrateTracker.h",
218 "objc/AppRTCMobile/ARDBitrateTracker.m",
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200219 "objc/AppRTCMobile/ARDJoinResponse+Internal.h",
220 "objc/AppRTCMobile/ARDJoinResponse.h",
221 "objc/AppRTCMobile/ARDJoinResponse.m",
222 "objc/AppRTCMobile/ARDMessageResponse+Internal.h",
223 "objc/AppRTCMobile/ARDMessageResponse.h",
224 "objc/AppRTCMobile/ARDMessageResponse.m",
225 "objc/AppRTCMobile/ARDRoomServerClient.h",
226 "objc/AppRTCMobile/ARDSDPUtils.h",
227 "objc/AppRTCMobile/ARDSDPUtils.m",
228 "objc/AppRTCMobile/ARDSignalingChannel.h",
229 "objc/AppRTCMobile/ARDSignalingMessage.h",
230 "objc/AppRTCMobile/ARDSignalingMessage.m",
231 "objc/AppRTCMobile/ARDStatsBuilder.h",
232 "objc/AppRTCMobile/ARDStatsBuilder.m",
kthelgasoncc882af2017-01-13 05:59:46 -0800233 "objc/AppRTCMobile/ARDTURNClient+Internal.h",
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200234 "objc/AppRTCMobile/ARDTURNClient.h",
kthelgasoncc882af2017-01-13 05:59:46 -0800235 "objc/AppRTCMobile/ARDTURNClient.m",
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200236 "objc/AppRTCMobile/ARDWebSocketChannel.h",
237 "objc/AppRTCMobile/ARDWebSocketChannel.m",
238 "objc/AppRTCMobile/RTCIceCandidate+JSON.h",
239 "objc/AppRTCMobile/RTCIceCandidate+JSON.m",
240 "objc/AppRTCMobile/RTCIceServer+JSON.h",
241 "objc/AppRTCMobile/RTCIceServer+JSON.m",
242 "objc/AppRTCMobile/RTCMediaConstraints+JSON.h",
243 "objc/AppRTCMobile/RTCMediaConstraints+JSON.m",
244 "objc/AppRTCMobile/RTCSessionDescription+JSON.h",
245 "objc/AppRTCMobile/RTCSessionDescription+JSON.m",
tkchin2ddfdba2016-08-07 21:37:45 -0700246 ]
247 configs += [
tkchin2ddfdba2016-08-07 21:37:45 -0700248 "//build/config/compiler:enable_arc",
249 ":warnings_config",
250 ]
ehmaldonadoe9cc6862016-09-05 06:10:18 -0700251 public_configs = [ ":apprtc_signaling_config" ]
tkchin2ddfdba2016-08-07 21:37:45 -0700252 deps = [
253 ":apprtc_common",
254 ":socketrocket",
255 ]
256 public_deps = [
257 "../sdk:rtc_sdk_peerconnection_objc",
258 ]
259 libs = [ "QuartzCore.framework" ]
260 }
261
262 if (is_ios) {
denicija77bfd7c2016-11-15 00:41:26 -0800263 rtc_static_library("AppRTCMobile_lib") {
tkchin2ddfdba2016-08-07 21:37:45 -0700264 sources = [
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200265 "objc/AppRTCMobile/ios/ARDAppDelegate.m",
266 "objc/AppRTCMobile/ios/ARDMainView.h",
267 "objc/AppRTCMobile/ios/ARDMainView.m",
268 "objc/AppRTCMobile/ios/ARDMainViewController.h",
269 "objc/AppRTCMobile/ios/ARDMainViewController.m",
denicija2256e042016-11-09 06:26:18 -0800270 "objc/AppRTCMobile/ios/ARDSettingsModel+Private.h",
271 "objc/AppRTCMobile/ios/ARDSettingsModel.h",
272 "objc/AppRTCMobile/ios/ARDSettingsModel.m",
273 "objc/AppRTCMobile/ios/ARDSettingsStore.h",
274 "objc/AppRTCMobile/ios/ARDSettingsStore.m",
denicijad17d5362016-11-02 02:56:09 -0700275 "objc/AppRTCMobile/ios/ARDSettingsViewController.h",
276 "objc/AppRTCMobile/ios/ARDSettingsViewController.m",
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200277 "objc/AppRTCMobile/ios/ARDStatsView.h",
278 "objc/AppRTCMobile/ios/ARDStatsView.m",
279 "objc/AppRTCMobile/ios/ARDVideoCallView.h",
280 "objc/AppRTCMobile/ios/ARDVideoCallView.m",
281 "objc/AppRTCMobile/ios/ARDVideoCallViewController.h",
282 "objc/AppRTCMobile/ios/ARDVideoCallViewController.m",
283 "objc/AppRTCMobile/ios/AppRTCMobile-Prefix.pch",
284 "objc/AppRTCMobile/ios/UIImage+ARDUtilities.h",
285 "objc/AppRTCMobile/ios/UIImage+ARDUtilities.m",
denicija77bfd7c2016-11-15 00:41:26 -0800286 ]
287 configs += [
288 "//build/config/compiler:enable_arc",
289 ":warnings_config",
290 ]
291
292 deps = [
293 ":apprtc_common",
294 ":apprtc_signaling",
295 ]
296 }
297
298 ios_app_bundle("AppRTCMobile") {
299 sources = [
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200300 "objc/AppRTCMobile/ios/main.m",
tkchin2ddfdba2016-08-07 21:37:45 -0700301 ]
302
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200303 info_plist = "objc/AppRTCMobile/ios/Info.plist"
tkchin2ddfdba2016-08-07 21:37:45 -0700304
denicija77bfd7c2016-11-15 00:41:26 -0800305 configs += [ "..:common_config" ]
tkchin2ddfdba2016-08-07 21:37:45 -0700306 public_configs = [ "..:common_inherited_config" ]
307
308 deps = [
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200309 ":AppRTCMobile_ios_bundle_data",
denicija77bfd7c2016-11-15 00:41:26 -0800310 ":AppRTCMobile_lib",
tkchin2ddfdba2016-08-07 21:37:45 -0700311 ]
312
313 if (target_cpu == "x86") {
314 deps += [ "//testing/iossim:iossim" ]
315 }
316 }
317
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200318 bundle_data("AppRTCMobile_ios_bundle_data") {
tkchin2ddfdba2016-08-07 21:37:45 -0700319 sources = [
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200320 "objc/AppRTCMobile/ios/resources/Roboto-Regular.ttf",
321 "objc/AppRTCMobile/ios/resources/iPhone5@2x.png",
322 "objc/AppRTCMobile/ios/resources/iPhone6@2x.png",
323 "objc/AppRTCMobile/ios/resources/iPhone6p@3x.png",
324 "objc/AppRTCMobile/ios/resources/ic_call_end_black_24dp.png",
325 "objc/AppRTCMobile/ios/resources/ic_call_end_black_24dp@2x.png",
326 "objc/AppRTCMobile/ios/resources/ic_clear_black_24dp.png",
327 "objc/AppRTCMobile/ios/resources/ic_clear_black_24dp@2x.png",
denicija6d6762c2016-10-28 04:53:16 -0700328 "objc/AppRTCMobile/ios/resources/ic_settings_black_24dp.png",
329 "objc/AppRTCMobile/ios/resources/ic_settings_black_24dp@2x.png",
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200330 "objc/AppRTCMobile/ios/resources/ic_surround_sound_black_24dp.png",
331 "objc/AppRTCMobile/ios/resources/ic_surround_sound_black_24dp@2x.png",
332 "objc/AppRTCMobile/ios/resources/ic_switch_video_black_24dp.png",
333 "objc/AppRTCMobile/ios/resources/ic_switch_video_black_24dp@2x.png",
334 "objc/AppRTCMobile/ios/resources/mozart.mp3",
tkchin2ddfdba2016-08-07 21:37:45 -0700335 "objc/Icon.png",
336 ]
337 outputs = [
338 "{{bundle_resources_dir}}/{{source_file_part}}",
339 ]
340 }
341 }
342
343 if (is_mac) {
denicija77bfd7c2016-11-15 00:41:26 -0800344 rtc_static_library("AppRTCMobile_lib") {
tkchin2ddfdba2016-08-07 21:37:45 -0700345 sources = [
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200346 "objc/AppRTCMobile/mac/APPRTCAppDelegate.h",
347 "objc/AppRTCMobile/mac/APPRTCAppDelegate.m",
348 "objc/AppRTCMobile/mac/APPRTCViewController.h",
349 "objc/AppRTCMobile/mac/APPRTCViewController.m",
tkchin2ddfdba2016-08-07 21:37:45 -0700350 ]
351 configs += [
tkchin2ddfdba2016-08-07 21:37:45 -0700352 "..:common_objc",
353 "//build/config/compiler:enable_arc",
354 ]
355 deps = [
356 ":apprtc_common",
357 ":apprtc_signaling",
358 ]
359 }
360
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200361 mac_app_bundle("AppRTCMobile") {
362 output_name = "AppRTCMobile"
tkchin2ddfdba2016-08-07 21:37:45 -0700363
364 extra_substitutions = [ "MACOSX_DEPLOYMENT_TARGET=10.8" ]
365
366 sources = [
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200367 "objc/AppRTCMobile/mac/main.m",
tkchin2ddfdba2016-08-07 21:37:45 -0700368 ]
369
370 public_configs = [ "..:common_inherited_config" ]
371
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200372 info_plist = "objc/AppRTCMobile/mac/Info.plist"
tkchin2ddfdba2016-08-07 21:37:45 -0700373
374 libs = [ "AppKit.framework" ]
375
376 deps = [
denicija77bfd7c2016-11-15 00:41:26 -0800377 ":AppRTCMobile_lib",
tkchin2ddfdba2016-08-07 21:37:45 -0700378 ]
379 }
380 }
381
382 config("socketrocket_include_config") {
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200383 include_dirs = [ "objc/AppRTCMobile/third_party/SocketRocket" ]
tkchin2ddfdba2016-08-07 21:37:45 -0700384 }
385
386 config("socketrocket_warning_config") {
387 # GN orders flags on a target before flags from configs. The default config
388 # adds these flags so to cancel them out they need to come from a config and
389 # cannot be on the target directly.
390 cflags = [
391 "-Wno-deprecated-declarations",
392 "-Wno-nonnull",
tkchin2ddfdba2016-08-07 21:37:45 -0700393 "-Wno-semicolon-before-method-body",
394 "-Wno-unused-variable",
395 ]
396
henrika27d8b612016-09-21 04:13:00 -0700397 cflags_objc = [
398 # Enabled for cflags_objc in build/config/compiler/BUILD.gn.
399 "-Wno-objc-missing-property-synthesis",
400
401 # Hide the warning for SecRandomCopyBytes(), until we update to upstream.
402 # https://bugs.chromium.org/p/webrtc/issues/detail?id=6396
403 "-Wno-unused-result",
404 ]
tkchin2ddfdba2016-08-07 21:37:45 -0700405
406 if (is_mac) {
407 cflags += [ "-Wno-partial-availability" ]
408 }
409 }
410
kjellanderb62dbbe2016-09-23 00:38:52 -0700411 rtc_static_library("socketrocket") {
tkchin2ddfdba2016-08-07 21:37:45 -0700412 sources = [
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200413 "objc/AppRTCMobile/third_party/SocketRocket/SRWebSocket.h",
414 "objc/AppRTCMobile/third_party/SocketRocket/SRWebSocket.m",
tkchin2ddfdba2016-08-07 21:37:45 -0700415 ]
416 configs += [
tkchin2ddfdba2016-08-07 21:37:45 -0700417 "//build/config/compiler:enable_arc",
418 ":socketrocket_warning_config",
419 ]
ehmaldonadoe9cc6862016-09-05 06:10:18 -0700420 public_configs = [ ":socketrocket_include_config" ]
tkchin2ddfdba2016-08-07 21:37:45 -0700421
422 libs = [
423 "CFNetwork.framework",
424 "icucore",
425 ]
426 }
adam.fedorbcc5d872016-11-07 14:53:28 -0800427
428 if (rtc_include_tests) {
429 config("rtc_apprtcmobile_config") {
430 defines = [ "GTEST_RELATIVE_PATH" ]
431 }
432
433 rtc_test("apprtcmobile_tests") {
denicija77bfd7c2016-11-15 00:41:26 -0800434 include_dirs = [ "objc/AppRTCMobile/ios" ]
adam.fedorbcc5d872016-11-07 14:53:28 -0800435 deps = [
denicija77bfd7c2016-11-15 00:41:26 -0800436 ":AppRTCMobile_lib",
adam.fedorbcc5d872016-11-07 14:53:28 -0800437 ":apprtc_signaling",
438 "//testing/gtest",
439 "//third_party/ocmock",
440 ]
441
442 sources = [
443 "objc/AppRTCMobile/tests/ARDAppClientTest.mm",
denicija77bfd7c2016-11-15 00:41:26 -0800444 "objc/AppRTCMobile/tests/ARDSettingsModelTests.mm",
adam.fedorbcc5d872016-11-07 14:53:28 -0800445 ]
446
447 if (is_ios) {
448 info_plist = "objc/AppRTCMobile/ios/Info.plist"
449 }
450
451 configs += [
452 ":rtc_apprtcmobile_config",
453 "//build/config/compiler:enable_arc",
454 ]
455 }
456 }
tkchin2ddfdba2016-08-07 21:37:45 -0700457}
kthelgason0727f152016-08-08 09:03:23 -0700458
459if (is_linux || is_win) {
ehmaldonadod02fe4b2016-08-26 13:31:24 -0700460 config("peerconnection_client_warnings_config") {
kjellander4a9abad2016-09-18 08:12:29 -0700461 cflags = []
ehmaldonadod02fe4b2016-08-26 13:31:24 -0700462 if (is_win && is_clang) {
kjellander4a9abad2016-09-18 08:12:29 -0700463 cflags += [
ehmaldonadod02fe4b2016-08-26 13:31:24 -0700464 # Disable warnings failing when compiling with Clang on Windows.
465 # https://bugs.chromium.org/p/webrtc/issues/detail?id=5366
466 "-Wno-format",
467
468 # See https://bugs.chromium.org/p/webrtc/issues/detail?id=6271
469 # for -Wno-reorder and -Wno-sign-compare
470 "-Wno-reorder",
471 "-Wno-sign-compare",
472 ]
473 }
kjellanderd4626e52016-09-07 02:33:01 -0700474 if (is_linux && target_cpu == "x86") {
kjellander4a9abad2016-09-18 08:12:29 -0700475 cflags += [
kjellanderd4626e52016-09-07 02:33:01 -0700476 # Needed to compile on Linux 32-bit.
477 "-Wno-sentinel",
478 ]
479 }
kjellander4a9abad2016-09-18 08:12:29 -0700480
481 if (is_clang) {
482 # TODO(ehmaldonado): Make peerconnection_client compile with the standard
483 # set of warnings.
484 # See https://bugs.chromium.org/p/webrtc/issues/detail?id=6306
485 cflags += [ "-Wno-inconsistent-missing-override" ]
486 }
ehmaldonadod02fe4b2016-08-26 13:31:24 -0700487 }
488
ehmaldonado38a21322016-09-02 04:10:34 -0700489 rtc_executable("peerconnection_client") {
kthelgason0727f152016-08-08 09:03:23 -0700490 sources = [
491 "peerconnection/client/conductor.cc",
492 "peerconnection/client/conductor.h",
493 "peerconnection/client/defaults.cc",
494 "peerconnection/client/defaults.h",
495 "peerconnection/client/peer_connection_client.cc",
496 "peerconnection/client/peer_connection_client.h",
497 ]
ehmaldonado7a2ce0b2016-09-05 01:35:44 -0700498
kjellandere40a7ee2016-10-16 23:56:12 -0700499 if (!build_with_chromium && is_clang) {
500 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
ehmaldonado38a21322016-09-02 04:10:34 -0700501 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
kthelgason0727f152016-08-08 09:03:23 -0700502 }
503 if (is_win) {
504 sources += [
505 "peerconnection/client/flagdefs.h",
506 "peerconnection/client/main.cc",
507 "peerconnection/client/main_wnd.cc",
508 "peerconnection/client/main_wnd.h",
509 ]
510 cflags = [ "/wd4245" ]
511 configs += [ "//build/config/win:windowed" ]
512 }
thomasandersonef16e992016-12-13 02:57:43 -0800513 deps = [
514 "//third_party/libyuv",
515 "//webrtc/api:libjingle_peerconnection",
516 "//webrtc/system_wrappers:field_trial_default",
517 "//webrtc/system_wrappers:metrics_default",
518 ]
kthelgason0727f152016-08-08 09:03:23 -0700519 if (is_linux) {
520 sources += [
521 "peerconnection/client/linux/main.cc",
522 "peerconnection/client/linux/main_wnd.cc",
523 "peerconnection/client/linux/main_wnd.h",
524 ]
525 libs = [
526 "X11",
527 "Xcomposite",
528 "Xext",
529 "Xrender",
530 ]
thomasandersonef16e992016-12-13 02:57:43 -0800531 deps += [ "//build/config/linux/gtk" ]
kthelgason0727f152016-08-08 09:03:23 -0700532 }
ehmaldonadod02fe4b2016-08-26 13:31:24 -0700533 configs += [ ":peerconnection_client_warnings_config" ]
kthelgason0727f152016-08-08 09:03:23 -0700534 if (rtc_build_json) {
535 deps += [ "//third_party/jsoncpp" ]
536 }
537 }
kjellanderd4626e52016-09-07 02:33:01 -0700538
ehmaldonado38a21322016-09-02 04:10:34 -0700539 rtc_executable("peerconnection_server") {
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") {
kthelgason0727f152016-08-08 09:03:23 -0700560 sources = [
561 "relayserver/relayserver_main.cc",
562 ]
563 deps = [
564 "//webrtc/base:rtc_base_approved",
565 "//webrtc/pc:rtc_pc",
566 "//webrtc/system_wrappers:field_trial_default",
567 "//webrtc/system_wrappers:metrics_default",
568 ]
kjellandere40a7ee2016-10-16 23:56:12 -0700569 if (!build_with_chromium && is_clang) {
570 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
ehmaldonado38a21322016-09-02 04:10:34 -0700571 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
kthelgason0727f152016-08-08 09:03:23 -0700572 }
573 }
ehmaldonado38a21322016-09-02 04:10:34 -0700574 rtc_executable("turnserver") {
kthelgason0727f152016-08-08 09:03:23 -0700575 sources = [
576 "turnserver/turnserver_main.cc",
577 ]
578 deps = [
579 "//webrtc/base:rtc_base_approved",
580 "//webrtc/pc:rtc_pc",
581 "//webrtc/system_wrappers:field_trial_default",
582 "//webrtc/system_wrappers:metrics_default",
583 ]
kjellandere40a7ee2016-10-16 23:56:12 -0700584 if (!build_with_chromium && is_clang) {
585 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
ehmaldonado38a21322016-09-02 04:10:34 -0700586 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
kthelgason0727f152016-08-08 09:03:23 -0700587 }
588 }
ehmaldonado38a21322016-09-02 04:10:34 -0700589 rtc_executable("stunserver") {
kthelgason0727f152016-08-08 09:03:23 -0700590 sources = [
591 "stunserver/stunserver_main.cc",
592 ]
593 deps = [
594 "//webrtc/base:rtc_base_approved",
595 "//webrtc/pc:rtc_pc",
596 "//webrtc/system_wrappers:field_trial_default",
597 "//webrtc/system_wrappers:metrics_default",
598 ]
kjellandere40a7ee2016-10-16 23:56:12 -0700599 if (!build_with_chromium && is_clang) {
600 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
ehmaldonado38a21322016-09-02 04:10:34 -0700601 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
kthelgason0727f152016-08-08 09:03:23 -0700602 }
603 }
604}
charujainaca3a242016-11-01 03:09:15 -0700605
606if (!build_with_chromium) {
607 # Doesn't build within Chrome on Win.
608 rtc_executable("stun_prober") {
609 sources = [
610 "stunprober/main.cc",
611 ]
612
613 if (!build_with_chromium && is_clang) {
614 # Suppress warnings from Chrome's Clang plugins.
615 # See http://code.google.com/p/webrtc/issues/detail?id=163 for details.
616 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
617 }
618
619 deps = [
620 "../p2p:libstunprober",
621 "../p2p:rtc_p2p",
622 "../system_wrappers:field_trial_default",
623 ]
624 }
625}