-
-
Notifications
You must be signed in to change notification settings - Fork 38
/
Package.swift
100 lines (86 loc) · 3.19 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
// swift-tools-version:5.8
import PackageDescription
let package:Package = .init(name: "swift-png",
platforms: [.macOS(.v10_15), .iOS(.v13), .tvOS(.v13), .watchOS(.v6)],
products: [
.library(name: "LZ77", targets: ["LZ77"]),
.library(name: "PNG", targets: ["PNG"]),
.executable(name: "compression-benchmark", targets: ["PNGCompressionBenchmarks"]),
.executable(name: "decompression-benchmark", targets: ["PNGDecompressionBenchmarks"]),
],
dependencies: [
.package(url: "https://github.com/tayloraswift/swift-hash", .upToNextMinor(
from: "0.7.1")),
.package(url: "https://github.com/tayloraswift/swift-grammar", .upToNextMinor(
from: "0.4.0")),
],
targets: [
.target(name: "LZ77",
dependencies: [
.product(name: "CRC", package: "swift-hash"),
]),
.target(name: "PNG",
dependencies: [
.target(name: "LZ77"),
]),
.target(name: "PNGInspection",
dependencies: [
.target(name: "PNG"),
]),
.executableTarget(name: "LZ77Tests",
dependencies: [
.target(name: "LZ77"),
.product(name: "Testing_", package: "swift-grammar"),
],
swiftSettings: [
.define("DEBUG", .when(configuration: .debug))
]),
.executableTarget(name: "PNGTests",
dependencies: [
.target(name: "PNG"),
.product(name: "Testing_", package: "swift-grammar"),
],
swiftSettings: [
.define("DEBUG", .when(configuration: .debug))
]),
.executableTarget(name: "PNGIntegrationTests",
dependencies: [
.target(name: "PNG"),
.product(name: "Testing_", package: "swift-grammar"),
],
exclude: [
"PngSuite.LICENSE",
"PngSuite.README",
"Inputs/",
"Outputs/",
"RGBA/",
]),
.executableTarget(name: "PNGCompressionTests",
dependencies: [
.target(name: "PNG"),
.product(name: "Testing_", package: "swift-grammar"),
]),
.executableTarget(name: "PNGCompressionBenchmarks",
dependencies: [
.target(name: "PNG"),
],
path: "Benchmarks/Compression/Swift"),
.executableTarget(name: "PNGDecompressionBenchmarks",
dependencies: [
.target(name: "PNG"),
],
path: "Benchmarks/Decompression/Swift"),
],
swiftLanguageVersions: [.v5]
)
for target:PackageDescription.Target in package.targets
{
{
var settings:[PackageDescription.SwiftSetting] = $0 ?? []
settings.append(.enableUpcomingFeature("BareSlashRegexLiterals"))
settings.append(.enableUpcomingFeature("ConciseMagicFile"))
settings.append(.enableUpcomingFeature("ExistentialAny"))
// settings.append(.unsafeFlags(["-parse-as-library"], .when(platforms: [.windows])))
$0 = settings
} (&target.swiftSettings)
}