Jelajahi Sumber

Re-add swift-nio-zlib-support for macOS builds.

Daniel Alm 7 tahun lalu
induk
melakukan
c12125be6f
1 mengubah file dengan 6 tambahan dan 22 penghapusan
  1. 6 22
      Package.swift

+ 6 - 22
Package.swift

@@ -17,39 +17,23 @@
  */
 import PackageDescription
 
-var dependencies: [Package.Dependency] = [
-  .package(url: "https://github.com/apple/swift-protobuf.git", from: "1.0.2"),
-  .package(url: "https://github.com/kylef/Commander.git", from: "0.8.0")
-]
-
 var cGRPCDependencies: [Target.Dependency] = []
-#if os(Linux)
+#if !os(Linux)
 // On Linux, Foundation links with openssl, so we'll need to use that instead of BoringSSL.
 // See https://github.com/apple/swift-nio-ssl/issues/16#issuecomment-392705505 for details.
-dependencies.append(.package(url: "https://github.com/apple/swift-nio-ssl-support.git", from: "1.0.0"))
-#else
 cGRPCDependencies.append("BoringSSL")
 #endif
 
-/*
- * `swift-nio-zlib-support` uses `pkgConfig` to find `zlib` on 
- * non-Apple platforms. Details here: 
- * https://github.com/apple/swift-nio-zlib-support/issues/2#issuecomment-384681975
- * 
- * This doesn't play well with Macports, so require it only for non-Apple
- * platforms, until there is a better solution. 
- * Issue: https://github.com/grpc/grpc-swift/issues/220
- */
-#if !os(macOS)
-dependencies.append(.package(url: "https://github.com/apple/swift-nio-zlib-support.git", from: "1.0.0"))
-#endif
-
 let package = Package(
   name: "SwiftGRPC",
   products: [
     .library(name: "SwiftGRPC", targets: ["SwiftGRPC"]),
   ],
-  dependencies: dependencies,
+  dependencies: [
+    .package(url: "https://github.com/apple/swift-protobuf.git", from: "1.0.2"),
+    .package(url: "https://github.com/kylef/Commander.git", from: "0.8.0"),
+    .package(url: "https://github.com/apple/swift-nio-zlib-support.git", from: "1.0.0")
+  ],
   targets: [
     .target(name: "SwiftGRPC",
             dependencies: ["CgRPC", "SwiftProtobuf"]),