Skip to content

Commit fa6cb0f

Browse files
CALL-640: Add SPM support for Vonage-WebRTC 84.0.0-alpha.42
2 parents db2691c + 771f768 commit fa6cb0f

File tree

2 files changed

+60
-0
lines changed

2 files changed

+60
-0
lines changed

Package.swift

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
// swift-tools-version:5.9
2+
import PackageDescription
3+
4+
// IMPORTANT:
5+
// - Update `url` and `checksum` when releasing a new version.
6+
// - The referenced ZIP must contain `VonageWebRTC.xcframework` at the archive root.
7+
8+
let package = Package(
9+
name: "VonageWebRTC",
10+
platforms: [
11+
.iOS(.v9),
12+
.macOS(.v10_10)
13+
],
14+
products: [
15+
.library(
16+
name: "VonageWebRTC",
17+
targets: ["VonageWebRTC"]
18+
),
19+
.library(
20+
name: "VonageWebRTC_Binary",
21+
targets: ["VonageWebRTC_Binary"]
22+
)
23+
],
24+
targets: [
25+
.binaryTarget(
26+
name: "VonageWebRTC_Binary",
27+
url: "https://d3opqjmqzxf057.cloudfront.net/vonage-webrtc/pod/vonagewebrtc/release/84.0.0-alpha.42/VonageWebRTC-84.0.0-alpha.42.zip",
28+
checksum: "0edf9b511340704afec5b06dde9454c967809f7b79e7f666eef9c7854d9fc84b"
29+
),
30+
.target(
31+
name: "VonageWebRTC",
32+
dependencies: [
33+
.target(name: "VonageWebRTC_Binary")
34+
],
35+
path: "Sources/VonageWebRTC",
36+
linkerSettings: [
37+
.linkedFramework("AVFoundation"),
38+
.linkedFramework("AudioToolbox"),
39+
.linkedFramework("CoreGraphics"),
40+
.linkedFramework("CoreMedia"),
41+
.linkedFramework("GLKit"),
42+
.linkedFramework("VideoToolbox"),
43+
.linkedLibrary("c++")
44+
]
45+
)
46+
]
47+
)
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
// VonageWebRTC.swift
2+
//
3+
// This target is a lightweight wrapper around the prebuilt `VonageWebRTC` XCFramework.
4+
//
5+
// Why this exists:
6+
// - SwiftPM `binaryTarget` can't declare `linkerSettings`.
7+
// - CocoaPods previously injected required system framework link flags (e.g. AVFoundation).
8+
// - This wrapper target depends on the binary and adds the necessary link settings,
9+
// so consumers get the same behavior as with CocoaPods.
10+
//
11+
// NOTE: This file intentionally contains no public API.
12+
13+
import Foundation

0 commit comments

Comments
 (0)