Add FoundationURL trait (#118)

Add a default enabled trait "FoundationURL" that can be disabled for
users who don't want Foundation dependencies. Also enable
`InternalImportsByDefault`.
This commit is contained in:
Guoye Zhang authored and GitHub committed 2026-06-01 11:57:33 -07:00
1 parent bfafc0b613
commit f14fbc0e56
11 files changed
+140 -15

No files matched your search

+6 -2
View File
@@ -12,10 +12,12 @@
//
//===----------------------------------------------------------------------===//
#if FoundationURL
#if canImport(FoundationEssentials)
import FoundationEssentials
public import FoundationEssentials
#else // canImport(FoundationEssentials)
import Foundation
public import Foundation
#if canImport(CoreFoundation)
import CoreFoundation
#endif // canImport(CoreFoundation)
@@ -214,3 +216,5 @@ extension URL {
#endif // !canImport(FoundationEssentials) && canImport(CoreFoundation)
}
}
#endif