Skip to content

Commit f5c1ea3

Browse files
committed
Add support for SwiftPM
1 parent ca147aa commit f5c1ea3

File tree

4 files changed

+64
-1
lines changed

4 files changed

+64
-1
lines changed

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,3 +34,7 @@ Carthage/Build
3434
# `pod install` in .travis.yml
3535
#
3636
Pods/
37+
38+
# SwiftPM
39+
.swiftpm
40+
.build

Package.resolved

Lines changed: 25 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Package.swift

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
// swift-tools-version:5.0
2+
// The swift-tools-version declares the minimum version of Swift required to build this package.
3+
4+
import PackageDescription
5+
6+
let package = Package(
7+
name: "SDWebImageAVIFCoder",
8+
platforms: [
9+
.macOS(.v10_10), .iOS(.v8), .tvOS(.v9), .watchOS(.v2)
10+
],
11+
products: [
12+
// Products define the executables and libraries produced by a package, and make them visible to other packages.
13+
.library(
14+
name: "SDWebImageAVIFCoder",
15+
targets: ["SDWebImageAVIFCoder"]),
16+
],
17+
dependencies: [
18+
// Dependencies declare other packages that this package depends on.
19+
// .package(url: /* package url */, from: "1.0.0"),
20+
.package(url: "https://github.com/SDWebImage/SDWebImage.git", from: "5.1.0"),
21+
.package(url: "https://github.com/SDWebImage/libavif-Xcode.git", from: "0.5.0")
22+
],
23+
targets: [
24+
// Targets are the basic building blocks of a package. A target can define a module or a test suite.
25+
// Targets can depend on other targets in this package, and on products in packages which this package depends on.
26+
.target(
27+
name: "SDWebImageAVIFCoder",
28+
dependencies: ["SDWebImage", "libavif"],
29+
path: ".",
30+
sources: ["SDWebImageAVIFCoder/Classes"],
31+
publicHeadersPath: "SDWebImageAVIFCoder/Classes"
32+
)
33+
]
34+
)

SDWebImageAVIFCoder/Classes/SDImageAVIFCoder.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
#if __has_include(<libavif/avif.h>)
1111
#import <libavif/avif.h>
1212
#else
13-
#import "avif.h"
13+
#import "avif/avif.h"
1414
#endif
1515

1616
// Convert 8/10/12bit AVIF image into RGBA8888

0 commit comments

Comments
 (0)