Package.swift 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. // swift-tools-version:5.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. import Foundation
  19. var packageDependencies: [Package.Dependency] = [
  20. // Official SwiftProtobuf library, for [de]serializing data to send on the wire.
  21. .package(url: "https://github.com/apple/swift-protobuf.git", .upToNextMajor(from: "1.5.0")),
  22. // Command line argument parser for our auxiliary command line tools.
  23. .package(url: "https://github.com/kylef/Commander.git", .upToNextMinor(from: "0.8.0"))
  24. ]
  25. let package = Package(
  26. name: "SwiftGRPC",
  27. products: [
  28. .library(name: "SwiftGRPC", targets: ["SwiftGRPC"])
  29. ],
  30. dependencies: packageDependencies,
  31. targets: [
  32. .target(name: "SwiftGRPC",
  33. dependencies: ["CgRPC", "SwiftProtobuf"]),
  34. .target(name: "CgRPC",
  35. dependencies: ["BoringSSL"],
  36. cSettings: [
  37. .headerSearchPath("../BoringSSL/include"),
  38. .unsafeFlags(["-Wno-module-import-in-extern-c"])],
  39. linkerSettings: [.linkedLibrary("z")]),
  40. .target(name: "RootsEncoder"),
  41. .target(name: "protoc-gen-swiftgrpc",
  42. dependencies: [
  43. "SwiftProtobuf",
  44. "SwiftProtobufPluginLibrary",
  45. "protoc-gen-swift"]),
  46. .target(name: "BoringSSL"),
  47. .target(name: "Echo",
  48. dependencies: [
  49. "SwiftGRPC",
  50. "SwiftProtobuf",
  51. "Commander"],
  52. path: "Sources/Examples/Echo"),
  53. .target(name: "Simple",
  54. dependencies: ["SwiftGRPC", "Commander"],
  55. path: "Sources/Examples/Simple"),
  56. .testTarget(name: "SwiftGRPCTests", dependencies: ["SwiftGRPC"])
  57. ],
  58. swiftLanguageVersions: [.v4, .v4_2, .v5],
  59. cLanguageStandard: .gnu11,
  60. cxxLanguageStandard: .cxx11)