Skip to content

Commit 302f0ff

Browse files
Add a target to mimic apple's Spatial framework for non-apple platforms
1 parent 3b378a6 commit 302f0ff

2 files changed

Lines changed: 14 additions & 1 deletion

File tree

Package.swift

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ let package = Package(
1010
products: [
1111
.library(
1212
name: "SwiftSpatial",
13-
targets: ["SwiftSpatial"])
13+
targets: ["SwiftSpatial"]),
1414
],
1515
dependencies: [
1616
.package(url: "https://github.com/keyvariable/kvSIMD.swift.git", from: "1.0.3"),
@@ -41,3 +41,12 @@ let package = Package(
4141
),
4242
]
4343
)
44+
45+
#if !canImport(Spatial)
46+
package.targets.append(
47+
.target(name: "Spatial", dependencies: ["SwiftSpatial"])
48+
)
49+
package.products.append(
50+
.library(name: "Spatial", targets: ["Spatial"])
51+
)
52+
#endif

Sources/Spatial/Spatial.swift

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
// Export all of the SwiftSpatial public API
2+
// This is for replacing apple's Spatial on linux and windows without modifying the code
3+
4+
@_exported import SwiftSpatial

0 commit comments

Comments
 (0)