DataCompression icon indicating copy to clipboard operation
DataCompression copied to clipboard

compression_stream calls only available on OS X 10.11 or newer

Open Jeehut opened this issue 6 years ago • 2 comments

I just added DataCompression to a Swift 5 based SwiftPM tool this one but I am now getting errors stating:

'compression_stream_init' is only available on OS X 10.11 or newer
'compression_stream_destroy' is only available on OS X 10.11 or newer

Here's my Package.swift file content:

// swift-tools-version:5.0

import PackageDescription

let package = Package(
    name: "Accio",
    platforms: [.macOS(.v10_12)],
    products: [
        .executable(name: "accio", targets: ["Accio"]),
        .library(name: "AccioKit", type: .dynamic, targets: ["AccioKit"])
    ],
    dependencies: [
        .package(url: "https://github.com/mw99/DataCompression.git", .upToNextMajor(from: "3.4.0")),
        .package(url: "https://github.com/Flinesoft/HandySwift.git", .upToNextMajor(from: "2.8.0")),
        .package(url: "https://github.com/onevcat/Rainbow.git", .upToNextMajor(from: "3.1.4")),
        .package(url: "https://github.com/jakeheis/SwiftCLI.git", .upToNextMajor(from: "5.2.2")),
        .package(url: "https://github.com/kareman/SwiftShell.git", .upToNextMajor(from: "4.1.2")),
        .package(url: "https://github.com/mengxiangyue/xcodeproj.git", .branch("master")), // TODO: switch back to original once https://github.com/tuist/xcodeproj/issues/385 is fixed
    ],
    targets: [
        .target(
            name: "Accio",
            dependencies: ["AccioKit"]
        ),
        .target(
            name: "AccioKit",
            dependencies: [
                "DataCompression",
                "HandySwift",
                "Rainbow",
                "SwiftCLI",
                "SwiftShell",
                "xcodeproj",
            ]
        ),
        .testTarget(
            name: "AccioKitTests",
            dependencies: ["AccioKit", "HandySwift", "xcodeproj"]
        )
    ]
)

Jeehut avatar Mar 29 '19 17:03 Jeehut

Found a fix, but my fix will probably break Swift 4 compatiblity. See #16.

If you want to keep supporting Swift 4, you will want to add platform availability checks as suggested by Xcode. If you don't see the warnings, you probably need to delete the Xcode project file and regenerate it.

Jeehut avatar Mar 29 '19 17:03 Jeehut

Sorry this took forever. If you have time, you may check version 3.6.0

mw99 avatar Aug 08 '19 10:08 mw99