forked from grpc/grpc
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Package.swift
155 lines (152 loc) · 5.01 KB
/
Package.swift
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
// swift-tools-version:5.2
// The swift-tools-version declares the minimum version of Swift required to build this package.
import PackageDescription
let package = Package(
name: "gRPC",
products: [
.library(
name: "gRPC-Core",
targets: [
"gRPC-Core",
]
),
.library(
name: "gRPC-cpp",
targets: [
"gRPC-cpp",
]
)
],
dependencies: [
.package(
name: "abseil",
//TODO(yulinliang): Firebase abseil is too old, update the dependency
//when abseil repo supports SPM.
url: "https://github.com/firebase/abseil-cpp-SwiftPM.git",
.revision("05d8107f2971a37e6c77245b7c4c6b0a7e97bc99")
),
.package(name: "BoringSSL-GRPC",
url: "https://github.com/firebase/boringssl-SwiftPM.git",
.branch("7bcafa2660bc58715c39637494550d1ed7cd7229")
),
],
targets: [
.target(
name: "gRPC-Core",
dependencies: [
.product(name:"abseil", package: "abseil"),
.product(name:"openssl_grpc", package: "BoringSSL-GRPC"),
],
path: ".",
exclude: [
"src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_channel.cc",
"src/core/ext/filters/client_channel/xds/xds_channel.cc",
"src/core/ext/filters/load_reporting/",
"src/core/ext/transport/cronet/",
"src/core/ext/upb-generated/third_party/",
"src/core/ext/upb-generated/src/proto/grpc/auth/",
"src/core/ext/upbdefs-generated/envoy/config/rbac/",
"src/core/ext/upbdefs-generated/google/api/expr/",
"src/core/ext/upbdefs-generated/src/",
"src/core/ext/upbdefs-generated/third_party/",
"src/core/ext/upbdefs-generated/udpa/data/",
"src/core/ext/xds/google_mesh_ca_certificate_provider_factory.h",
"src/core/ext/xds/google_mesh_ca_certificate_provider_factory.cc",
"src/core/lib/surface/init_unsecure.cc",
"src/core/lib/security/authorization/",
"src/core/plugin_registry/grpc_unsecure_plugin_registry.cc",
"third_party/re2/re2/testing/",
"third_party/re2/re2/fuzzing/",
"third_party/re2/util/benchmark.cc",
"third_party/re2/util/test.cc",
"third_party/re2/util/fuzz.cc",
"third_party/upb/upb/sink.c",
"third_party/upb/upb/json_decode.c",
"third_party/upb/upb/json_encode.c",
"third_party/upb/upb/handlers.h",
"third_party/upb/upb/sink.h",
"third_party/upb/upb/json_encode.h",
"third_party/upb/upb/json_decode.h",
"third_party/upb/upb/handlers-inl.h",
"third_party/upb/upb/handlers.c",
"third_party/upb/upb/bindings/",
"third_party/upb/upb/json/",
"third_party/upb/upb/pb/",
],
sources: [
"src/core/ext/filters/",
"src/core/ext/transport/",
"src/core/ext/upb-generated/",
"src/core/ext/upbdefs-generated/",
"src/core/ext/xds/",
"src/core/lib/",
"src/core/plugin_registry/grpc_plugin_registry.cc",
"src/core/tsi/",
"third_party/re2/re2/",
"third_party/re2/util/",
"third_party/upb/upb/",
"third_party/upb/third_party/wyhash/wyhash.h",
"third_party/xxhash/xxhash.h",
],
publicHeadersPath: "spm-core-include",
cSettings: [
.headerSearchPath("./"),
.headerSearchPath("include/"),
.headerSearchPath("third_party/re2/"),
.headerSearchPath("third_party/upb/"),
.headerSearchPath("third_party/xxhash/"),
.headerSearchPath("src/core/ext/upb-generated/"),
.headerSearchPath("src/core/ext/upbdefs-generated/"),
.define("GRPC_ARES", to: "0"),
.unsafeFlags(["-Wno-module-import-in-extern-c"]),
],
linkerSettings: [
.linkedFramework("CoreFoundation"),
.linkedLibrary("z"),
]
),
.target(
name: "gRPC-cpp",
dependencies: [
.product(name:"abseil", package: "abseil"),
"gRPC-Core",
],
path: ".",
exclude: [
"src/cpp/client/cronet_credentials.cc",
"src/cpp/client/channel_test_peer.cc",
"src/cpp/common/alts_util.cc",
"src/cpp/common/alts_context.cc",
"src/cpp/common/insecure_create_auth_context.cc",
"src/cpp/server/admin/",
"src/cpp/server/channelz/",
"src/cpp/server/csds/",
"src/cpp/server/load_reporter/",
"src/cpp/ext/",
"src/cpp/util/core_stats.cc",
"src/cpp/util/core_stats.h",
"src/cpp/util/error_details.cc",
],
sources: [
"src/cpp/",
],
publicHeadersPath: "spm-cpp-include",
cSettings: [
.headerSearchPath("./"),
.headerSearchPath("include/"),
.headerSearchPath("third_party/upb/"),
.headerSearchPath("src/core/ext/upb-generated"),
.unsafeFlags(["-Wno-module-import-in-extern-c"]),
]
),
.testTarget(
name: "build-test",
dependencies: [
"gRPC-cpp",
],
path: "test/spm_build"
),
],
cLanguageStandard: .gnu11,
cxxLanguageStandard: .cxx11
)