forked from grpc/grpc
-
Notifications
You must be signed in to change notification settings - Fork 0
/
BoringSSL-Package.swift.template
64 lines (58 loc) · 1.7 KB
/
BoringSSL-Package.swift.template
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
%YAML 1.2
--- |
// swift-tools-version:5.5
// The swift-tools-version declares the minimum version of Swift required to build this package.
import PackageDescription
import Foundation
let basePath = "third_party/boringssl-with-bazel"
let privacyInfoPath = "../../src/objective-c/PrivacyInfo.xcprivacy"
let testPath = "test/boringssl_spm_build"
let package = Package(
name: "BoringSSL-GRPC",
products: [
.library(
name: "openssl_grpc",
targets: ["openssl_grpc"]
)
],
targets: [
.target(
name: "openssl_grpc",
path: basePath,
exclude: [
],
<%
def remove_prefix(s, prefix):
return s[len(prefix):] if s.startswith(prefix) else s
files = []
lib_maps = {lib.name: lib for lib in libs}
for dep in swift_boringssl_package.get('deps', []):
lib = lib_maps[dep]
files.extend(lib.src)
files = sorted(set({remove_prefix(file, "third_party/boringssl-with-bazel/"): file for file in files}))
%>
sources: [
% for file in files:
"${file}",
% endfor
],
resources: [
.copy(privacyInfoPath),
],
publicHeadersPath: "src/include",
cSettings: [
.define("OPENSSL_NO_ASM", to: "1"),
.headerSearchPath("./"),
.headerSearchPath("include/"),
]
),
.testTarget(
name: "build-test",
dependencies: [
"openssl_grpc",
],
path: testPath
),
],
cxxLanguageStandard: .cxx14
)