Package.swift 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133
  1. // swift-tools-version:5.2
  2. // The swift-tools-version declares the minimum version of Swift required to build this package.
  3. import PackageDescription
  4. let package = Package(
  5. name: "gRPC",
  6. products: [
  7. .library(
  8. name: "gRPC-Core",
  9. targets: [
  10. "gRPC-Core",
  11. ]
  12. ),
  13. .library(
  14. name: "gRPC-cpp",
  15. targets: [
  16. "gRPC-cpp",
  17. ]
  18. )
  19. ],
  20. dependencies: [
  21. .package(
  22. name: "abseil",
  23. url: "https://github.com/firebase/abseil-cpp-SwiftPM.git",
  24. "0.20220203.0"..<"0.20220204.0"
  25. ),
  26. .package(
  27. name: "BoringSSL-GRPC",
  28. url: "https://github.com/firebase/boringssl-SwiftPM.git",
  29. "0.9.0"..<"0.10.0"
  30. ),
  31. ],
  32. targets: [
  33. .target(
  34. name: "gRPC-Core",
  35. dependencies: [
  36. .product(name:"abseil", package: "abseil"),
  37. .product(name:"openssl_grpc", package: "BoringSSL-GRPC"),
  38. ],
  39. path: ".",
  40. exclude: [
  41. "src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_channel.cc",
  42. "src/core/ext/filters/load_reporting/",
  43. "src/core/ext/transport/cronet/",
  44. "src/core/ext/xds/google_mesh_ca_certificate_provider_factory.h",
  45. "src/core/ext/xds/google_mesh_ca_certificate_provider_factory.cc",
  46. "src/core/lib/surface/init_unsecure.cc",
  47. "src/core/lib/security/authorization/authorization_policy_provider_null_vtable.cc",
  48. "src/core/plugin_registry/grpc_unsecure_plugin_registry.cc",
  49. "third_party/re2/re2/testing/",
  50. "third_party/re2/re2/fuzzing/",
  51. "third_party/re2/util/benchmark.cc",
  52. "third_party/re2/util/test.cc",
  53. "third_party/re2/util/fuzz.cc",
  54. "third_party/upb/upb/bindings/",
  55. "third_party/upb/upb/msg_test.cc",
  56. ],
  57. sources: [
  58. "src/core/ext/filters/",
  59. "src/core/ext/transport/",
  60. "src/core/ext/upb-generated/",
  61. "src/core/ext/upbdefs-generated/",
  62. "src/core/ext/xds/",
  63. "src/core/lib/",
  64. "src/core/plugin_registry/grpc_plugin_registry.cc",
  65. "src/core/tsi/",
  66. "third_party/re2/re2/",
  67. "third_party/re2/util/",
  68. "third_party/upb/upb/",
  69. "third_party/xxhash/xxhash.h",
  70. ],
  71. publicHeadersPath: "spm-core-include",
  72. cSettings: [
  73. .headerSearchPath("./"),
  74. .headerSearchPath("include/"),
  75. .headerSearchPath("third_party/re2/"),
  76. .headerSearchPath("third_party/upb/"),
  77. .headerSearchPath("third_party/xxhash/"),
  78. .headerSearchPath("src/core/ext/upb-generated/"),
  79. .headerSearchPath("src/core/ext/upbdefs-generated/"),
  80. .define("GRPC_ARES", to: "0"),
  81. ],
  82. linkerSettings: [
  83. .linkedFramework("CoreFoundation"),
  84. .linkedLibrary("z"),
  85. ]
  86. ),
  87. .target(
  88. name: "gRPC-cpp",
  89. dependencies: [
  90. .product(name:"abseil", package: "abseil"),
  91. "gRPC-Core",
  92. ],
  93. path: ".",
  94. exclude: [
  95. "src/cpp/client/cronet_credentials.cc",
  96. "src/cpp/client/channel_test_peer.cc",
  97. "src/cpp/common/alts_util.cc",
  98. "src/cpp/common/alts_context.cc",
  99. "src/cpp/common/insecure_create_auth_context.cc",
  100. "src/cpp/server/admin/",
  101. "src/cpp/server/channelz/",
  102. "src/cpp/server/csds/",
  103. "src/cpp/server/load_reporter/",
  104. "src/cpp/ext/",
  105. "src/cpp/util/core_stats.cc",
  106. "src/cpp/util/core_stats.h",
  107. "src/cpp/util/error_details.cc",
  108. ],
  109. sources: [
  110. "src/cpp/",
  111. ],
  112. publicHeadersPath: "spm-cpp-include",
  113. cSettings: [
  114. .headerSearchPath("./"),
  115. .headerSearchPath("include/"),
  116. .headerSearchPath("third_party/upb/"),
  117. .headerSearchPath("src/core/ext/upb-generated"),
  118. ]
  119. ),
  120. .testTarget(
  121. name: "build-test",
  122. dependencies: [
  123. "gRPC-cpp",
  124. ],
  125. path: "test/spm_build"
  126. ),
  127. ],
  128. cLanguageStandard: .gnu11,
  129. cxxLanguageStandard: .cxx11
  130. )