-
Notifications
You must be signed in to change notification settings - Fork 23
/
Package.swift
115 lines (110 loc) · 3.05 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
// swift-tools-version:5.5
// The swift-tools-version declares the minimum version of Swift required to build this package.
import PackageDescription
import Foundation
var basePath = "."
let package = Package(
name: "gRPC",
defaultLocalization: "en",
products: [
.library(
name: "gRPC-Core",
targets: [
"gRPC-Core",
]
),
.library(
name: "gRPC-cpp",
targets: [
"gRPC-cpp",
]
)
],
dependencies: [
.package(url: "https://github.com/firebase/abseil-cpp-SwiftPM.git", "0.20240722.0"..<"0.20240723.0"),
.package(url: "https://github.com/firebase/boringssl-SwiftPM.git", "0.32.0"..<"0.33.0"),
],
targets: [
.target(
name: "gRPC-Core",
dependencies: [
.product(name:"abseil", package: "abseil-cpp-SwiftPM"),
.product(name:"openssl_grpc", package: "boringssl-SwiftPM"),
],
path: basePath,
exclude: [
"src/objective-c/",
"src/cpp/",
"third_party/upb/upb/port/def.inc",
"third_party/upb/upb/port/undef.inc",
"third_party/re2/LICENSE",
"third_party/utf8_range/LICENSE",
"third_party/xxhash/LICENSE",
"third_party/zlib/LICENSE",
"tests",
"include/grpc/grpc_cronet.h",
"src/core/ext/transport/cronet/",
"third_party/objective_c/Cronet/bidirectional_stream_c.h",
],
sources: [
"src",
"third_party",
],
resources: [
.copy("src/objective-c/PrivacyInfo.xcprivacy"),
],
publicHeadersPath: "spm-core-include",
cSettings: [
.headerSearchPath("./"),
.headerSearchPath("include/"),
.headerSearchPath("third_party/re2/"),
.headerSearchPath("third_party/upb/"),
.headerSearchPath("third_party/utf8_range/"),
.headerSearchPath("third_party/xxhash/"),
.headerSearchPath("third_party/address_sorting/include/"),
.headerSearchPath("src/core/ext/upb-gen/"),
.headerSearchPath("src/core/ext/upbdefs-gen/"),
.define("GRPC_ARES", to: "0"),
],
linkerSettings: [
.linkedFramework("CoreFoundation"),
.linkedLibrary("z"),
]
),
.target(
name: "gRPC-cpp",
dependencies: [
.product(name:"abseil", package: "abseil-cpp-SwiftPM"),
"gRPC-Core",
],
path: basePath,
exclude: [
"tests",
"include/grpcpp/security/cronet_credentials.h",
"src/cpp/client/cronet_credentials.cc",
],
sources: [
"src/cpp/",
],
resources: [
.copy("src/objective-c/PrivacyInfo.xcprivacy"),
],
publicHeadersPath: "spm-cpp-include",
cSettings: [
.headerSearchPath("./"),
.headerSearchPath("include/"),
.headerSearchPath("third_party/upb/"),
.headerSearchPath("src/core/ext/upb-gen"),
]
),
.testTarget(
name: "build-test",
dependencies: [
"gRPC-cpp",
],
path: basePath + "/tests/spm_build"
),
],
cLanguageStandard: .gnu11,
cxxLanguageStandard: .cxx14
)