mirror of
https://github.com/ghostty-org/ghostty.git
synced 2026-06-16 00:21:24 +00:00
Merge branch 'main' into fix/xcframework-macos-dependency
This commit is contained in:
@@ -1,6 +1,35 @@
|
||||
// swift-tools-version: 5.9
|
||||
import Foundation
|
||||
import PackageDescription
|
||||
|
||||
func existingXCFrameworkPath() -> String {
|
||||
let fm = FileManager.default
|
||||
let candidates = [
|
||||
"../../zig-out/lib/ghostty-vt.xcframework",
|
||||
"../../zig-out/xcframeworks/ghostty-vt.xcframework",
|
||||
"../../zig-out/ghostty-vt.xcframework",
|
||||
]
|
||||
|
||||
for rel in candidates {
|
||||
let plist = "\(rel)/Info.plist"
|
||||
var isDir: ObjCBool = false
|
||||
if fm.fileExists(atPath: rel, isDirectory: &isDir),
|
||||
isDir.boolValue,
|
||||
fm.fileExists(atPath: plist)
|
||||
{
|
||||
return rel // important to return relative path
|
||||
}
|
||||
}
|
||||
|
||||
fatalError(
|
||||
"""
|
||||
GhosttyVt XCFramework not found.
|
||||
Build it first (must produce a valid *.xcframework with Info.plist).
|
||||
Tried:
|
||||
\(candidates.joined(separator: "\n"))
|
||||
""")
|
||||
}
|
||||
|
||||
let package = Package(
|
||||
name: "swift-vt-xcframework",
|
||||
platforms: [.macOS(.v13)],
|
||||
@@ -8,11 +37,12 @@ let package = Package(
|
||||
.executableTarget(
|
||||
name: "swift-vt-xcframework",
|
||||
dependencies: ["GhosttyVt"],
|
||||
path: "Sources"
|
||||
path: "Sources",
|
||||
linkerSettings: [.linkedLibrary("c++")]
|
||||
),
|
||||
.binaryTarget(
|
||||
name: "GhosttyVt",
|
||||
path: "../../zig-out/lib/ghostty-vt.xcframework"
|
||||
path: existingXCFrameworkPath()
|
||||
),
|
||||
]
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user