Package.swift 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. // swift-tools-version:4.0
  2. /*
  3. * Copyright 2017, gRPC Authors All rights reserved.
  4. *
  5. * Licensed under the Apache License, Version 2.0 (the "License");
  6. * you may not use this file except in compliance with the License.
  7. * You may obtain a copy of the License at
  8. *
  9. * http://www.apache.org/licenses/LICENSE-2.0
  10. *
  11. * Unless required by applicable law or agreed to in writing, software
  12. * distributed under the License is distributed on an "AS IS" BASIS,
  13. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  14. * See the License for the specific language governing permissions and
  15. * limitations under the License.
  16. */
  17. import PackageDescription
  18. var cGRPCDependencies: [Target.Dependency] = []
  19. #if !os(Linux)
  20. // On Linux, Foundation links with openssl, so we'll need to use that instead of BoringSSL.
  21. // See https://github.com/apple/swift-nio-ssl/issues/16#issuecomment-392705505 for details.
  22. cGRPCDependencies.append("BoringSSL")
  23. #endif
  24. let package = Package(
  25. name: "SwiftGRPC",
  26. products: [
  27. .library(name: "SwiftGRPC", targets: ["SwiftGRPC"]),
  28. ],
  29. dependencies: [
  30. .package(url: "https://github.com/apple/swift-protobuf.git", from: "1.0.2"),
  31. .package(url: "https://github.com/kylef/Commander.git", from: "0.8.0"),
  32. .package(url: "https://github.com/apple/swift-nio-zlib-support.git", from: "1.0.0")
  33. ],
  34. targets: [
  35. .target(name: "SwiftGRPC",
  36. dependencies: ["CgRPC", "SwiftProtobuf"]),
  37. .target(name: "CgRPC",
  38. dependencies: cGRPCDependencies),
  39. .target(name: "RootsEncoder"),
  40. .target(name: "protoc-gen-swiftgrpc",
  41. dependencies: [
  42. "SwiftProtobuf",
  43. "SwiftProtobufPluginLibrary",
  44. "protoc-gen-swift"]),
  45. .target(name: "BoringSSL"),
  46. .target(name: "Echo",
  47. dependencies: [
  48. "SwiftGRPC",
  49. "SwiftProtobuf",
  50. "Commander"],
  51. path: "Sources/Examples/Echo"),
  52. .target(name: "Simple",
  53. dependencies: ["SwiftGRPC", "Commander"],
  54. path: "Sources/Examples/Simple"),
  55. .testTarget(name: "SwiftGRPCTests", dependencies: ["SwiftGRPC"])
  56. ],
  57. cLanguageStandard: .gnu11,
  58. cxxLanguageStandard: .cxx11)