Wraps all ten subsystems of the Playdate SDK 3.1.1 C API (system, display, graphics, sprites, sound, file, JSON, Lua, scoreboards, network) in idiomatic Swift: namespaced APIs, wrapper types with ownership semantics, closures for callbacks, and typed throws. Written within the Embedded Swift subset so the same code can target the device. The SDK headers are resolved through a "playdate" pkg-config module (Scripts/install-pkgconfig.sh), so the package works as a normal SwiftPM dependency without unsafe build flags. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
40 lines
1.1 KiB
Swift
40 lines
1.1 KiB
Swift
// swift-tools-version: 6.4
|
|
|
|
import PackageDescription
|
|
|
|
let package = Package(
|
|
name: "play-date",
|
|
products: [
|
|
.library(
|
|
name: "PlayDate",
|
|
targets: ["PlayDate"]
|
|
),
|
|
],
|
|
targets: [
|
|
// The Playdate C API headers, resolved through the "playdate"
|
|
// pkg-config module. Run Scripts/install-pkgconfig.sh once to point
|
|
// it at your Playdate SDK installation.
|
|
.systemLibrary(
|
|
name: "CPlaydate",
|
|
path: "Sources/CPlaydate",
|
|
pkgConfig: "playdate"
|
|
),
|
|
.target(
|
|
name: "PlayDate",
|
|
dependencies: ["CPlaydate"],
|
|
path: "Sources/PlayDate",
|
|
swiftSettings: [
|
|
.enableUpcomingFeature("ApproachableConcurrency"),
|
|
],
|
|
),
|
|
.testTarget(
|
|
name: "PlayDateTests",
|
|
dependencies: ["PlayDate"],
|
|
path: "Tests/PlayDate",
|
|
swiftSettings: [
|
|
.enableUpcomingFeature("ApproachableConcurrency"),
|
|
],
|
|
),
|
|
]
|
|
)
|