Skip to content
Merged
1 change: 1 addition & 0 deletions .github/workflows/swift-wasm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ jobs:
- name: Build
run: >-
SWIFTPM_ENABLE_MACROS=0
SWIFT_EMBEDDED=1
swift build
-c ${{ matrix.config }}
--swift-sdk swift-6.3.2-RELEASE_wasm-embedded
17 changes: 17 additions & 0 deletions Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,23 @@ package.targets[package.targets.count - 1] = .testTarget(
]
)

// Embedded Swift support (Foundation-free builds)
let enableEmbedded = environment["SWIFT_EMBEDDED"] == "1"
if enableEmbedded {
package.dependencies += [
.package(
url: "https://github.com/PureSwift/swift-embedded-foundation.git",
from: "0.1.0"
)
]
package.targets[0].dependencies += [
.product(
name: "FoundationEmbedded",
package: "swift-embedded-foundation"
)
]
}

// Skip (skip.dev) Fuse (native) transpilation support
let enableSkipFuse = environment["SKIP_FUSE"] == "1"
if enableSkipFuse {
Expand Down
19 changes: 19 additions & 0 deletions Sources/CoreModel/FoundationShims.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
//
// FoundationShims.swift
// CoreModel
//
// Re-exports Foundation value types from `FoundationEmbedded`
// (https://github.com/PureSwift/swift-embedded-foundation) for platforms
// without Foundation (e.g. Embedded Swift).
//

#if !canImport(FoundationEssentials) && !canImport(Foundation)
import FoundationEmbedded

public typealias Data = FoundationEmbedded.Data
public typealias UUID = FoundationEmbedded.UUID
public typealias Date = FoundationEmbedded.Date
public typealias TimeInterval = FoundationEmbedded.TimeInterval
public typealias Decimal = FoundationEmbedded.Decimal
public typealias URL = FoundationEmbedded.URL
#endif
110 changes: 0 additions & 110 deletions Sources/CoreModel/FoundationShims/Data.swift

This file was deleted.

118 changes: 0 additions & 118 deletions Sources/CoreModel/FoundationShims/Date.swift

This file was deleted.

Loading
Loading