Skip to content

Commit

Permalink
fix compilation for macOS
Browse files Browse the repository at this point in the history
  • Loading branch information
theBreadCompany committed Jan 4, 2024
1 parent dafb24c commit c93c3f0
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
6 changes: 4 additions & 2 deletions Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ let package = Package(
// .package(url: "https://github.com/phimage/Erik.git", from: "5.1.0"),
// .package(url: "https://github.com/maparoni/Zip.git", .revisionItem("059e7346082d02de16220cd79df7db18ddeba8c3"))
.package(url: "https://github.com/weichsel/ZIPFoundation.git", .upToNextMajor(from: "0.9.0")),
.package(url: "https://github.com/apple/swift-crypto.git", .upToNextMajor(from: "3.0.0")),
.package(url: "https://github.com/fwcd/swift-gif.git", .upToNextMajor(from: "2.0.0")),
.package(url: "https://github.com/twostraws/SwiftGD", .upToNextMajor(from: "2.0.0"))
],
Expand All @@ -23,7 +22,6 @@ let package = Package(
name: "pixivswift",
dependencies: [
// .productItem(name: "Erik", package: "Erik", condition: .when(platforms: [.linux, .windows, .macOS])), // headless login only makes sense in headless environments (CLIs), otherwise check out the pixivauth target
.productItem(name: "Crypto", package: "swift-crypto", condition: .when(platforms: [.linux]))
],
exclude: ["papi.swift"]
),
Expand All @@ -50,3 +48,7 @@ let package = Package(
package.targets.append(.target(name: "pixivauth", dependencies: ["pixivswift"]))
package.products.append(.executable(name: "pixivauth", targets: ["pixivauth"]))
#endif
#if !canImport(CommonCrypto)
package.dependencies.append(.package(url: "https://github.com/apple/swift-crypto.git", .upToNextMajor(from: "3.0.0")))
package.targets.first(where: {$0.name == "pixivswift"})!.dependencies.append(.productItem(name: "Crypto", package: "swift-crypto", condition: .when(platforms: [.linux])))
#endif
5 changes: 4 additions & 1 deletion Sources/pixivswiftWrapper/PixivDownloader.swift
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@
import Foundation
import ZIPFoundation
import pixivswift

#if canImport(ImageIO)
import ImageIO
#endif
#if canImport(FoundationNetworking)
import FoundationNetworking
import GIF
Expand Down Expand Up @@ -412,5 +414,6 @@ open class PixivDownloader {
}

#if canImport(Combine)
@available(macOS 10.15, *)
extension PixivDownloader: ObservableObject {}
#endif

0 comments on commit c93c3f0

Please sign in to comment.