@@ -9,7 +9,8 @@ import CompilerPluginSupport
99let availabilityTags : [ _Availability ] = [
1010 _Availability ( " FoundationPreview " ) , // Default FoundationPreview availability,
1111 _Availability ( " FoundationPredicate " ) , // Predicate relies on pack parameter runtime support
12- _Availability ( " FoundationPredicateRegex " ) // Predicate regexes rely on new stdlib APIs
12+ _Availability ( " FoundationPredicateRegex " ) , // Predicate regexes rely on new stdlib APIs
13+ _Availability ( " FoundationSpan " , availability: . future) , // Availability of Span types
1314]
1415let versionNumbers = [ " 0.1 " , " 0.2 " , " 0.3 " , " 0.4 " , " 6.0.2 " , " 6.1 " , " 6.2 " ]
1516
@@ -74,6 +75,11 @@ let wasiLibcCSettings: [CSetting] = [
7475 . define( " _WASI_EMULATED_MMAN " , . when( platforms: [ . wasi] ) ) ,
7576]
7677
78+ let testOnlySwiftSettings : [ SwiftSetting ] = [
79+ // The latest Windows toolchain does not yet have exit tests in swift-testing
80+ . define( " FOUNDATION_EXIT_TESTS " , . when( platforms: [ . macOS, . linux, . openbsd] ) )
81+ ]
82+
7783let package = Package (
7884 name: " swift-foundation " ,
7985 platforms: [ . macOS( " 15 " ) , . iOS( " 18 " ) , . tvOS( " 18 " ) , . watchOS( " 11 " ) ] ,
@@ -135,6 +141,18 @@ let package = Package(
135141 ] + wasiLibcCSettings,
136142 swiftSettings: [
137143 . enableExperimentalFeature( " VariadicGenerics " ) ,
144+ . enableExperimentalFeature( " LifetimeDependence " ) ,
145+ . enableExperimentalFeature(
146+ " InoutLifetimeDependence " ,
147+ . when( platforms: [ . macOS, . iOS, . watchOS, . tvOS, . linux] )
148+ ) ,
149+ . enableExperimentalFeature(
150+ " LifetimeDependenceMutableAccessors " ,
151+ . when( platforms: [ . macOS, . iOS, . watchOS, . tvOS, . linux] )
152+ ) ,
153+ . enableExperimentalFeature( " AddressableTypes " ) ,
154+ . enableExperimentalFeature( " AllowUnsafeAttribute " ) ,
155+ . enableExperimentalFeature( " BuiltinModule " ) ,
138156 . enableExperimentalFeature( " AccessLevelOnImport " )
139157 ] + availabilityMacros + featureSettings,
140158 linkerSettings: [
@@ -150,7 +168,16 @@ let package = Package(
150168 resources: [
151169 . copy( " Resources " )
152170 ] ,
153- swiftSettings: availabilityMacros + featureSettings
171+ swiftSettings: [
172+ . enableExperimentalFeature(
173+ " InoutLifetimeDependence " ,
174+ . when( platforms: [ . macOS, . iOS, . watchOS, . tvOS, . linux] )
175+ ) ,
176+ . enableExperimentalFeature(
177+ " LifetimeDependenceMutableAccessors " ,
178+ . when( platforms: [ . macOS, . iOS, . watchOS, . tvOS, . linux] )
179+ ) ,
180+ ] + availabilityMacros + featureSettings + testOnlySwiftSettings
154181 ) ,
155182
156183 // FoundationInternationalization
@@ -184,7 +211,7 @@ let package = Package(
184211 " TestSupport " ,
185212 " FoundationInternationalization " ,
186213 ] ,
187- swiftSettings: availabilityMacros + featureSettings
214+ swiftSettings: availabilityMacros + featureSettings + testOnlySwiftSettings
188215 ) ,
189216
190217 // FoundationMacros
@@ -213,10 +240,9 @@ package.targets.append(contentsOf: [
213240 . testTarget(
214241 name: " FoundationMacrosTests " ,
215242 dependencies: [
216- " FoundationMacros " ,
217- " TestSupport "
243+ " FoundationMacros "
218244 ] ,
219- swiftSettings: availabilityMacros + featureSettings
245+ swiftSettings: availabilityMacros + featureSettings + testOnlySwiftSettings
220246 )
221247] )
222248#endif
0 commit comments