tkchin | 9eeb624 | 2016-04-27 08:54:20 | [diff] [blame] | 1 | # 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 | |
mbonadei | 9aa3f0a | 2017-01-24 14:58:22 | [diff] [blame] | 9 | import("../webrtc.gni") |
kthelgason | ebc34e7 | 2016-09-15 11:30:18 | [diff] [blame] | 10 | if (is_ios) { |
| 11 | import("//build/config/ios/rules.gni") |
oprypin | 4519752 | 2017-06-22 08:47:20 | [diff] [blame^] | 12 | import("//build/config/ios/ios_sdk.gni") |
kthelgason | ebc34e7 | 2016-09-15 11:30:18 | [diff] [blame] | 13 | } |
tkchin | 9eeb624 | 2016-04-27 08:54:20 | [diff] [blame] | 14 | |
kthelgason | 2f08879 | 2017-05-30 08:48:47 | [diff] [blame] | 15 | declare_args() { |
| 16 | # Determine whether or not to include metal rendering |
| 17 | rtc_use_metal_rendering = is_mac || (is_ios && current_cpu == "arm64") |
| 18 | } |
| 19 | |
kjellander | 6ceab08 | 2016-10-28 12:44:03 | [diff] [blame] | 20 | group("sdk") { |
mbonadei | 2c8ac1b | 2017-05-31 12:14:26 | [diff] [blame] | 21 | if (!build_with_chromium && is_ios) { |
kjellander | 6ceab08 | 2016-10-28 12:44:03 | [diff] [blame] | 22 | public_deps = [ |
kthelgason | 2f08879 | 2017-05-30 08:48:47 | [diff] [blame] | 23 | ":objc_framework", |
kjellander | 6ceab08 | 2016-10-28 12:44:03 | [diff] [blame] | 24 | ] |
| 25 | } |
| 26 | } |
| 27 | |
kthelgason | cc2d1c6 | 2016-11-09 15:44:27 | [diff] [blame] | 28 | if (is_ios || is_mac) { |
kthelgason | 2f08879 | 2017-05-30 08:48:47 | [diff] [blame] | 29 | config("objc_common_config") { |
kjellander | 080a1e3 | 2016-05-25 18:37:11 | [diff] [blame] | 30 | include_dirs = [ |
| 31 | "objc/Framework/Classes", |
kthelgason | 2f08879 | 2017-05-30 08:48:47 | [diff] [blame] | 32 | "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", |
kjellander | 080a1e3 | 2016-05-25 18:37:11 | [diff] [blame] | 39 | "objc/Framework/Headers", |
| 40 | ] |
| 41 | } |
| 42 | |
kthelgason | 2f08879 | 2017-05-30 08:48:47 | [diff] [blame] | 43 | rtc_static_library("objc_common") { |
tkchin | 9eeb624 | 2016-04-27 08:54:20 | [diff] [blame] | 44 | sources = [ |
kthelgason | 2f08879 | 2017-05-30 08:48:47 | [diff] [blame] | 45 | "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 Carlsson | fc30975 | 2017-06-12 12:16:20 | [diff] [blame] | 51 | "objc/Framework/Classes/Common/RTCUIApplicationStatusObserver.h", |
| 52 | "objc/Framework/Classes/Common/RTCUIApplicationStatusObserver.m", |
kthelgason | 2f08879 | 2017-05-30 08:48:47 | [diff] [blame] | 53 | "objc/Framework/Classes/Common/helpers.h", |
| 54 | "objc/Framework/Classes/Common/helpers.mm", |
tkchin | 9eeb624 | 2016-04-27 08:54:20 | [diff] [blame] | 55 | "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", |
tkchin | 9eeb624 | 2016-04-27 08:54:20 | [diff] [blame] | 59 | ] |
denicija | d208815 | 2017-04-28 09:14:54 | [diff] [blame] | 60 | |
mbonadei | 1e060c6 | 2017-04-21 07:02:02 | [diff] [blame] | 61 | deps = [ |
| 62 | "../base:rtc_base", |
| 63 | ] |
kthelgason | c097710 | 2017-04-24 07:57:16 | [diff] [blame] | 64 | configs += [ "..:common_objc" ] |
| 65 | |
kthelgason | 2f08879 | 2017-05-30 08:48:47 | [diff] [blame] | 66 | public_configs = [ ":objc_common_config" ] |
denicija | d208815 | 2017-04-28 09:14:54 | [diff] [blame] | 67 | |
kjellander | 3bcedd3 | 2016-06-08 08:14:15 | [diff] [blame] | 68 | if (is_ios) { |
| 69 | sources += [ |
kthelgason | 2f08879 | 2017-05-30 08:48:47 | [diff] [blame] | 70 | "objc/Framework/Classes/Common/UIDevice+RTCDevice.mm", |
tkchin | d762910 | 2016-07-28 21:52:55 | [diff] [blame] | 71 | "objc/Framework/Headers/WebRTC/UIDevice+RTCDevice.h", |
kjellander | 3bcedd3 | 2016-06-08 08:14:15 | [diff] [blame] | 72 | ] |
denicija | d208815 | 2017-04-28 09:14:54 | [diff] [blame] | 73 | } |
| 74 | |
kthelgason | 2f08879 | 2017-05-30 08:48:47 | [diff] [blame] | 75 | if (!build_with_chromium) { |
denicija | d208815 | 2017-04-28 09:14:54 | [diff] [blame] | 76 | sources += [ |
kthelgason | 2f08879 | 2017-05-30 08:48:47 | [diff] [blame] | 77 | "objc/Framework/Classes/Common/RTCFileLogger.mm", |
| 78 | "objc/Framework/Headers/WebRTC/RTCFileLogger.h", |
| 79 | ] |
| 80 | } |
| 81 | } |
| 82 | |
mbonadei | 2c8ac1b | 2017-05-31 12:14:26 | [diff] [blame] | 83 | if (!build_with_chromium) { |
denicija | 59ee91b | 2017-06-05 12:48:47 | [diff] [blame] | 84 | 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 | } |
mbonadei | 2c8ac1b | 2017-05-31 12:14:26 | [diff] [blame] | 105 | rtc_static_library("objc_video") { |
kthelgason | 2f08879 | 2017-05-30 08:48:47 | [diff] [blame] | 106 | sources = [ |
mbonadei | 2c8ac1b | 2017-05-31 12:14:26 | [diff] [blame] | 107 | "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", |
kthelgason | 2f08879 | 2017-05-30 08:48:47 | [diff] [blame] | 122 | ] |
mbonadei | 2c8ac1b | 2017-05-31 12:14:26 | [diff] [blame] | 123 | libs = [] |
denicija | d208815 | 2017-04-28 09:14:54 | [diff] [blame] | 124 | if (is_ios) { |
denicija | 070d5e3 | 2017-02-26 19:44:13 | [diff] [blame] | 125 | sources += [ |
mbonadei | 2c8ac1b | 2017-05-31 12:14:26 | [diff] [blame] | 126 | "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", |
denicija | 070d5e3 | 2017-02-26 19:44:13 | [diff] [blame] | 141 | ] |
| 142 | } |
mbonadei | 2c8ac1b | 2017-05-31 12:14:26 | [diff] [blame] | 143 | |
kthelgason | 2f08879 | 2017-05-30 08:48:47 | [diff] [blame] | 144 | deps = [ |
mbonadei | 2c8ac1b | 2017-05-31 12:14:26 | [diff] [blame] | 145 | ":objc_common", |
Anders Carlsson | 0789dab | 2017-06-21 08:41:26 | [diff] [blame] | 146 | ":objc_corevideoframebuffer", |
| 147 | ":objc_videotoolbox", |
mbonadei | 2c8ac1b | 2017-05-31 12:14:26 | [diff] [blame] | 148 | "../api:libjingle_peerconnection_api", |
| 149 | "../base:rtc_base", |
| 150 | "../common_video", |
| 151 | "../media:rtc_media_base", |
tkchin | 9eeb624 | 2016-04-27 08:54:20 | [diff] [blame] | 152 | ] |
mbonadei | 2c8ac1b | 2017-05-31 12:14:26 | [diff] [blame] | 153 | |
kthelgason | 2f08879 | 2017-05-30 08:48:47 | [diff] [blame] | 154 | configs += [ "..:common_objc" ] |
ehmaldonado | da8dcfb | 2017-01-04 15:11:23 | [diff] [blame] | 155 | 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 | } |
ehmaldonado | da8dcfb | 2017-01-04 15:11:23 | [diff] [blame] | 160 | |
mbonadei | 2c8ac1b | 2017-05-31 12:14:26 | [diff] [blame] | 161 | 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 | } |
kthelgason | ebc34e7 | 2016-09-15 11:30:18 | [diff] [blame] | 182 | |
mbonadei | 2c8ac1b | 2017-05-31 12:14:26 | [diff] [blame] | 183 | 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 Carlsson | 0789dab | 2017-06-21 08:41:26 | [diff] [blame] | 274 | "objc/Framework/Classes/PeerConnection/RTCVideoFrame+Private.h", |
mbonadei | 2c8ac1b | 2017-05-31 12:14:26 | [diff] [blame] | 275 | "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", |
kthelgason | 5fe4d49 | 2016-12-05 19:27:30 | [diff] [blame] | 283 | "objc/Framework/Headers/WebRTC/RTCAVFoundationVideoSource.h", |
Kári Tristan Helgason | f93f5a4 | 2017-05-31 08:04:55 | [diff] [blame] | 284 | "objc/Framework/Headers/WebRTC/RTCAudioSource.h", |
| 285 | "objc/Framework/Headers/WebRTC/RTCAudioTrack.h", |
| 286 | "objc/Framework/Headers/WebRTC/RTCCameraVideoCapturer.h", |
kthelgason | 5fe4d49 | 2016-12-05 19:27:30 | [diff] [blame] | 287 | "objc/Framework/Headers/WebRTC/RTCConfiguration.h", |
| 288 | "objc/Framework/Headers/WebRTC/RTCDataChannel.h", |
| 289 | "objc/Framework/Headers/WebRTC/RTCDataChannelConfiguration.h", |
kthelgason | 5fe4d49 | 2016-12-05 19:27:30 | [diff] [blame] | 290 | "objc/Framework/Headers/WebRTC/RTCIceCandidate.h", |
| 291 | "objc/Framework/Headers/WebRTC/RTCIceServer.h", |
| 292 | "objc/Framework/Headers/WebRTC/RTCLegacyStatsReport.h", |
kthelgason | 5fe4d49 | 2016-12-05 19:27:30 | [diff] [blame] | 293 | "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", |
hewwatt | ace5c88 | 2017-04-27 13:26:19 | [diff] [blame] | 309 | "objc/Framework/Headers/WebRTC/RTCVideoCapturer.h", |
kthelgason | 5fe4d49 | 2016-12-05 19:27:30 | [diff] [blame] | 310 | "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", |
magjed | 1394191 | 2017-05-30 13:11:58 | [diff] [blame] | 314 | "objc/Framework/Headers/WebRTC/RTCVideoViewShading.h", |
kthelgason | 5fe4d49 | 2016-12-05 19:27:30 | [diff] [blame] | 315 | ] |
denicija | 0d4d57f | 2017-06-02 14:15:14 | [diff] [blame] | 316 | if (is_ios) { |
| 317 | sources += [ |
| 318 | "objc/Framework/Classes/PeerConnection/RTCFileVideoCapturer.h", |
| 319 | "objc/Framework/Classes/PeerConnection/RTCFileVideoCapturer.m", |
| 320 | ] |
| 321 | } |
mbonadei | 2c8ac1b | 2017-05-31 12:14:26 | [diff] [blame] | 322 | libs = [ "AVFoundation.framework" ] |
| 323 | |
| 324 | if (is_ios) { |
| 325 | libs += [ "CoreGraphics.framework" ] |
Kári Tristan Helgason | f93f5a4 | 2017-05-31 08:04:55 | [diff] [blame] | 326 | } |
kthelgason | ebc34e7 | 2016-09-15 11:30:18 | [diff] [blame] | 327 | |
kthelgason | c097710 | 2017-04-24 07:57:16 | [diff] [blame] | 328 | configs += [ "..:common_objc" ] |
| 329 | |
kthelgason | 2f08879 | 2017-05-30 08:48:47 | [diff] [blame] | 330 | public_configs = [ ":objc_common_config" ] |
kthelgason | c097710 | 2017-04-24 07:57:16 | [diff] [blame] | 331 | |
kjellander | e40a7ee | 2016-10-17 06:56:12 | [diff] [blame] | 332 | if (!build_with_chromium && is_clang) { |
mbonadei | 2c8ac1b | 2017-05-31 12:14:26 | [diff] [blame] | 333 | # 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 Carlsson | 0789dab | 2017-06-21 08:41:26 | [diff] [blame] | 339 | ":objc_corevideoframebuffer", |
mbonadei | 2c8ac1b | 2017-05-31 12:14:26 | [diff] [blame] | 340 | ":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 | ] |
kthelgason | ebc34e7 | 2016-09-15 11:30:18 | [diff] [blame] | 356 | } |
| 357 | } |
Zeke Chin | dd0e1e0 | 2016-10-11 20:27:26 | [diff] [blame] | 358 | |
mbonadei | 2c8ac1b | 2017-05-31 12:14:26 | [diff] [blame] | 359 | if (rtc_include_tests) { |
| 360 | rtc_source_set("objc_sdk_unittests") { |
| 361 | testonly = true |
Kári Tristan Helgason | cbe7435 | 2016-11-09 09:43:26 | [diff] [blame] | 362 | |
mbonadei | 2c8ac1b | 2017-05-31 12:14:26 | [diff] [blame] | 363 | # 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 = [ |
mbonadei | 2c8ac1b | 2017-05-31 12:14:26 | [diff] [blame] | 370 | "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 | ] |
oprypin | 4519752 | 2017-06-22 08:47:20 | [diff] [blame^] | 379 | 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 | } |
mbonadei | d762058 | 2017-05-30 08:50:35 | [diff] [blame] | 386 | |
mbonadei | 2c8ac1b | 2017-05-31 12:14:26 | [diff] [blame] | 387 | # |-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" ] |
magjed | 3149e09 | 2017-05-08 12:32:05 | [diff] [blame] | 391 | |
mbonadei | 2c8ac1b | 2017-05-31 12:14:26 | [diff] [blame] | 392 | 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 | ] |
magjed | 3149e09 | 2017-05-08 12:32:05 | [diff] [blame] | 400 | |
denicija | 59ee91b | 2017-06-05 12:48:47 | [diff] [blame] | 401 | 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 | } |
mbonadei | 2c8ac1b | 2017-05-31 12:14:26 | [diff] [blame] | 413 | } |
| 414 | } |
mbonadei | 2c8ac1b | 2017-05-31 12:14:26 | [diff] [blame] | 415 | 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 | } |
kthelgason | 2f08879 | 2017-05-30 08:48:47 | [diff] [blame] | 420 | } |
| 421 | |
mbonadei | 2c8ac1b | 2017-05-31 12:14:26 | [diff] [blame] | 422 | if (is_ios) { |
| 423 | ios_framework_bundle("objc_framework") { |
| 424 | info_plist = "objc/Framework/Info.plist" |
| 425 | output_name = "WebRTC" |
magjed | 3149e09 | 2017-05-08 12:32:05 | [diff] [blame] | 426 | |
mbonadei | 2c8ac1b | 2017-05-31 12:14:26 | [diff] [blame] | 427 | common_objc_headers = [ |
denicija | 59ee91b | 2017-06-05 12:48:47 | [diff] [blame] | 428 | "objc/Framework/Headers/WebRTC/RTCAudioSession.h", |
| 429 | "objc/Framework/Headers/WebRTC/RTCAudioSessionConfiguration.h", |
mbonadei | 2c8ac1b | 2017-05-31 12:14:26 | [diff] [blame] | 430 | "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 Helgason | cbe7435 | 2016-11-09 09:43:26 | [diff] [blame] | 477 | |
mbonadei | 2c8ac1b | 2017-05-31 12:14:26 | [diff] [blame] | 478 | 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 Helgason | cbe7435 | 2016-11-09 09:43:26 | [diff] [blame] | 482 | |
mbonadei | 2c8ac1b | 2017-05-31 12:14:26 | [diff] [blame] | 483 | ldflags = [ |
| 484 | "-all_load", |
| 485 | "-install_name", |
| 486 | "@rpath/$output_name.framework/$output_name", |
| 487 | ] |
Kári Tristan Helgason | cbe7435 | 2016-11-09 09:43:26 | [diff] [blame] | 488 | |
mbonadei | 2c8ac1b | 2017-05-31 12:14:26 | [diff] [blame] | 489 | deps = [ |
denicija | 59ee91b | 2017-06-05 12:48:47 | [diff] [blame] | 490 | ":objc_audio", |
mbonadei | 2c8ac1b | 2017-05-31 12:14:26 | [diff] [blame] | 491 | ":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 Helgason | cbe7435 | 2016-11-09 09:43:26 | [diff] [blame] | 497 | |
mbonadei | 2c8ac1b | 2017-05-31 12:14:26 | [diff] [blame] | 498 | 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 Helgason | cbe7435 | 2016-11-09 09:43:26 | [diff] [blame] | 514 | } |
| 515 | |
mbonadei | 2c8ac1b | 2017-05-31 12:14:26 | [diff] [blame] | 516 | 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 Helgason | cbe7435 | 2016-11-09 09:43:26 | [diff] [blame] | 523 | ] |
mbonadei | 2c8ac1b | 2017-05-31 12:14:26 | [diff] [blame] | 524 | } |
| 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", |
mbonadei | 2c8ac1b | 2017-05-31 12:14:26 | [diff] [blame] | 530 | ] |
| 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 = [ |
mbonadei | 2c8ac1b | 2017-05-31 12:14:26 | [diff] [blame] | 547 | "objc/Framework/Classes/VideoToolbox/decoder.h", |
Magnus Jedvert | 461c940 | 2017-06-09 12:16:11 | [diff] [blame] | 548 | "objc/Framework/Classes/VideoToolbox/decoder.mm", |
mbonadei | 2c8ac1b | 2017-05-31 12:14:26 | [diff] [blame] | 549 | "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", |
mbonadei | 2c8ac1b | 2017-05-31 12:14:26 | [diff] [blame] | 553 | "objc/Framework/Classes/VideoToolbox/videocodecfactory.h", |
Anders Carlsson | fc30975 | 2017-06-12 12:16:20 | [diff] [blame] | 554 | "objc/Framework/Classes/VideoToolbox/videocodecfactory.mm", |
mbonadei | 2c8ac1b | 2017-05-31 12:14:26 | [diff] [blame] | 555 | ] |
| 556 | |
| 557 | configs += [ "..:common_objc" ] |
| 558 | |
| 559 | deps = [ |
| 560 | ":objc_common", |
Anders Carlsson | 0789dab | 2017-06-21 08:41:26 | [diff] [blame] | 561 | ":objc_corevideoframebuffer", |
mbonadei | 2c8ac1b | 2017-05-31 12:14:26 | [diff] [blame] | 562 | "../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 Helgason | cbe7435 | 2016-11-09 09:43:26 | [diff] [blame] | 593 | } |
| 594 | } |
tkchin | 9eeb624 | 2016-04-27 08:54:20 | [diff] [blame] | 595 | } |