-
Notifications
You must be signed in to change notification settings - Fork 31
/
Package.swift
54 lines (49 loc) · 1.58 KB
/
Package.swift
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
// swift-tools-version: 5.9
import PackageDescription
let gccIncludePrefix =
"/usr/local/playdate/gcc-arm-none-eabi-9-2019-q4-major/lib/gcc/arm-none-eabi/9.2.1"
guard let home = Context.environment["HOME"] else {
fatalError("could not determine home directory")
}
let swiftSettingsSimulator: [SwiftSetting] = [
.enableExperimentalFeature("Embedded"),
.unsafeFlags([
"-Xfrontend", "-disable-objc-interop",
"-Xfrontend", "-disable-stack-protector",
"-Xfrontend", "-function-sections",
"-Xfrontend", "-gline-tables-only",
"-Xcc", "-DTARGET_EXTENSION",
"-Xcc", "-I", "-Xcc", "\(gccIncludePrefix)/include",
"-Xcc", "-I", "-Xcc", "\(gccIncludePrefix)/include-fixed",
"-Xcc", "-I", "-Xcc", "\(gccIncludePrefix)/../../../../arm-none-eabi/include",
"-I", "\(home)/Developer/PlaydateSDK/C_API",
]),
]
let cSettingsSimulator: [CSetting] = [
.unsafeFlags([
"-DTARGET_EXTENSION",
"-I", "\(gccIncludePrefix)/include",
"-I", "\(gccIncludePrefix)/include-fixed",
"-I", "\(gccIncludePrefix)/../../../../arm-none-eabi/include",
"-I", "\(home)/Developer/PlaydateSDK/C_API",
])
]
let package = Package(
name: "swift-playdate-examples",
platforms: [
.macOS(.v14)
],
products: [
.library(name: "Playdate", targets: ["Playdate"]),
.library(name: "CPlaydate", targets: ["CPlaydate"]),
],
targets: [
.target(
name: "Playdate",
dependencies: ["CPlaydate"],
swiftSettings: swiftSettingsSimulator),
.target(
name: "CPlaydate",
cSettings: cSettingsSimulator),
],
swiftLanguageVersions: [.version("6"), .v5])