mirror of
https://github.com/apple/swift-collections
synced 2026-11-27 04:54:21 +00:00
Bump required toolchain to Swift 6.0
- Update minimum toolchain version to Swift 6.0. - Add a separate package manifest for Swift 6.2+. - Upgrade to Swift 6 language mode. - Except in _RopeModule, which has uncovered a language-mode related regression in debug builds. - Define availability macros. - Enable the Builtin module. - For the 6.2+ manifest: - Add a new package trait called “UnstableContainersPreview”. This is not yet functional. - Enable experimental language features `Lifetimes` and `InoutLifetimeDependence`. - Stop supporting COLLECTIONS_SINGLE_MODULE in package builds. - Update CMake & Xcode configurations to also assume Swift 6.2, reflecting the changes above.
This commit is contained in:
6 files changed
+517
-83
No files matched your search
@@ -47,6 +47,33 @@ include(CTest)
|
||||
include(GNUInstallDirs)
|
||||
include(SwiftSupport)
|
||||
|
||||
set(collections_swift_flags
|
||||
"-enable-upcoming-feature MemberImportVisibility"
|
||||
"-enable-experimental-feature BuiltinModule"
|
||||
"-enable-experimental-feature Lifetimes"
|
||||
"-enable-experimental-feature InoutLifetimeDependence"
|
||||
)
|
||||
foreach(flag ${collections_swift_flags})
|
||||
add_compile_options("$<$<COMPILE_LANGUAGE:Swift>:SHELL:${flag}>")
|
||||
endforeach()
|
||||
|
||||
#add_compile_options("$<$<COMPILE_LANGUAGE:Swift>:SHELL:${collections_swift_flags}>")
|
||||
|
||||
set(availability_defs
|
||||
"SwiftStdlib 5.0: macOS 10.14.4, iOS 12.2, watchOS 5.2, tvOS 12.2"
|
||||
"SwiftStdlib 5.1: macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0"
|
||||
"SwiftStdlib 5.6: macOS 12.3, iOS 15.4, watchOS 8.5, tvOS 15.4"
|
||||
"SwiftStdlib 5.8: macOS 13.3, iOS 16.4, watchOS 9.4, tvOS 16.4"
|
||||
"SwiftStdlib 5.9: macOS 14.0, iOS 17.0, watchOS 10.0, tvOS 17.0"
|
||||
"SwiftStdlib 5.10: macOS 14.4, iOS 17.4, watchOS 10.4, tvOS 17.4, visionOS 1.1"
|
||||
"SwiftStdlib 6.0: macOS 15.0, iOS 18.0, watchOS 11.0, tvOS 18.0, visionOS 2.0"
|
||||
"SwiftStdlib 6.1: macOS 15.4, iOS 18.4, watchOS 11.4, tvOS 18.4, visionOS 2.4"
|
||||
"SwiftStdlib 6.2: macOS 26.0, iOS 26.0, watchOS 26.0, tvOS 26.0, visionOS 26.0"
|
||||
)
|
||||
foreach(def ${availability_defs})
|
||||
add_compile_options("$<$<COMPILE_LANGUAGE:Swift>:SHELL:-enable-experimental-feature \"AvailabilityMacro=${def}\">")
|
||||
endforeach()
|
||||
|
||||
add_subdirectory(Sources)
|
||||
# if(BUILD_TESTING)
|
||||
# add_subdirectory(Tests)
|
||||
|
||||
+78
-77
@@ -1,4 +1,4 @@
|
||||
// swift-tools-version:5.10
|
||||
// swift-tools-version:6.2
|
||||
//===----------------------------------------------------------------------===//
|
||||
//
|
||||
// This source file is part of the Swift Collections open source project
|
||||
@@ -12,12 +12,29 @@
|
||||
|
||||
import PackageDescription
|
||||
|
||||
let _traits: Set<Trait> = [
|
||||
.default(
|
||||
enabledTraits: [
|
||||
//"UnstableContainersPreview"
|
||||
]),
|
||||
.trait(
|
||||
name: "UnstableContainersPreview",
|
||||
description: """
|
||||
Enables source-unstable components of the ContainersPreview module in
|
||||
swift-collections. This allows experimental use of the Container
|
||||
protocols and associated algorithms.
|
||||
"""),
|
||||
]
|
||||
|
||||
// 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 defines: [String] = [
|
||||
var defines: [SwiftSetting] = [
|
||||
.define(
|
||||
"COLLECTIONS_UNSTABLE_CONTAINERS_PREVIEW",
|
||||
.when(traits: ["UnstableContainersPreview"])),
|
||||
|
||||
// Enables internal consistency checks at the end of initializers and
|
||||
// mutating operations. This can have very significant overhead, so enabling
|
||||
@@ -26,7 +43,7 @@ var defines: [String] = [
|
||||
// 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.
|
||||
// "COLLECTIONS_INTERNAL_CHECKS",
|
||||
// .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,
|
||||
@@ -40,10 +57,10 @@ var defines: [String] = [
|
||||
// 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.
|
||||
// "COLLECTIONS_DETERMINISTIC_HASHING",
|
||||
// .define("COLLECTIONS_DETERMINISTIC_HASHING"),
|
||||
|
||||
// Enables randomized testing of some data structure implementations.
|
||||
"COLLECTIONS_RANDOMIZED_TESTING",
|
||||
.define("COLLECTIONS_RANDOMIZED_TESTING"),
|
||||
|
||||
// Enable this to build the sources as a single, large module.
|
||||
// This removes the distinct modules for each data structure, instead
|
||||
@@ -52,11 +69,45 @@ var defines: [String] = [
|
||||
// "COLLECTIONS_SINGLE_MODULE",
|
||||
]
|
||||
|
||||
var _settings: [SwiftSetting] = defines.map { .define($0) }
|
||||
_settings += [
|
||||
.enableUpcomingFeature("MemberImportVisibility"),
|
||||
let availabilityMacros: KeyValuePairs<String, String> = [
|
||||
"SwiftStdlib 5.0": "macOS 10.14.4, iOS 12.2, watchOS 5.2, tvOS 12.2",
|
||||
"SwiftStdlib 5.1": "macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0",
|
||||
"SwiftStdlib 5.6": "macOS 12.3, iOS 15.4, watchOS 8.5, tvOS 15.4",
|
||||
"SwiftStdlib 5.8": "macOS 13.3, iOS 16.4, watchOS 9.4, tvOS 16.4",
|
||||
"SwiftStdlib 5.9": "macOS 14.0, iOS 17.0, watchOS 10.0, tvOS 17.0",
|
||||
"SwiftStdlib 5.10": "macOS 14.4, iOS 17.4, watchOS 10.4, tvOS 17.4, visionOS 1.1",
|
||||
"SwiftStdlib 6.0": "macOS 15.0, iOS 18.0, watchOS 11.0, tvOS 18.0, visionOS 2.0",
|
||||
"SwiftStdlib 6.1": "macOS 15.4, iOS 18.4, watchOS 11.4, tvOS 18.4, visionOS 2.4",
|
||||
"SwiftStdlib 6.2": "macOS 26.0, iOS 26.0, watchOS 26.0, tvOS 26.0, visionOS 26.0",
|
||||
// Note: if you touch these, please make sure to also update the similar lists in
|
||||
// CMakeLists.txt and Xcode/Shared.xcconfig.
|
||||
]
|
||||
|
||||
let extraSettings: [SwiftSetting] = [
|
||||
.enableUpcomingFeature("MemberImportVisibility"),
|
||||
// .strictMemorySafety(),
|
||||
.enableExperimentalFeature("BuiltinModule"),
|
||||
.enableExperimentalFeature("Lifetimes"),
|
||||
.enableExperimentalFeature("InoutLifetimeDependence"),
|
||||
// .enableExperimentalFeature("SuppressedAssociatedTypes"),
|
||||
// .enableExperimentalFeature("AddressableParameters"),
|
||||
// .enableExperimentalFeature("AddressableTypes"),
|
||||
|
||||
// Note: if you touch these, please make sure to also update the similar lists in
|
||||
// CMakeLists.txt and Xcode/Shared.xcconfig.
|
||||
]
|
||||
|
||||
let _sharedSettings: [SwiftSetting] = (
|
||||
defines
|
||||
+ availabilityMacros.map { name, value in
|
||||
.enableExperimentalFeature("AvailabilityMacro=\(name): \(value)")
|
||||
}
|
||||
+ extraSettings
|
||||
)
|
||||
|
||||
let _settings: [SwiftSetting] = _sharedSettings + []
|
||||
let _testSettings: [SwiftSetting] = _sharedSettings + []
|
||||
|
||||
struct CustomTarget {
|
||||
enum Kind {
|
||||
case exported
|
||||
@@ -70,6 +121,8 @@ struct CustomTarget {
|
||||
var dependencies: [Target.Dependency]
|
||||
var directory: String
|
||||
var exclude: [String]
|
||||
var sources: [String]?
|
||||
var settings: [SwiftSetting]
|
||||
}
|
||||
|
||||
extension CustomTarget.Kind {
|
||||
@@ -94,14 +147,18 @@ extension CustomTarget {
|
||||
name: String,
|
||||
dependencies: [Target.Dependency] = [],
|
||||
directory: String? = nil,
|
||||
exclude: [String] = []
|
||||
exclude: [String] = [],
|
||||
sources: [String]? = nil,
|
||||
settings: [SwiftSetting]? = nil
|
||||
) -> CustomTarget {
|
||||
CustomTarget(
|
||||
kind: kind,
|
||||
name: name,
|
||||
dependencies: dependencies,
|
||||
directory: directory ?? name,
|
||||
exclude: exclude)
|
||||
exclude: exclude,
|
||||
sources: sources,
|
||||
settings: settings ?? (kind.isTest ? _testSettings : _settings))
|
||||
}
|
||||
|
||||
func toTarget() -> Target {
|
||||
@@ -117,7 +174,8 @@ extension CustomTarget {
|
||||
dependencies: dependencies,
|
||||
path: kind.path(for: directory),
|
||||
exclude: exclude,
|
||||
swiftSettings: _settings,
|
||||
sources: sources,
|
||||
swiftSettings: settings,
|
||||
linkerSettings: linkerSettings)
|
||||
case .test:
|
||||
return Target.testTarget(
|
||||
@@ -125,58 +183,12 @@ extension CustomTarget {
|
||||
dependencies: dependencies,
|
||||
path: kind.path(for: directory),
|
||||
exclude: exclude,
|
||||
swiftSettings: _settings,
|
||||
swiftSettings: settings,
|
||||
linkerSettings: linkerSettings)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
extension Array where Element == CustomTarget {
|
||||
func toMonolithicTarget(
|
||||
name: String,
|
||||
linkerSettings: [LinkerSetting] = []
|
||||
) -> Target {
|
||||
let targets = self.filter { !$0.kind.isTest }
|
||||
return Target.target(
|
||||
name: name,
|
||||
path: "Sources",
|
||||
exclude: [
|
||||
"CMakeLists.txt",
|
||||
"BitCollections/BitCollections.docc",
|
||||
"Collections/Collections.docc",
|
||||
"DequeModule/DequeModule.docc",
|
||||
"HashTreeCollections/HashTreeCollections.docc",
|
||||
"HeapModule/HeapModule.docc",
|
||||
"OrderedCollections/OrderedCollections.docc",
|
||||
] + targets.flatMap { t in
|
||||
t.exclude.map { "\(t.name)/\($0)" }
|
||||
},
|
||||
sources: targets.map { "\($0.directory)" },
|
||||
swiftSettings: _settings,
|
||||
linkerSettings: linkerSettings)
|
||||
}
|
||||
|
||||
func toMonolithicTestTarget(
|
||||
name: String,
|
||||
dependencies: [Target.Dependency] = [],
|
||||
linkerSettings: [LinkerSetting] = []
|
||||
) -> Target {
|
||||
let targets = self.filter { $0.kind.isTest }
|
||||
return Target.testTarget(
|
||||
name: name,
|
||||
dependencies: dependencies,
|
||||
path: "Tests",
|
||||
exclude: [
|
||||
"README.md",
|
||||
] + targets.flatMap { t in
|
||||
t.exclude.map { "\(t.name)/\($0)" }
|
||||
},
|
||||
sources: targets.map { "\($0.name)" },
|
||||
swiftSettings: _settings,
|
||||
linkerSettings: linkerSettings)
|
||||
}
|
||||
}
|
||||
|
||||
let targets: [CustomTarget] = [
|
||||
.target(
|
||||
kind: .testSupport,
|
||||
@@ -262,7 +274,9 @@ let targets: [CustomTarget] = [
|
||||
name: "_RopeModule",
|
||||
dependencies: ["InternalCollectionsUtilities"],
|
||||
directory: "RopeModule",
|
||||
exclude: ["CMakeLists.txt"]),
|
||||
exclude: ["CMakeLists.txt"],
|
||||
// FIXME: _modify accessors in RopeModule seem to be broken in Swift 6 mode
|
||||
settings: _sharedSettings + [.swiftLanguageMode(.v5)]),
|
||||
.target(
|
||||
kind: .test,
|
||||
name: "RopeModuleTests",
|
||||
@@ -294,28 +308,15 @@ let targets: [CustomTarget] = [
|
||||
exclude: ["CMakeLists.txt"])
|
||||
]
|
||||
|
||||
var _products: [Product] = []
|
||||
var _targets: [Target] = []
|
||||
if defines.contains("COLLECTIONS_SINGLE_MODULE") {
|
||||
_products = [
|
||||
.library(name: "Collections", targets: ["Collections"]),
|
||||
]
|
||||
_targets = [
|
||||
targets.toMonolithicTarget(name: "Collections"),
|
||||
targets.toMonolithicTestTarget(
|
||||
name: "CollectionsTests",
|
||||
dependencies: ["Collections"]),
|
||||
]
|
||||
} else {
|
||||
_products = targets.compactMap { t in
|
||||
guard t.kind == .exported else { return nil }
|
||||
return .library(name: t.name, targets: [t.name])
|
||||
}
|
||||
_targets = targets.map { $0.toTarget() }
|
||||
let _products: [Product] = targets.compactMap { t in
|
||||
guard t.kind == .exported else { return nil }
|
||||
return .library(name: t.name, targets: [t.name])
|
||||
}
|
||||
let _targets: [Target] = targets.map { $0.toTarget() }
|
||||
|
||||
let package = Package(
|
||||
name: "swift-collections",
|
||||
products: _products,
|
||||
traits: _traits,
|
||||
targets: _targets
|
||||
)
|
||||
@@ -0,0 +1,386 @@
|
||||
// swift-tools-version:6.0
|
||||
//===----------------------------------------------------------------------===//
|
||||
//
|
||||
// This source file is part of the Swift Collections open source project
|
||||
//
|
||||
// Copyright (c) 2021 - 2025 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 defines: [String] = [
|
||||
|
||||
// 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.
|
||||
// "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.
|
||||
// "COLLECTIONS_DETERMINISTIC_HASHING",
|
||||
|
||||
// Enables randomized testing of some data structure implementations.
|
||||
"COLLECTIONS_RANDOMIZED_TESTING",
|
||||
|
||||
// Enable this to build the sources as a single, large module.
|
||||
// This removes the distinct modules for each data structure, instead
|
||||
// putting them all directly into the `Collections` module.
|
||||
// Note: This is a source-incompatible variation of the default configuration.
|
||||
// "COLLECTIONS_SINGLE_MODULE",
|
||||
]
|
||||
|
||||
let availabilityMacros: KeyValuePairs<String, String> = [
|
||||
"SwiftStdlib 5.0": "macOS 10.14.4, iOS 12.2, watchOS 5.2, tvOS 12.2",
|
||||
"SwiftStdlib 5.1": "macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0",
|
||||
"SwiftStdlib 5.6": "macOS 12.3, iOS 15.4, watchOS 8.5, tvOS 15.4",
|
||||
"SwiftStdlib 5.8": "macOS 13.3, iOS 16.4, watchOS 9.4, tvOS 16.4",
|
||||
"SwiftStdlib 5.9": "macOS 14.0, iOS 17.0, watchOS 10.0, tvOS 17.0",
|
||||
"SwiftStdlib 5.10": "macOS 14.4, iOS 17.4, watchOS 10.4, tvOS 17.4, visionOS 1.1",
|
||||
"SwiftStdlib 6.0": "macOS 15.0, iOS 18.0, watchOS 11.0, tvOS 18.0, visionOS 2.0",
|
||||
"SwiftStdlib 6.1": "macOS 15.4, iOS 18.4, watchOS 11.4, tvOS 18.4, visionOS 2.4",
|
||||
"SwiftStdlib 6.2": "macOS 26.0, iOS 26.0, watchOS 26.0, tvOS 26.0, visionOS 26.0",
|
||||
// Note: if you touch these, please make sure to also update the similar lists in
|
||||
// CMakeLists.txt and Xcode/Shared.xcconfig.
|
||||
]
|
||||
|
||||
let extraSettings: [SwiftSetting] = [
|
||||
.enableUpcomingFeature("MemberImportVisibility"),
|
||||
.enableExperimentalFeature("BuiltinModule"),
|
||||
]
|
||||
|
||||
let _sharedSettings: [SwiftSetting] = (
|
||||
defines.map { .define($0) }
|
||||
+ availabilityMacros.map { name, value in
|
||||
.enableExperimentalFeature("AvailabilityMacro=\(name): \(value)")
|
||||
}
|
||||
+ extraSettings
|
||||
)
|
||||
|
||||
let _settings: [SwiftSetting] = _sharedSettings + []
|
||||
let _testSettings: [SwiftSetting] = _sharedSettings + []
|
||||
|
||||
struct CustomTarget {
|
||||
enum Kind {
|
||||
case exported
|
||||
case hidden
|
||||
case test
|
||||
case testSupport
|
||||
}
|
||||
|
||||
var kind: Kind
|
||||
var name: String
|
||||
var dependencies: [Target.Dependency]
|
||||
var directory: String
|
||||
var exclude: [String]
|
||||
var sources: [String]?
|
||||
var settings: [SwiftSetting]
|
||||
}
|
||||
|
||||
extension CustomTarget.Kind {
|
||||
func path(for name: String) -> String {
|
||||
switch self {
|
||||
case .exported, .hidden: return "Sources/\(name)"
|
||||
case .test, .testSupport: return "Tests/\(name)"
|
||||
}
|
||||
}
|
||||
|
||||
var isTest: Bool {
|
||||
switch self {
|
||||
case .exported, .hidden: return false
|
||||
case .test, .testSupport: return true
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
extension CustomTarget {
|
||||
static func target(
|
||||
kind: Kind,
|
||||
name: String,
|
||||
dependencies: [Target.Dependency] = [],
|
||||
directory: String? = nil,
|
||||
exclude: [String] = [],
|
||||
sources: [String]? = nil,
|
||||
settings: [SwiftSetting]? = nil
|
||||
) -> CustomTarget {
|
||||
CustomTarget(
|
||||
kind: kind,
|
||||
name: name,
|
||||
dependencies: dependencies,
|
||||
directory: directory ?? name,
|
||||
exclude: exclude,
|
||||
sources: sources,
|
||||
settings: settings ?? (kind.isTest ? _testSettings : _settings))
|
||||
}
|
||||
|
||||
func toTarget() -> Target {
|
||||
var linkerSettings: [LinkerSetting] = []
|
||||
if kind == .testSupport {
|
||||
linkerSettings.append(
|
||||
.linkedFramework("XCTest", .when(platforms: [.macOS, .iOS, .watchOS, .tvOS])))
|
||||
}
|
||||
switch kind {
|
||||
case .exported, .hidden, .testSupport:
|
||||
return Target.target(
|
||||
name: name,
|
||||
dependencies: dependencies,
|
||||
path: kind.path(for: directory),
|
||||
exclude: exclude,
|
||||
sources: sources,
|
||||
swiftSettings: settings,
|
||||
linkerSettings: linkerSettings)
|
||||
case .test:
|
||||
return Target.testTarget(
|
||||
name: name,
|
||||
dependencies: dependencies,
|
||||
path: kind.path(for: directory),
|
||||
exclude: exclude,
|
||||
swiftSettings: settings,
|
||||
linkerSettings: linkerSettings)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
extension Array where Element == CustomTarget {
|
||||
func toMonolithicTarget(
|
||||
name: String,
|
||||
linkerSettings: [LinkerSetting] = []
|
||||
) -> Target {
|
||||
let targets = self.filter { !$0.kind.isTest }
|
||||
return Target.target(
|
||||
name: name,
|
||||
path: "Sources",
|
||||
exclude: [
|
||||
"CMakeLists.txt",
|
||||
"BitCollections/BitCollections.docc",
|
||||
"Collections/Collections.docc",
|
||||
"DequeModule/DequeModule.docc",
|
||||
"HashTreeCollections/HashTreeCollections.docc",
|
||||
"HeapModule/HeapModule.docc",
|
||||
"OrderedCollections/OrderedCollections.docc",
|
||||
] + targets.flatMap { t in
|
||||
t.exclude.map { "\(t.name)/\($0)" }
|
||||
},
|
||||
sources: targets.map { "\($0.directory)" },
|
||||
swiftSettings: _settings,
|
||||
linkerSettings: linkerSettings)
|
||||
}
|
||||
|
||||
@MainActor
|
||||
func toMonolithicTestTarget(
|
||||
name: String,
|
||||
dependencies: [Target.Dependency] = [],
|
||||
linkerSettings: [LinkerSetting] = []
|
||||
) -> Target {
|
||||
let targets = self.filter { $0.kind.isTest }
|
||||
return Target.testTarget(
|
||||
name: name,
|
||||
dependencies: dependencies,
|
||||
path: "Tests",
|
||||
exclude: [
|
||||
"README.md",
|
||||
] + targets.flatMap { t in
|
||||
t.exclude.map { "\(t.name)/\($0)" }
|
||||
},
|
||||
sources: targets.map { "\($0.name)" },
|
||||
swiftSettings: _testSettings,
|
||||
linkerSettings: linkerSettings)
|
||||
}
|
||||
}
|
||||
|
||||
let targets: [CustomTarget] = [
|
||||
.target(
|
||||
kind: .testSupport,
|
||||
name: "_CollectionsTestSupport",
|
||||
dependencies: ["InternalCollectionsUtilities"]),
|
||||
.target(
|
||||
kind: .test,
|
||||
name: "CollectionsTestSupportTests",
|
||||
dependencies: ["_CollectionsTestSupport"]),
|
||||
.target(
|
||||
kind: .hidden,
|
||||
name: "InternalCollectionsUtilities",
|
||||
exclude: [
|
||||
"CMakeLists.txt",
|
||||
"Debugging.swift.gyb",
|
||||
"Descriptions.swift.gyb",
|
||||
"IntegerTricks/FixedWidthInteger+roundUpToPowerOfTwo.swift.gyb",
|
||||
"IntegerTricks/Integer rank.swift.gyb",
|
||||
"IntegerTricks/UInt+first and last set bit.swift.gyb",
|
||||
"IntegerTricks/UInt+reversed.swift.gyb",
|
||||
"RandomAccessCollection+Offsets.swift.gyb",
|
||||
"UnsafeBitSet/_UnsafeBitSet+Index.swift.gyb",
|
||||
"UnsafeBitSet/_UnsafeBitSet+_Word.swift.gyb",
|
||||
"UnsafeBitSet/_UnsafeBitSet.swift.gyb",
|
||||
"UnsafeBufferPointer+Extras.swift.gyb",
|
||||
"UnsafeMutableBufferPointer+Extras.swift.gyb",
|
||||
"UnsafeRawBufferPointer+Extras.swift.gyb",
|
||||
"UnsafeMutableRawBufferPointer+Extras.swift.gyb",
|
||||
"LifetimeOverride.swift.gyb",
|
||||
]),
|
||||
|
||||
.target(
|
||||
kind: .exported,
|
||||
name: "ArrayModule",
|
||||
dependencies: [
|
||||
"InternalCollectionsUtilities",
|
||||
],
|
||||
exclude: ["CMakeLists.txt"]
|
||||
),
|
||||
.target(
|
||||
kind: .test,
|
||||
name: "ArrayTests",
|
||||
dependencies: [
|
||||
"ArrayModule", "_CollectionsTestSupport"
|
||||
]),
|
||||
|
||||
.target(
|
||||
kind: .exported,
|
||||
name: "BitCollections",
|
||||
dependencies: ["InternalCollectionsUtilities"],
|
||||
exclude: ["CMakeLists.txt"]),
|
||||
.target(
|
||||
kind: .test,
|
||||
name: "BitCollectionsTests",
|
||||
dependencies: [
|
||||
"BitCollections", "_CollectionsTestSupport", "OrderedCollections"
|
||||
]),
|
||||
|
||||
.target(
|
||||
kind: .exported,
|
||||
name: "ContainersPreview",
|
||||
dependencies: ["InternalCollectionsUtilities"],
|
||||
exclude: ["CMakeLists.txt"]),
|
||||
.target(
|
||||
kind: .test,
|
||||
name: "ContainersTests",
|
||||
dependencies: [
|
||||
"ContainersPreview", "_CollectionsTestSupport"
|
||||
]),
|
||||
|
||||
.target(
|
||||
kind: .exported,
|
||||
name: "DequeModule",
|
||||
dependencies: ["InternalCollectionsUtilities"],
|
||||
exclude: ["CMakeLists.txt"]),
|
||||
.target(
|
||||
kind: .test,
|
||||
name: "DequeTests",
|
||||
dependencies: ["DequeModule", "_CollectionsTestSupport"]),
|
||||
|
||||
.target(
|
||||
kind: .exported,
|
||||
name: "HashTreeCollections",
|
||||
dependencies: ["InternalCollectionsUtilities"],
|
||||
exclude: ["CMakeLists.txt"]),
|
||||
.target(
|
||||
kind: .test,
|
||||
name: "HashTreeCollectionsTests",
|
||||
dependencies: ["HashTreeCollections", "_CollectionsTestSupport"]),
|
||||
|
||||
.target(
|
||||
kind: .exported,
|
||||
name: "HeapModule",
|
||||
dependencies: ["InternalCollectionsUtilities"],
|
||||
exclude: ["CMakeLists.txt"]),
|
||||
.target(
|
||||
kind: .test,
|
||||
name: "HeapTests",
|
||||
dependencies: ["HeapModule", "_CollectionsTestSupport"]),
|
||||
|
||||
.target(
|
||||
kind: .exported,
|
||||
name: "OrderedCollections",
|
||||
dependencies: ["InternalCollectionsUtilities"],
|
||||
exclude: ["CMakeLists.txt"]),
|
||||
.target(
|
||||
kind: .test,
|
||||
name: "OrderedCollectionsTests",
|
||||
dependencies: ["OrderedCollections", "_CollectionsTestSupport"]),
|
||||
|
||||
.target(
|
||||
kind: .exported,
|
||||
name: "_RopeModule",
|
||||
dependencies: ["InternalCollectionsUtilities"],
|
||||
directory: "RopeModule",
|
||||
exclude: ["CMakeLists.txt"],
|
||||
// FIXME: _modify accessors in RopeModule seem to be broken in Swift 6 mode
|
||||
settings: _sharedSettings + [.swiftLanguageMode(.v5)]),
|
||||
.target(
|
||||
kind: .test,
|
||||
name: "RopeModuleTests",
|
||||
dependencies: ["_RopeModule", "_CollectionsTestSupport"]),
|
||||
|
||||
// These aren't ready for production use yet.
|
||||
// .target(
|
||||
// kind: .exported,
|
||||
// name: "SortedCollections",
|
||||
// dependencies: ["InternalCollectionsUtilities"],
|
||||
// directory: "SortedCollections"),
|
||||
// .target(
|
||||
// kind: .test,
|
||||
// name: "SortedCollectionsTests",
|
||||
// dependencies: ["SortedCollections", "_CollectionsTestSupport"]),
|
||||
|
||||
.target(
|
||||
kind: .exported,
|
||||
name: "Collections",
|
||||
dependencies: [
|
||||
"BitCollections",
|
||||
"DequeModule",
|
||||
"HashTreeCollections",
|
||||
"HeapModule",
|
||||
"OrderedCollections",
|
||||
"_RopeModule",
|
||||
//"SortedCollections",
|
||||
],
|
||||
exclude: ["CMakeLists.txt"])
|
||||
]
|
||||
|
||||
var _products: [Product] = []
|
||||
var _targets: [Target] = []
|
||||
if defines.contains("COLLECTIONS_SINGLE_MODULE") {
|
||||
_products = [
|
||||
.library(name: "Collections", targets: ["Collections"]),
|
||||
]
|
||||
_targets = [
|
||||
targets.toMonolithicTarget(name: "Collections"),
|
||||
targets.toMonolithicTestTarget(
|
||||
name: "CollectionsTests",
|
||||
dependencies: ["Collections"]),
|
||||
]
|
||||
} else {
|
||||
_products = targets.compactMap { t in
|
||||
guard t.kind == .exported else { return nil }
|
||||
return .library(name: t.name, targets: [t.name])
|
||||
}
|
||||
_targets = targets.map { $0.toTarget() }
|
||||
}
|
||||
|
||||
let package = Package(
|
||||
name: "swift-collections",
|
||||
products: _products,
|
||||
targets: _targets
|
||||
)
|
||||
@@ -426,6 +426,7 @@
|
||||
/* End PBXContainerItemProxy section */
|
||||
|
||||
/* Begin PBXFileReference section */
|
||||
7D48BCF52E51651900D7F6F7 /* Package@swift-6.0.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = "Package@swift-6.0.swift"; path = "../Package@swift-6.0.swift"; sourceTree = SOURCE_ROOT; };
|
||||
7D5A64D229CCE8CC00CB2595 /* README.md */ = {isa = PBXFileReference; lastKnownFileType = net.daringfireball.markdown; path = README.md; sourceTree = "<group>"; };
|
||||
7D5A64D329CCEE9A00CB2595 /* README.md */ = {isa = PBXFileReference; lastKnownFileType = net.daringfireball.markdown; path = README.md; sourceTree = "<group>"; };
|
||||
7D5A64D429CCEF1500CB2595 /* generate-sources.sh */ = {isa = PBXFileReference; lastKnownFileType = text.script.sh; path = "generate-sources.sh"; sourceTree = "<group>"; };
|
||||
@@ -892,6 +893,7 @@
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
7DE921A929CA782F004483EB /* Package.swift */,
|
||||
7D48BCF52E51651900D7F6F7 /* Package@swift-6.0.swift */,
|
||||
7DE921AB29CA782F004483EB /* CMakeLists.txt */,
|
||||
7DE921A829CA782F004483EB /* CODE_OF_CONDUCT.md */,
|
||||
7DE921A729CA782F004483EB /* CODEOWNERS */,
|
||||
@@ -1827,7 +1829,7 @@
|
||||
attributes = {
|
||||
BuildIndependentTargetsInParallel = 1;
|
||||
LastSwiftUpdateCheck = 1430;
|
||||
LastUpgradeCheck = 1600;
|
||||
LastUpgradeCheck = 2600;
|
||||
TargetAttributes = {
|
||||
7DE91B2529CA6721004483EB = {
|
||||
CreatedOnToolsVersion = 14.3;
|
||||
@@ -2336,7 +2338,6 @@
|
||||
isa = XCBuildConfiguration;
|
||||
baseConfigurationReference = 7DEBDB9729CCE4A600ADC226 /* CollectionsTests.xcconfig */;
|
||||
buildSettings = {
|
||||
DEAD_CODE_STRIPPING = YES;
|
||||
};
|
||||
name = Debug;
|
||||
};
|
||||
@@ -2344,7 +2345,6 @@
|
||||
isa = XCBuildConfiguration;
|
||||
baseConfigurationReference = 7DEBDB9729CCE4A600ADC226 /* CollectionsTests.xcconfig */;
|
||||
buildSettings = {
|
||||
DEAD_CODE_STRIPPING = YES;
|
||||
};
|
||||
name = Release;
|
||||
};
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Scheme
|
||||
LastUpgradeVersion = "1600"
|
||||
LastUpgradeVersion = "2600"
|
||||
version = "1.7">
|
||||
<BuildAction
|
||||
parallelizeBuildables = "YES"
|
||||
|
||||
+22
-2
@@ -2,7 +2,7 @@
|
||||
//
|
||||
// This source file is part of the Swift Collections open source project
|
||||
//
|
||||
// Copyright (c) 2023 - 2024 Apple Inc. and the Swift project authors
|
||||
// Copyright (c) 2023 - 2025 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
|
||||
@@ -11,7 +11,23 @@
|
||||
|
||||
SDKROOT = macosx
|
||||
|
||||
SWIFT_VERSION = 5.5
|
||||
SWIFT_VERSION = 5.10 // FIXME: _modify accessors in RopeModule seem to be broken in Swift 6 mode
|
||||
|
||||
OTHER_SWIFT_FLAGS = $(inherited) \
|
||||
-enable-upcoming-feature MemberImportVisibility \
|
||||
-enable-experimental-feature BuiltinModule \
|
||||
-enable-experimental-feature Lifetimes \
|
||||
-enable-experimental-feature InoutLifetimeDependence \
|
||||
-enable-experimental-feature "AvailabilityMacro=SwiftStdlib 5.0: macOS 10.14.4, iOS 12.2, watchOS 5.2, tvOS 12.2" \
|
||||
-enable-experimental-feature "AvailabilityMacro=SwiftStdlib 5.1: macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0" \
|
||||
-enable-experimental-feature "AvailabilityMacro=SwiftStdlib 5.6: macOS 12.3, iOS 15.4, watchOS 8.5, tvOS 15.4" \
|
||||
-enable-experimental-feature "AvailabilityMacro=SwiftStdlib 5.8: macOS 13.3, iOS 16.4, watchOS 9.4, tvOS 16.4" \
|
||||
-enable-experimental-feature "AvailabilityMacro=SwiftStdlib 5.9: macOS 14.0, iOS 17.0, watchOS 10.0, tvOS 17.0" \
|
||||
-enable-experimental-feature "AvailabilityMacro=SwiftStdlib 5.10: macOS 14.4, iOS 17.4, watchOS 10.4, tvOS 17.4, visionOS 1.1" \
|
||||
-enable-experimental-feature "AvailabilityMacro=SwiftStdlib 6.0: macOS 15.0, iOS 18.0, watchOS 11.0, tvOS 18.0, visionOS 2.0" \
|
||||
-enable-experimental-feature "AvailabilityMacro=SwiftStdlib 6.1: macOS 15.4, iOS 18.4, watchOS 11.4, tvOS 18.4, visionOS 2.4" \
|
||||
-enable-experimental-feature "AvailabilityMacro=SwiftStdlib 6.2: macOS 26.0, iOS 26.0, watchOS 26.0, tvOS 26.0, visionOS 26.0"
|
||||
|
||||
ONLY_ACTIVE_ARCH[config=Debug] = YES
|
||||
|
||||
SWIFT_ACTIVE_COMPILATION_CONDITIONS = $(inherited) COLLECTIONS_SINGLE_MODULE
|
||||
@@ -23,6 +39,8 @@ SWIFT_COMPILATION_MODE[config=Debug] = singlefile
|
||||
SWIFT_OPTIMIZATION_LEVEL[config=Release] = -O
|
||||
SWIFT_OPTIMIZATION_LEVEL[config=Debug] = -Onone
|
||||
|
||||
|
||||
|
||||
ENABLE_USER_SCRIPT_SANDBOXING = YES
|
||||
|
||||
SWIFT_EMIT_LOC_STRINGS = NO
|
||||
@@ -36,6 +54,8 @@ DEBUG_INFORMATION_FORMAT[config=Debug] = dwarf
|
||||
|
||||
ALWAYS_SEARCH_USER_PATHS = NO
|
||||
|
||||
STRING_CATALOG_GENERATE_SYMBOLS = YES
|
||||
|
||||
GCC_DYNAMIC_NO_PIC = NO
|
||||
GCC_NO_COMMON_BLOCKS = YES
|
||||
GCC_OPTIMIZATION_LEVEL[config=Debug] = 0
|
||||
|
||||
Reference in new issue
Block a user