blob: 9fc22aa60f01be3d98a8e71a8411e579b2e3293c [file] [log] [blame]
tkchin9eeb6242016-04-27 08:54:201# Copyright 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 14:58:229import("../webrtc.gni")
kthelgasonebc34e72016-09-15 11:30:1810if (is_ios) {
11 import("//build/config/ios/rules.gni")
oprypin45197522017-06-22 08:47:2012 import("//build/config/ios/ios_sdk.gni")
kthelgasonebc34e72016-09-15 11:30:1813}
tkchin9eeb6242016-04-27 08:54:2014
kthelgason2f088792017-05-30 08:48:4715declare_args() {
16 # Determine whether or not to include metal rendering
17 rtc_use_metal_rendering = is_mac || (is_ios && current_cpu == "arm64")
18}
19
kjellander6ceab082016-10-28 12:44:0320group("sdk") {
mbonadei2c8ac1b2017-05-31 12:14:2621 if (!build_with_chromium && is_ios) {
kjellander6ceab082016-10-28 12:44:0322 public_deps = [
kthelgason2f088792017-05-30 08:48:4723 ":objc_framework",
kjellander6ceab082016-10-28 12:44:0324 ]
25 }
26}
27
kthelgasoncc2d1c62016-11-09 15:44:2728if (is_ios || is_mac) {
kthelgason2f088792017-05-30 08:48:4729 config("objc_common_config") {
kjellander080a1e32016-05-25 18:37:1130 include_dirs = [
31 "objc/Framework/Classes",
kthelgason2f088792017-05-30 08:48:4732 "objc/Framework/Classes/Audio",
33 "objc/Framework/Classes/Common",
34 "objc/Framework/Classes/Metal",
35 "objc/Framework/Classes/PeerConnection",
36 "objc/Framework/Classes/UI",
37 "objc/Framework/Classes/Video",
38 "objc/Framework/Classes/VideoToolbox",
kjellander080a1e32016-05-25 18:37:1139 "objc/Framework/Headers",
40 ]
41 }
42
kthelgason2f088792017-05-30 08:48:4743 rtc_static_library("objc_common") {
tkchin9eeb6242016-04-27 08:54:2044 sources = [
kthelgason2f088792017-05-30 08:48:4745 "objc/Framework/Classes/Common/NSString+StdString.h",
46 "objc/Framework/Classes/Common/NSString+StdString.mm",
47 "objc/Framework/Classes/Common/RTCDispatcher+Private.h",
48 "objc/Framework/Classes/Common/RTCDispatcher.m",
49 "objc/Framework/Classes/Common/RTCFieldTrials.mm",
50 "objc/Framework/Classes/Common/RTCLogging.mm",
Anders Carlssonfc309752017-06-12 12:16:2051 "objc/Framework/Classes/Common/RTCUIApplicationStatusObserver.h",
52 "objc/Framework/Classes/Common/RTCUIApplicationStatusObserver.m",
kthelgason2f088792017-05-30 08:48:4753 "objc/Framework/Classes/Common/helpers.h",
54 "objc/Framework/Classes/Common/helpers.mm",
tkchin9eeb6242016-04-27 08:54:2055 "objc/Framework/Headers/WebRTC/RTCDispatcher.h",
56 "objc/Framework/Headers/WebRTC/RTCFieldTrials.h",
57 "objc/Framework/Headers/WebRTC/RTCLogging.h",
58 "objc/Framework/Headers/WebRTC/RTCMacros.h",
tkchin9eeb6242016-04-27 08:54:2059 ]
denicijad2088152017-04-28 09:14:5460
mbonadei1e060c62017-04-21 07:02:0261 deps = [
62 "../base:rtc_base",
63 ]
kthelgasonc0977102017-04-24 07:57:1664 configs += [ "..:common_objc" ]
65
kthelgason2f088792017-05-30 08:48:4766 public_configs = [ ":objc_common_config" ]
denicijad2088152017-04-28 09:14:5467
kjellander3bcedd32016-06-08 08:14:1568 if (is_ios) {
69 sources += [
kthelgason2f088792017-05-30 08:48:4770 "objc/Framework/Classes/Common/UIDevice+RTCDevice.mm",
tkchind7629102016-07-28 21:52:5571 "objc/Framework/Headers/WebRTC/UIDevice+RTCDevice.h",
kjellander3bcedd32016-06-08 08:14:1572 ]
denicijad2088152017-04-28 09:14:5473 }
74
kthelgason2f088792017-05-30 08:48:4775 if (!build_with_chromium) {
denicijad2088152017-04-28 09:14:5476 sources += [
kthelgason2f088792017-05-30 08:48:4777 "objc/Framework/Classes/Common/RTCFileLogger.mm",
78 "objc/Framework/Headers/WebRTC/RTCFileLogger.h",
79 ]
80 }
81 }
82
mbonadei2c8ac1b2017-05-31 12:14:2683 if (!build_with_chromium) {
denicija59ee91b2017-06-05 12:48:4784 rtc_static_library("objc_audio") {
85 sources = [
86 "objc/Framework/Classes/Audio/RTCAudioSession+Configuration.mm",
87 "objc/Framework/Classes/Audio/RTCAudioSession+Private.h",
88 "objc/Framework/Classes/Audio/RTCAudioSession.mm",
89 "objc/Framework/Classes/Audio/RTCAudioSessionConfiguration.m",
90 "objc/Framework/Headers/WebRTC/RTCAudioSession.h",
91 "objc/Framework/Headers/WebRTC/RTCAudioSessionConfiguration.h",
92 ]
93 configs += [ "..:common_objc" ]
94
95 deps = [
96 ":objc_common",
97 "../base:rtc_base_approved",
98 ]
99
100 if (is_clang) {
101 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
102 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
103 }
104 }
mbonadei2c8ac1b2017-05-31 12:14:26105 rtc_static_library("objc_video") {
kthelgason2f088792017-05-30 08:48:47106 sources = [
mbonadei2c8ac1b2017-05-31 12:14:26107 "objc/Framework/Classes/Video/RTCAVFoundationVideoCapturerInternal.h",
108 "objc/Framework/Classes/Video/RTCAVFoundationVideoCapturerInternal.mm",
109 "objc/Framework/Classes/Video/RTCDefaultShader.h",
110 "objc/Framework/Classes/Video/RTCDefaultShader.mm",
111 "objc/Framework/Classes/Video/RTCI420TextureCache.h",
112 "objc/Framework/Classes/Video/RTCI420TextureCache.mm",
113 "objc/Framework/Classes/Video/RTCOpenGLDefines.h",
114 "objc/Framework/Classes/Video/RTCShader.h",
115 "objc/Framework/Classes/Video/RTCShader.mm",
116 "objc/Framework/Classes/Video/avfoundationformatmapper.h",
117 "objc/Framework/Classes/Video/avfoundationformatmapper.mm",
118 "objc/Framework/Classes/Video/avfoundationvideocapturer.h",
119 "objc/Framework/Classes/Video/avfoundationvideocapturer.mm",
120 "objc/Framework/Classes/Video/objcvideotracksource.h",
121 "objc/Framework/Classes/Video/objcvideotracksource.mm",
kthelgason2f088792017-05-30 08:48:47122 ]
mbonadei2c8ac1b2017-05-31 12:14:26123 libs = []
denicijad2088152017-04-28 09:14:54124 if (is_ios) {
denicija070d5e32017-02-26 19:44:13125 sources += [
mbonadei2c8ac1b2017-05-31 12:14:26126 "objc/Framework/Classes/Video/RTCNV12TextureCache.h",
127 "objc/Framework/Classes/Video/RTCNV12TextureCache.m",
128 ]
129 libs += [
130 "GLKit.framework",
131 "OpenGLES.framework",
132 "QuartzCore.framework",
133 ]
134 } else if (is_mac) {
135 sources += []
136
137 libs += [
138 "CoreMedia.framework",
139 "CoreVideo.framework",
140 "OpenGL.framework",
denicija070d5e32017-02-26 19:44:13141 ]
142 }
mbonadei2c8ac1b2017-05-31 12:14:26143
kthelgason2f088792017-05-30 08:48:47144 deps = [
mbonadei2c8ac1b2017-05-31 12:14:26145 ":objc_common",
Anders Carlsson0789dab2017-06-21 08:41:26146 ":objc_corevideoframebuffer",
147 ":objc_videotoolbox",
mbonadei2c8ac1b2017-05-31 12:14:26148 "../api:libjingle_peerconnection_api",
149 "../base:rtc_base",
150 "../common_video",
151 "../media:rtc_media_base",
tkchin9eeb6242016-04-27 08:54:20152 ]
mbonadei2c8ac1b2017-05-31 12:14:26153
kthelgason2f088792017-05-30 08:48:47154 configs += [ "..:common_objc" ]
ehmaldonadoda8dcfb2017-01-04 15:11:23155 if (!build_with_chromium && is_clang) {
156 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
157 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
158 }
159 }
ehmaldonadoda8dcfb2017-01-04 15:11:23160
mbonadei2c8ac1b2017-05-31 12:14:26161 rtc_static_library("objc_ui") {
162 if (is_ios) {
163 sources = [
164 "objc/Framework/Classes/UI/RTCCameraPreviewView.m",
165 "objc/Framework/Classes/UI/RTCEAGLVideoView.m",
166 "objc/Framework/Headers/WebRTC/RTCCameraPreviewView.h",
167 "objc/Framework/Headers/WebRTC/RTCEAGLVideoView.h",
168 ]
169 }
170 if (is_mac) {
171 sources = [
172 "objc/Framework/Classes/UI/RTCNSGLVideoView.m",
173 "objc/Framework/Headers/WebRTC/RTCNSGLVideoView.h",
174 ]
175 }
176 configs += [ "..:common_objc" ]
177 deps = [
178 ":objc_common",
179 ":objc_peerconnection",
180 ]
181 }
kthelgasonebc34e72016-09-15 11:30:18182
mbonadei2c8ac1b2017-05-31 12:14:26183 if (rtc_use_metal_rendering) {
184 rtc_static_library("objc_metal") {
185 sources = [
186 "objc/Framework/Classes/Metal/RTCMTLI420Renderer.h",
187 "objc/Framework/Classes/Metal/RTCMTLI420Renderer.mm",
188 "objc/Framework/Classes/Metal/RTCMTLRenderer+Private.h",
189 "objc/Framework/Classes/Metal/RTCMTLRenderer.h",
190 "objc/Framework/Classes/Metal/RTCMTLRenderer.mm",
191 ]
192 if (is_ios) {
193 sources += [
194 "objc/Framework/Classes/Metal/RTCMTLNV12Renderer.h",
195 "objc/Framework/Classes/Metal/RTCMTLNV12Renderer.mm",
196 "objc/Framework/Classes/Metal/RTCMTLVideoView.m",
197 "objc/Framework/Headers/WebRTC/RTCMTLVideoView.h",
198 ]
199 }
200 if (is_mac) {
201 sources += [
202 "objc/Framework/Classes/Metal/RTCMTLNSVideoView.m",
203 "objc/Framework/Headers/WebRTC/RTCMTLNSVideoView.h",
204 ]
205 }
206 libs = [
207 "CoreVideo.framework",
208 "Metal.framework",
209 "MetalKit.framework",
210 ]
211 deps = [
212 ":objc_video",
213 "../api:video_frame_api",
214 "../base:rtc_base_approved",
215 ]
216 configs += [ "..:common_objc" ]
217 public_configs = [ ":objc_common_config" ]
218 }
219 }
220
221 rtc_static_library("objc_peerconnection") {
222 sources = [
223 "objc/Framework/Classes/PeerConnection/RTCAVFoundationVideoSource+Private.h",
224 "objc/Framework/Classes/PeerConnection/RTCAVFoundationVideoSource.mm",
225 "objc/Framework/Classes/PeerConnection/RTCAudioSource+Private.h",
226 "objc/Framework/Classes/PeerConnection/RTCAudioSource.mm",
227 "objc/Framework/Classes/PeerConnection/RTCAudioTrack+Private.h",
228 "objc/Framework/Classes/PeerConnection/RTCAudioTrack.mm",
229 "objc/Framework/Classes/PeerConnection/RTCCameraVideoCapturer.m",
230 "objc/Framework/Classes/PeerConnection/RTCConfiguration+Private.h",
231 "objc/Framework/Classes/PeerConnection/RTCConfiguration.mm",
232 "objc/Framework/Classes/PeerConnection/RTCDataChannel+Private.h",
233 "objc/Framework/Classes/PeerConnection/RTCDataChannel.mm",
234 "objc/Framework/Classes/PeerConnection/RTCDataChannelConfiguration+Private.h",
235 "objc/Framework/Classes/PeerConnection/RTCDataChannelConfiguration.mm",
236 "objc/Framework/Classes/PeerConnection/RTCIceCandidate+Private.h",
237 "objc/Framework/Classes/PeerConnection/RTCIceCandidate.mm",
238 "objc/Framework/Classes/PeerConnection/RTCIceServer+Private.h",
239 "objc/Framework/Classes/PeerConnection/RTCIceServer.mm",
240 "objc/Framework/Classes/PeerConnection/RTCLegacyStatsReport+Private.h",
241 "objc/Framework/Classes/PeerConnection/RTCLegacyStatsReport.mm",
242 "objc/Framework/Classes/PeerConnection/RTCMediaConstraints+Private.h",
243 "objc/Framework/Classes/PeerConnection/RTCMediaConstraints.mm",
244 "objc/Framework/Classes/PeerConnection/RTCMediaSource+Private.h",
245 "objc/Framework/Classes/PeerConnection/RTCMediaSource.mm",
246 "objc/Framework/Classes/PeerConnection/RTCMediaStream+Private.h",
247 "objc/Framework/Classes/PeerConnection/RTCMediaStream.mm",
248 "objc/Framework/Classes/PeerConnection/RTCMediaStreamTrack+Private.h",
249 "objc/Framework/Classes/PeerConnection/RTCMediaStreamTrack.mm",
250 "objc/Framework/Classes/PeerConnection/RTCMetrics.mm",
251 "objc/Framework/Classes/PeerConnection/RTCMetricsSampleInfo+Private.h",
252 "objc/Framework/Classes/PeerConnection/RTCMetricsSampleInfo.mm",
253 "objc/Framework/Classes/PeerConnection/RTCPeerConnection+DataChannel.mm",
254 "objc/Framework/Classes/PeerConnection/RTCPeerConnection+Private.h",
255 "objc/Framework/Classes/PeerConnection/RTCPeerConnection+Stats.mm",
256 "objc/Framework/Classes/PeerConnection/RTCPeerConnection.mm",
257 "objc/Framework/Classes/PeerConnection/RTCPeerConnectionFactory+Private.h",
258 "objc/Framework/Classes/PeerConnection/RTCPeerConnectionFactory.mm",
259 "objc/Framework/Classes/PeerConnection/RTCRtpCodecParameters+Private.h",
260 "objc/Framework/Classes/PeerConnection/RTCRtpCodecParameters.mm",
261 "objc/Framework/Classes/PeerConnection/RTCRtpEncodingParameters+Private.h",
262 "objc/Framework/Classes/PeerConnection/RTCRtpEncodingParameters.mm",
263 "objc/Framework/Classes/PeerConnection/RTCRtpParameters+Private.h",
264 "objc/Framework/Classes/PeerConnection/RTCRtpParameters.mm",
265 "objc/Framework/Classes/PeerConnection/RTCRtpReceiver+Private.h",
266 "objc/Framework/Classes/PeerConnection/RTCRtpReceiver.mm",
267 "objc/Framework/Classes/PeerConnection/RTCRtpSender+Private.h",
268 "objc/Framework/Classes/PeerConnection/RTCRtpSender.mm",
269 "objc/Framework/Classes/PeerConnection/RTCSSLAdapter.mm",
270 "objc/Framework/Classes/PeerConnection/RTCSessionDescription+Private.h",
271 "objc/Framework/Classes/PeerConnection/RTCSessionDescription.mm",
272 "objc/Framework/Classes/PeerConnection/RTCTracing.mm",
273 "objc/Framework/Classes/PeerConnection/RTCVideoCapturer.m",
Anders Carlsson0789dab2017-06-21 08:41:26274 "objc/Framework/Classes/PeerConnection/RTCVideoFrame+Private.h",
mbonadei2c8ac1b2017-05-31 12:14:26275 "objc/Framework/Classes/PeerConnection/RTCVideoFrame.mm",
276 "objc/Framework/Classes/PeerConnection/RTCVideoRendererAdapter+Private.h",
277 "objc/Framework/Classes/PeerConnection/RTCVideoRendererAdapter.h",
278 "objc/Framework/Classes/PeerConnection/RTCVideoRendererAdapter.mm",
279 "objc/Framework/Classes/PeerConnection/RTCVideoSource+Private.h",
280 "objc/Framework/Classes/PeerConnection/RTCVideoSource.mm",
281 "objc/Framework/Classes/PeerConnection/RTCVideoTrack+Private.h",
282 "objc/Framework/Classes/PeerConnection/RTCVideoTrack.mm",
kthelgason5fe4d492016-12-05 19:27:30283 "objc/Framework/Headers/WebRTC/RTCAVFoundationVideoSource.h",
Kári Tristan Helgasonf93f5a42017-05-31 08:04:55284 "objc/Framework/Headers/WebRTC/RTCAudioSource.h",
285 "objc/Framework/Headers/WebRTC/RTCAudioTrack.h",
286 "objc/Framework/Headers/WebRTC/RTCCameraVideoCapturer.h",
kthelgason5fe4d492016-12-05 19:27:30287 "objc/Framework/Headers/WebRTC/RTCConfiguration.h",
288 "objc/Framework/Headers/WebRTC/RTCDataChannel.h",
289 "objc/Framework/Headers/WebRTC/RTCDataChannelConfiguration.h",
kthelgason5fe4d492016-12-05 19:27:30290 "objc/Framework/Headers/WebRTC/RTCIceCandidate.h",
291 "objc/Framework/Headers/WebRTC/RTCIceServer.h",
292 "objc/Framework/Headers/WebRTC/RTCLegacyStatsReport.h",
kthelgason5fe4d492016-12-05 19:27:30293 "objc/Framework/Headers/WebRTC/RTCMediaConstraints.h",
294 "objc/Framework/Headers/WebRTC/RTCMediaSource.h",
295 "objc/Framework/Headers/WebRTC/RTCMediaStream.h",
296 "objc/Framework/Headers/WebRTC/RTCMediaStreamTrack.h",
297 "objc/Framework/Headers/WebRTC/RTCMetrics.h",
298 "objc/Framework/Headers/WebRTC/RTCMetricsSampleInfo.h",
299 "objc/Framework/Headers/WebRTC/RTCPeerConnection.h",
300 "objc/Framework/Headers/WebRTC/RTCPeerConnectionFactory.h",
301 "objc/Framework/Headers/WebRTC/RTCRtpCodecParameters.h",
302 "objc/Framework/Headers/WebRTC/RTCRtpEncodingParameters.h",
303 "objc/Framework/Headers/WebRTC/RTCRtpParameters.h",
304 "objc/Framework/Headers/WebRTC/RTCRtpReceiver.h",
305 "objc/Framework/Headers/WebRTC/RTCRtpSender.h",
306 "objc/Framework/Headers/WebRTC/RTCSSLAdapter.h",
307 "objc/Framework/Headers/WebRTC/RTCSessionDescription.h",
308 "objc/Framework/Headers/WebRTC/RTCTracing.h",
hewwattace5c882017-04-27 13:26:19309 "objc/Framework/Headers/WebRTC/RTCVideoCapturer.h",
kthelgason5fe4d492016-12-05 19:27:30310 "objc/Framework/Headers/WebRTC/RTCVideoFrame.h",
311 "objc/Framework/Headers/WebRTC/RTCVideoRenderer.h",
312 "objc/Framework/Headers/WebRTC/RTCVideoSource.h",
313 "objc/Framework/Headers/WebRTC/RTCVideoTrack.h",
magjed13941912017-05-30 13:11:58314 "objc/Framework/Headers/WebRTC/RTCVideoViewShading.h",
kthelgason5fe4d492016-12-05 19:27:30315 ]
denicija0d4d57f2017-06-02 14:15:14316 if (is_ios) {
317 sources += [
318 "objc/Framework/Classes/PeerConnection/RTCFileVideoCapturer.h",
319 "objc/Framework/Classes/PeerConnection/RTCFileVideoCapturer.m",
320 ]
321 }
mbonadei2c8ac1b2017-05-31 12:14:26322 libs = [ "AVFoundation.framework" ]
323
324 if (is_ios) {
325 libs += [ "CoreGraphics.framework" ]
Kári Tristan Helgasonf93f5a42017-05-31 08:04:55326 }
kthelgasonebc34e72016-09-15 11:30:18327
kthelgasonc0977102017-04-24 07:57:16328 configs += [ "..:common_objc" ]
329
kthelgason2f088792017-05-30 08:48:47330 public_configs = [ ":objc_common_config" ]
kthelgasonc0977102017-04-24 07:57:16331
kjellandere40a7ee2016-10-17 06:56:12332 if (!build_with_chromium && is_clang) {
mbonadei2c8ac1b2017-05-31 12:14:26333 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
334 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
335 }
336
337 deps = [
338 ":objc_common",
Anders Carlsson0789dab2017-06-21 08:41:26339 ":objc_corevideoframebuffer",
mbonadei2c8ac1b2017-05-31 12:14:26340 ":objc_video",
341 "../api:video_frame_api",
342 "../base:rtc_base",
343 "../media:rtc_media_base",
344 "../pc:libjingle_peerconnection",
345 ]
346
347 if (rtc_use_metal_rendering) {
348 deps += [ ":objc_metal" ]
349 }
350
351 if (rtc_build_libyuv) {
352 deps += [ "$rtc_libyuv_dir" ]
353 public_deps = [
354 "$rtc_libyuv_dir",
355 ]
kthelgasonebc34e72016-09-15 11:30:18356 }
357 }
Zeke Chindd0e1e02016-10-11 20:27:26358
mbonadei2c8ac1b2017-05-31 12:14:26359 if (rtc_include_tests) {
360 rtc_source_set("objc_sdk_unittests") {
361 testonly = true
Kári Tristan Helgasoncbe74352016-11-09 09:43:26362
mbonadei2c8ac1b2017-05-31 12:14:26363 # Skip restricting visibility on mobile platforms since the tests on those
364 # gets additional generated targets which would require many lines here to
365 # cover (which would be confusing to read and hard to maintain).
366 if (!is_android && !is_ios) {
367 visibility = [ "..:rtc_unittests" ]
368 }
369 sources = [
mbonadei2c8ac1b2017-05-31 12:14:26370 "objc/Framework/UnitTests/RTCConfigurationTest.mm",
371 "objc/Framework/UnitTests/RTCDataChannelConfigurationTest.mm",
372 "objc/Framework/UnitTests/RTCIceCandidateTest.mm",
373 "objc/Framework/UnitTests/RTCIceServerTest.mm",
374 "objc/Framework/UnitTests/RTCMediaConstraintsTest.mm",
375 "objc/Framework/UnitTests/RTCPeerConnectionTest.mm",
376 "objc/Framework/UnitTests/RTCSessionDescriptionTest.mm",
377 "objc/Framework/UnitTests/avformatmappertests.mm",
378 ]
oprypin45197522017-06-22 08:47:20379 if (is_ios &&
380 !(use_ios_simulator &&
381 # The tests crash on these simulator versions:
382 (ios_sdk_version == "10.0" || ios_sdk_version == "10.1"))) {
383 sources +=
384 [ "objc/Framework/UnitTests/RTCCameraVideoCapturerTests.mm" ]
385 }
mbonadeid7620582017-05-30 08:50:35386
mbonadei2c8ac1b2017-05-31 12:14:26387 # |-ObjC| flag needed to make sure category method implementations
388 # are included:
389 # https://developer.apple.com/library/mac/qa/qa1490/_index.html
390 ldflags = [ "-ObjC" ]
magjed3149e092017-05-08 12:32:05391
mbonadei2c8ac1b2017-05-31 12:14:26392 defines = [ "GTEST_RELATIVE_PATH" ]
393 deps = [
394 ":objc_peerconnection",
395 "..//system_wrappers:system_wrappers_default",
396 "../base:rtc_base_tests_utils",
397 "../system_wrappers:system_wrappers_default",
398 "//third_party/ocmock",
399 ]
magjed3149e092017-05-08 12:32:05400
denicija59ee91b2017-06-05 12:48:47401 if (is_ios) {
402 sources += [ "objc/Framework/UnitTests/RTCAudioSessionTest.mm" ]
403
404 # RTCMTLVideoView not supported on 32-bit arm
405 if (current_cpu != "arm") {
406 sources += [ "objc/Framework/UnitTests/RTCMTLVideoViewTests.mm" ]
407 if (current_cpu != "arm64") {
408 # Only include this file on simulator, as it's already
409 # included in device builds.
410 sources += [ "objc/Framework/Classes/Metal/RTCMTLVideoView.m" ]
411 libs = [ "CoreVideo.framework" ]
412 }
mbonadei2c8ac1b2017-05-31 12:14:26413 }
414 }
mbonadei2c8ac1b2017-05-31 12:14:26415 if (!build_with_chromium && is_clang) {
416 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
417 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
418 }
419 }
kthelgason2f088792017-05-30 08:48:47420 }
421
mbonadei2c8ac1b2017-05-31 12:14:26422 if (is_ios) {
423 ios_framework_bundle("objc_framework") {
424 info_plist = "objc/Framework/Info.plist"
425 output_name = "WebRTC"
magjed3149e092017-05-08 12:32:05426
mbonadei2c8ac1b2017-05-31 12:14:26427 common_objc_headers = [
denicija59ee91b2017-06-05 12:48:47428 "objc/Framework/Headers/WebRTC/RTCAudioSession.h",
429 "objc/Framework/Headers/WebRTC/RTCAudioSessionConfiguration.h",
mbonadei2c8ac1b2017-05-31 12:14:26430 "objc/Framework/Headers/WebRTC/RTCAVFoundationVideoSource.h",
431 "objc/Framework/Headers/WebRTC/RTCAudioSource.h",
432 "objc/Framework/Headers/WebRTC/RTCAudioTrack.h",
433 "objc/Framework/Headers/WebRTC/RTCCameraVideoCapturer.h",
434 "objc/Framework/Headers/WebRTC/RTCCameraPreviewView.h",
435 "objc/Framework/Headers/WebRTC/RTCConfiguration.h",
436 "objc/Framework/Headers/WebRTC/RTCDataChannel.h",
437 "objc/Framework/Headers/WebRTC/RTCDataChannelConfiguration.h",
438 "objc/Framework/Headers/WebRTC/RTCDispatcher.h",
439 "objc/Framework/Headers/WebRTC/RTCEAGLVideoView.h",
440 "objc/Framework/Headers/WebRTC/RTCFieldTrials.h",
441 "objc/Framework/Headers/WebRTC/RTCIceCandidate.h",
442 "objc/Framework/Headers/WebRTC/RTCIceServer.h",
443 "objc/Framework/Headers/WebRTC/RTCLegacyStatsReport.h",
444 "objc/Framework/Headers/WebRTC/RTCLogging.h",
445 "objc/Framework/Headers/WebRTC/RTCMacros.h",
446 "objc/Framework/Headers/WebRTC/RTCMediaConstraints.h",
447 "objc/Framework/Headers/WebRTC/RTCMediaSource.h",
448 "objc/Framework/Headers/WebRTC/RTCMediaStream.h",
449 "objc/Framework/Headers/WebRTC/RTCMediaStreamTrack.h",
450 "objc/Framework/Headers/WebRTC/RTCMetrics.h",
451 "objc/Framework/Headers/WebRTC/RTCMetricsSampleInfo.h",
452 "objc/Framework/Headers/WebRTC/RTCPeerConnection.h",
453 "objc/Framework/Headers/WebRTC/RTCPeerConnectionFactory.h",
454 "objc/Framework/Headers/WebRTC/RTCRtpCodecParameters.h",
455 "objc/Framework/Headers/WebRTC/RTCRtpEncodingParameters.h",
456 "objc/Framework/Headers/WebRTC/RTCRtpParameters.h",
457 "objc/Framework/Headers/WebRTC/RTCRtpReceiver.h",
458 "objc/Framework/Headers/WebRTC/RTCRtpSender.h",
459 "objc/Framework/Headers/WebRTC/RTCSSLAdapter.h",
460 "objc/Framework/Headers/WebRTC/RTCSessionDescription.h",
461 "objc/Framework/Headers/WebRTC/RTCTracing.h",
462 "objc/Framework/Headers/WebRTC/RTCVideoCapturer.h",
463 "objc/Framework/Headers/WebRTC/RTCVideoFrame.h",
464 "objc/Framework/Headers/WebRTC/RTCVideoRenderer.h",
465 "objc/Framework/Headers/WebRTC/RTCVideoSource.h",
466 "objc/Framework/Headers/WebRTC/RTCVideoTrack.h",
467 "objc/Framework/Headers/WebRTC/RTCVideoViewShading.h",
468 "objc/Framework/Headers/WebRTC/UIDevice+RTCDevice.h",
469 "objc/Framework/Headers/WebRTC/WebRTC.h",
470 ]
471 if (rtc_use_metal_rendering) {
472 common_objc_headers +=
473 [ "objc/Framework/Headers/WebRTC/RTCMTLVideoView.h" ]
474 }
475 sources = common_objc_headers
476 public_headers = common_objc_headers
Kári Tristan Helgasoncbe74352016-11-09 09:43:26477
mbonadei2c8ac1b2017-05-31 12:14:26478 if (!build_with_chromium) {
479 sources += [ "objc/Framework/Headers/WebRTC/RTCFileLogger.h" ]
480 public_headers += [ "objc/Framework/Headers/WebRTC/RTCFileLogger.h" ]
481 }
Kári Tristan Helgasoncbe74352016-11-09 09:43:26482
mbonadei2c8ac1b2017-05-31 12:14:26483 ldflags = [
484 "-all_load",
485 "-install_name",
486 "@rpath/$output_name.framework/$output_name",
487 ]
Kári Tristan Helgasoncbe74352016-11-09 09:43:26488
mbonadei2c8ac1b2017-05-31 12:14:26489 deps = [
denicija59ee91b2017-06-05 12:48:47490 ":objc_audio",
mbonadei2c8ac1b2017-05-31 12:14:26491 ":objc_peerconnection",
492 ":objc_ui",
493 "../base:rtc_base_approved",
494 "../system_wrappers:field_trial_default",
495 "../system_wrappers:metrics_default",
496 ]
Kári Tristan Helgasoncbe74352016-11-09 09:43:26497
mbonadei2c8ac1b2017-05-31 12:14:26498 libs = [
499 "AVFoundation.framework",
500 "CoreGraphics.framework",
501 "CoreMedia.framework",
502 "GLKit.framework",
503 ]
504
505 configs += [ "..:common_objc" ]
506
507 public_configs = [ ":objc_common_config" ]
508
509 if (!build_with_chromium && is_clang) {
510 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163)
511 configs -= [ "//build/config/clang:find_bad_constructs" ]
512 }
513 }
Kári Tristan Helgasoncbe74352016-11-09 09:43:26514 }
515
mbonadei2c8ac1b2017-05-31 12:14:26516 rtc_static_library("rtc_sdk_objc") {
517 complete_static_lib = true
518 deps = [
519 ":objc_peerconnection",
520 ":objc_ui",
521 "../system_wrappers:field_trial_default",
522 "../system_wrappers:metrics_default",
Kári Tristan Helgasoncbe74352016-11-09 09:43:26523 ]
mbonadei2c8ac1b2017-05-31 12:14:26524 }
525
526 rtc_static_library("objc_corevideoframebuffer") {
527 sources = [
528 "objc/Framework/Classes/Video/corevideo_frame_buffer.cc",
529 "objc/Framework/Classes/Video/corevideo_frame_buffer.h",
mbonadei2c8ac1b2017-05-31 12:14:26530 ]
531
532 deps = [
533 "../base:rtc_base_approved",
534 "../common_video",
535 ]
536
537 if (!build_with_chromium && is_clang) {
538 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
539 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
540 }
541
542 libs = [ "CoreVideo.framework" ]
543 }
544
545 rtc_static_library("objc_videotoolbox") {
546 sources = [
mbonadei2c8ac1b2017-05-31 12:14:26547 "objc/Framework/Classes/VideoToolbox/decoder.h",
Magnus Jedvert461c9402017-06-09 12:16:11548 "objc/Framework/Classes/VideoToolbox/decoder.mm",
mbonadei2c8ac1b2017-05-31 12:14:26549 "objc/Framework/Classes/VideoToolbox/encoder.h",
550 "objc/Framework/Classes/VideoToolbox/encoder.mm",
551 "objc/Framework/Classes/VideoToolbox/nalu_rewriter.cc",
552 "objc/Framework/Classes/VideoToolbox/nalu_rewriter.h",
mbonadei2c8ac1b2017-05-31 12:14:26553 "objc/Framework/Classes/VideoToolbox/videocodecfactory.h",
Anders Carlssonfc309752017-06-12 12:16:20554 "objc/Framework/Classes/VideoToolbox/videocodecfactory.mm",
mbonadei2c8ac1b2017-05-31 12:14:26555 ]
556
557 configs += [ "..:common_objc" ]
558
559 deps = [
560 ":objc_common",
Anders Carlsson0789dab2017-06-21 08:41:26561 ":objc_corevideoframebuffer",
mbonadei2c8ac1b2017-05-31 12:14:26562 "../base:rtc_base_approved",
563 "../common_video",
564 "../media:rtc_media",
565 "../media:rtc_media_base",
566 "../modules:module_api",
567 "../modules/video_coding:video_coding_utility",
568 "../modules/video_coding:webrtc_h264",
569 "../system_wrappers",
570 ]
571
572 libs = [
573 "CoreFoundation.framework",
574 "CoreMedia.framework",
575 "CoreVideo.framework",
576 "VideoToolbox.framework",
577 ]
578
579 if (!build_with_chromium && is_clang) {
580 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
581 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
582 }
583
584 if (rtc_build_libyuv) {
585 deps += [ "$rtc_libyuv_dir" ]
586 public_deps = [
587 "$rtc_libyuv_dir",
588 ]
589 } else {
590 # Need to add a directory normally exported by libyuv.
591 include_dirs = [ "$rtc_libyuv_dir/include" ]
592 }
Kári Tristan Helgasoncbe74352016-11-09 09:43:26593 }
594 }
tkchin9eeb6242016-04-27 08:54:20595}