forked from apple/swift-collections
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Package.swift
157 lines (143 loc) · 5.26 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
156
157
// swift-tools-version:5.5
//===----------------------------------------------------------------------===//
//
// This source file is part of the Swift Collections open source project
//
// Copyright (c) 2021 Apple Inc. and the Swift project authors
// Licensed under Apache License v2.0 with Runtime Library Exception
//
// See https://swift.org/LICENSE.txt for license information
//
//===----------------------------------------------------------------------===//
import PackageDescription
// This package recognizes the conditional compilation flags listed below.
// To use enable them, uncomment the corresponding lines or define them
// from the package manager command line:
//
// swift build -Xswiftc -DCOLLECTIONS_INTERNAL_CHECKS
var settings: [SwiftSetting] = [
// Enables internal consistency checks at the end of initializers and
// mutating operations. This can have very significant overhead, so enabling
// this setting invalidates all documented performance guarantees.
//
// This is mostly useful while debugging an issue with the implementation of
// the hash table itself. This setting should never be enabled in production
// code.
// .define("COLLECTIONS_INTERNAL_CHECKS"),
// Hashing collections provided by this package usually seed their hash
// function with the address of the memory location of their storage,
// to prevent some common hash table merge/copy operations from regressing to
// quadratic behavior. This setting turns off this mechanism, seeding
// the hash function with the table's size instead.
//
// When used in conjunction with the SWIFT_DETERMINISTIC_HASHING environment
// variable, this enables reproducible hashing behavior.
//
// This is mostly useful while debugging an issue with the implementation of
// the hash table itself. This setting should never be enabled in production
// code.
// .define("COLLECTIONS_DETERMINISTIC_HASHING"),
]
let package = Package(
name: "swift-collections",
products: [
.library(name: "Collections", targets: ["Collections"]),
.library(name: "BitCollections", targets: ["BitCollections"]),
.library(name: "DequeModule", targets: ["DequeModule"]),
.library(name: "HeapModule", targets: ["HeapModule"]),
.library(name: "OrderedCollections", targets: ["OrderedCollections"]),
.library(name: "PersistentCollections", targets: ["PersistentCollections"]),
.library(name: "SortedCollections", targets: ["SortedCollections"]),
],
targets: [
.target(
name: "Collections",
dependencies: [
"BitCollections",
"DequeModule",
"HeapModule",
"OrderedCollections",
"PersistentCollections",
"SortedCollections",
],
path: "Sources/Collections",
exclude: ["CMakeLists.txt"],
swiftSettings: settings),
// Testing support module
.target(
name: "_CollectionsTestSupport",
dependencies: [],
swiftSettings: settings,
linkerSettings: [
.linkedFramework(
"XCTest",
.when(platforms: [.macOS, .iOS, .watchOS, .tvOS])),
]
),
.testTarget(
name: "CollectionsTestSupportTests",
dependencies: ["_CollectionsTestSupport"],
swiftSettings: settings),
.target(
name: "_CollectionsUtilities",
swiftSettings: settings),
// BitSet, BitArray
.target(
name: "BitCollections",
dependencies: ["_CollectionsUtilities"],
path: "Sources/BitCollections",
swiftSettings: settings),
.testTarget(
name: "BitCollectionsTests",
dependencies: ["BitCollections", "_CollectionsTestSupport"],
swiftSettings: settings),
// Deque<Element>
.target(
name: "DequeModule",
dependencies: ["_CollectionsUtilities"],
exclude: ["CMakeLists.txt"],
swiftSettings: settings),
.testTarget(
name: "DequeTests",
dependencies: ["DequeModule", "_CollectionsTestSupport"],
swiftSettings: settings),
// Heap<Value>
.target(
name: "HeapModule",
dependencies: ["_CollectionsUtilities"],
exclude: ["CMakeLists.txt"],
swiftSettings: settings),
.testTarget(
name: "HeapTests",
dependencies: ["HeapModule"],
swiftSettings: settings),
// OrderedSet<Element>, OrderedDictionary<Key, Value>
.target(
name: "OrderedCollections",
dependencies: ["_CollectionsUtilities"],
exclude: ["CMakeLists.txt"],
swiftSettings: settings),
.testTarget(
name: "OrderedCollectionsTests",
dependencies: ["OrderedCollections", "_CollectionsTestSupport"],
swiftSettings: settings),
// PersistentSet<Element>, PersistentDictionary<Key, Value>
.target(
name: "PersistentCollections",
dependencies: ["_CollectionsUtilities"],
swiftSettings: settings),
.testTarget(
name: "PersistentCollectionsTests",
dependencies: ["PersistentCollections", "_CollectionsTestSupport"],
swiftSettings: settings),
// SortedSet<Element>, SortedDictionary<Key, Value>
.target(
name: "SortedCollections",
dependencies: ["_CollectionsUtilities"],
swiftSettings: settings),
.testTarget(
name: "SortedCollectionsTests",
dependencies: ["SortedCollections", "_CollectionsTestSupport"],
swiftSettings: settings),
]
)