Skip to content

Commit

Permalink
Attempt to fix #110
Browse files Browse the repository at this point in the history
  • Loading branch information
finnvoor committed Dec 25, 2024
1 parent dae77df commit 5808d20
Showing 1 changed file with 19 additions and 35 deletions.
54 changes: 19 additions & 35 deletions Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,31 @@ let package = Package(
.target(
name: "PlaydateKit",
dependencies: ["CPlaydate", "SwiftUnicodeDataTables"],
swiftSettings: swiftSettings
swiftSettings: [
.enableExperimentalFeature("Embedded"),
.unsafeFlags([
"-whole-module-optimization",
"-Xfrontend", "-disable-objc-interop",
"-Xfrontend", "-disable-stack-protector",
"-Xfrontend", "-function-sections",
"-Xfrontend", "-gline-tables-only",
"-Xcc", "-DTARGET_EXTENSION",
"-Xcc", "-I", "-Xcc", "/usr/local/playdate/gcc-arm-none-eabi-9-2019-q4-major/lib/gcc/arm-none-eabi/9.2.1/include",
"-Xcc", "-I", "-Xcc", "/usr/local/playdate/gcc-arm-none-eabi-9-2019-q4-major/lib/gcc/arm-none-eabi/9.2.1/include-fixed",
"-Xcc", "-I", "-Xcc", "/usr/local/playdate/gcc-arm-none-eabi-9-2019-q4-major/lib/gcc/arm-none-eabi/9.2.1/../../../../arm-none-eabi/include",
"-I", "\(Context.environment["PLAYDATE_SDK_PATH"] ?? "\(Context.environment["HOME"]!)/Developer/PlaydateSDK/")/C_API"
]),
]
),
.target(
name: "CPlaydate",
cSettings: [
.unsafeFlags([
"-DTARGET_EXTENSION",
"-I", "\(gccIncludePrefix)/include",
"-I", "\(gccIncludePrefix)/include-fixed",
"-I", "\(gccIncludePrefix)/../../../../arm-none-eabi/include",
"-I", "\(playdateSDKPath)/C_API"
"-I", "/usr/local/playdate/gcc-arm-none-eabi-9-2019-q4-major/lib/gcc/arm-none-eabi/9.2.1/include",
"-I", "/usr/local/playdate/gcc-arm-none-eabi-9-2019-q4-major/lib/gcc/arm-none-eabi/9.2.1/include-fixed",
"-I", "/usr/local/playdate/gcc-arm-none-eabi-9-2019-q4-major/lib/gcc/arm-none-eabi/9.2.1/../../../../arm-none-eabi/include",
"-I", "\(Context.environment["PLAYDATE_SDK_PATH"] ?? "\(Context.environment["HOME"]!)/Developer/PlaydateSDK/")/C_API"
])
]
),
Expand All @@ -42,33 +56,3 @@ let package = Package(
],
swiftLanguageModes: [.v6]
)

// MARK: - Helper Variables

// note: These must be computed variables when beneath the `let package =` declaration.

var swiftSettings: [SwiftSetting] { [
.enableExperimentalFeature("Embedded"),
.unsafeFlags([
"-whole-module-optimization",
"-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", "\(playdateSDKPath)/C_API"
]),
] }
var gccIncludePrefix: String {
"/usr/local/playdate/gcc-arm-none-eabi-9-2019-q4-major/lib/gcc/arm-none-eabi/9.2.1"
}

var playdateSDKPath: String {
if let path = Context.environment["PLAYDATE_SDK_PATH"] {
return path
}
return "\(Context.environment["HOME"]!)/Developer/PlaydateSDK/"
}

0 comments on commit 5808d20

Please sign in to comment.