mirror of
https://github.com/ghostty-org/ghostty.git
synced 2026-05-20 12:01:34 +00:00
build: zig build run only builds xcframework for current arch
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
const Ghostty = @This();
|
||||
|
||||
const std = @import("std");
|
||||
const builtin = @import("builtin");
|
||||
const RunStep = std.Build.Step.Run;
|
||||
const Config = @import("Config.zig");
|
||||
const XCFramework = @import("GhosttyXCFramework.zig");
|
||||
@@ -40,6 +41,23 @@ pub fn init(
|
||||
xc_config,
|
||||
});
|
||||
|
||||
switch (xcframework.target) {
|
||||
// Universal is our default target, so we don't have to
|
||||
// add anything.
|
||||
.universal => {},
|
||||
|
||||
// Native we need to override the architecture in the Xcode
|
||||
// project with the -arch flag.
|
||||
.native => build.addArgs(&.{
|
||||
"-arch",
|
||||
switch (builtin.cpu.arch) {
|
||||
.aarch64 => "arm64",
|
||||
.x86_64 => "x86_64",
|
||||
else => @panic("unsupported macOS arch"),
|
||||
},
|
||||
}),
|
||||
}
|
||||
|
||||
// We need the xcframework
|
||||
build.step.dependOn(xcframework.xcframework.step);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user