forked from outfoxx/PotentCodables
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPackage.swift
More file actions
130 lines (123 loc) · 3.12 KB
/
Package.swift
File metadata and controls
130 lines (123 loc) · 3.12 KB
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
// swift-tools-version:5.4
//
// Package.swift
// PotentCodables
//
// Copyright © 2019 Outfox, inc.
//
//
// Distributed under the MIT License, See LICENSE for details.
//
import PackageDescription
// Limit Float16 to x86_64 on macOS or Linux
#if swift(>=5.5)
let pcDeps: [Target.Dependency] = [
"BigInt",
.product(name: "Collections", package: "swift-collections"),
.byName(name: "Float16", condition: .when(platforms: [.macOS, .macCatalyst, .linux])),
.product(name: "Regex", package: "regex"),
]
#else
let pcDeps: [Target.Dependency] = [
"BigInt",
.product(name: "Collections", package: "swift-collections"),
"Float16",
.product(name: "Regex", package: "regex"),
]
#endif
let package = Package(
name: "PotentCodables",
platforms: [
.iOS(.v14),
.macOS(.v11),
.watchOS(.v7),
.tvOS(.v14),
],
products: [
.library(
name: "PotentCodables",
targets: ["PotentCodables", "PotentJSON", "PotentCBOR", "PotentASN1", "PotentYAML", "Cfyaml"]
),
],
dependencies: [
.package(url: "https://github.com/attaswift/BigInt.git", from: "5.7.0"),
.package(url: "https://github.com/SusanDoggie/Float16.git", from: "1.1.1"),
.package(url: "https://github.com/apple/swift-collections.git", from: "1.2.1"),
.package(url: "https://github.com/sharplet/Regex.git", from: "2.1.1")
],
targets: [
.target(
name: "PotentCodables",
dependencies: pcDeps,
resources: [
.process("PotentCodables.docc")
]
),
.target(
name: "PotentJSON",
dependencies: [
"PotentCodables",
"BigInt",
.product(name: "Collections", package: "swift-collections")
]
),
.target(
name: "PotentCBOR",
dependencies: [
"PotentCodables",
"BigInt",
.product(name: "Collections", package: "swift-collections")
]
),
.target(
name: "PotentASN1",
dependencies: [
"PotentCodables",
"BigInt",
.product(name: "Collections", package: "swift-collections")
]
),
.target(
name: "Cfyaml",
sources: [
"src/lib/",
"src/util/",
"src/xxhash/"
],
cSettings: [
.headerSearchPath("."),
.headerSearchPath("include"),
.headerSearchPath("src/lib"),
.headerSearchPath("src/util"),
.headerSearchPath("src/valgrind"),
.headerSearchPath("src/xxhash"),
.define("HAVE_CONFIG_H")
]
),
.target(
name: "PotentYAML",
dependencies: [
"PotentCodables",
"BigInt",
"Cfyaml",
.product(name: "Collections", package: "swift-collections"),
.product(name: "Regex", package: "regex")
]
),
.testTarget(
name: "PotentCodablesTests",
dependencies: ["PotentCodables", "PotentJSON", "PotentCBOR", "PotentASN1", "PotentYAML"],
path: "./Tests"
)
]
)
#if swift(>=6)
package.swiftLanguageModes = [.v5, .v6]
#elseif swift(<6)
package.swiftLanguageVersions = [.v5]
#endif
#if swift(>=5.6)
package.dependencies.append(
.package(url: "https://github.com/swiftlang/swift-docc-plugin", from: "1.1.0")
)
#endif