mirror of
https://github.com/ghostty-org/ghostty.git
synced 2025-04-24 18:38:39 +03:00
fix macos zig build test
failures
This commit is contained in:
18
build.zig
18
build.zig
@ -445,21 +445,21 @@ pub fn build(b: *std.Build) !void {
|
||||
}
|
||||
|
||||
// On Mac we can build the embedding library.
|
||||
if (builtin.target.isDarwin() and target.isDarwin()) {
|
||||
if (builtin.target.isDarwin() and target.result.isDarwin()) {
|
||||
const static_lib_aarch64 = lib: {
|
||||
const lib = b.addStaticLibrary(.{
|
||||
.name = "ghostty",
|
||||
.root_source_file = .{ .path = "src/main_c.zig" },
|
||||
.target = .{
|
||||
.target = b.resolveTargetQuery(.{
|
||||
.cpu_arch = .aarch64,
|
||||
.os_tag = .macos,
|
||||
.os_version_min = target.os_version_min,
|
||||
},
|
||||
.os_version_min = target.query.os_version_min,
|
||||
}),
|
||||
.optimize = optimize,
|
||||
});
|
||||
lib.bundle_compiler_rt = true;
|
||||
lib.linkLibC();
|
||||
lib.addOptions("build_options", exe_options);
|
||||
lib.root_module.addOptions("build_options", exe_options);
|
||||
|
||||
// Create a single static lib with all our dependencies merged
|
||||
var lib_list = try addDeps(b, lib, true);
|
||||
@ -479,16 +479,16 @@ pub fn build(b: *std.Build) !void {
|
||||
const lib = b.addStaticLibrary(.{
|
||||
.name = "ghostty",
|
||||
.root_source_file = .{ .path = "src/main_c.zig" },
|
||||
.target = .{
|
||||
.target = b.resolveTargetQuery(.{
|
||||
.cpu_arch = .x86_64,
|
||||
.os_tag = .macos,
|
||||
.os_version_min = target.os_version_min,
|
||||
},
|
||||
.os_version_min = target.query.os_version_min,
|
||||
}),
|
||||
.optimize = optimize,
|
||||
});
|
||||
lib.bundle_compiler_rt = true;
|
||||
lib.linkLibC();
|
||||
lib.addOptions("build_options", exe_options);
|
||||
lib.root_module.addOptions("build_options", exe_options);
|
||||
|
||||
// Create a single static lib with all our dependencies merged
|
||||
var lib_list = try addDeps(b, lib, true);
|
||||
|
@ -3,9 +3,9 @@
|
||||
const LibtoolStep = @This();
|
||||
|
||||
const std = @import("std");
|
||||
const Step = std.build.Step;
|
||||
const RunStep = std.build.RunStep;
|
||||
const FileSource = std.build.FileSource;
|
||||
const Step = std.Build.Step;
|
||||
const RunStep = std.Build.Step.Run;
|
||||
const LazyPath = std.Build.LazyPath;
|
||||
|
||||
pub const Options = struct {
|
||||
/// The name of this step.
|
||||
@ -16,14 +16,14 @@ pub const Options = struct {
|
||||
out_name: []const u8,
|
||||
|
||||
/// Library files (.a) to combine.
|
||||
sources: []FileSource,
|
||||
sources: []LazyPath,
|
||||
};
|
||||
|
||||
/// The step to depend on.
|
||||
step: *Step,
|
||||
|
||||
/// The output file from the libtool run.
|
||||
output: FileSource,
|
||||
output: LazyPath,
|
||||
|
||||
/// Run libtool against a list of library files to combine into a single
|
||||
/// static library.
|
||||
@ -33,7 +33,7 @@ pub fn create(b: *std.Build, opts: Options) *LibtoolStep {
|
||||
const run_step = RunStep.create(b, b.fmt("libtool {s}", .{opts.name}));
|
||||
run_step.addArgs(&.{ "libtool", "-static", "-o" });
|
||||
const output = run_step.addOutputFileArg(opts.out_name);
|
||||
for (opts.sources) |source| run_step.addFileSourceArg(source);
|
||||
for (opts.sources) |source| run_step.addFileArg(source);
|
||||
|
||||
self.* = .{
|
||||
.step = &run_step.step,
|
||||
|
@ -3,9 +3,9 @@
|
||||
const LipoStep = @This();
|
||||
|
||||
const std = @import("std");
|
||||
const Step = std.build.Step;
|
||||
const RunStep = std.build.RunStep;
|
||||
const FileSource = std.build.FileSource;
|
||||
const Step = std.Build.Step;
|
||||
const RunStep = std.Build.Step.Run;
|
||||
const LazyPath = std.Build.LazyPath;
|
||||
|
||||
pub const Options = struct {
|
||||
/// The name of the xcframework to create.
|
||||
@ -15,14 +15,14 @@ pub const Options = struct {
|
||||
out_name: []const u8,
|
||||
|
||||
/// Library file (dylib, a) to package.
|
||||
input_a: FileSource,
|
||||
input_b: FileSource,
|
||||
input_a: LazyPath,
|
||||
input_b: LazyPath,
|
||||
};
|
||||
|
||||
step: *Step,
|
||||
|
||||
/// Resulting binary
|
||||
output: FileSource,
|
||||
output: LazyPath,
|
||||
|
||||
pub fn create(b: *std.Build, opts: Options) *LipoStep {
|
||||
const self = b.allocator.create(LipoStep) catch @panic("OOM");
|
||||
@ -30,8 +30,8 @@ pub fn create(b: *std.Build, opts: Options) *LipoStep {
|
||||
const run_step = RunStep.create(b, b.fmt("lipo {s}", .{opts.name}));
|
||||
run_step.addArgs(&.{ "lipo", "-create", "-output" });
|
||||
const output = run_step.addOutputFileArg(opts.out_name);
|
||||
run_step.addFileSourceArg(opts.input_a);
|
||||
run_step.addFileSourceArg(opts.input_b);
|
||||
run_step.addFileArg(opts.input_a);
|
||||
run_step.addFileArg(opts.input_b);
|
||||
|
||||
self.* = .{
|
||||
.step = &run_step.step,
|
||||
|
@ -4,9 +4,9 @@
|
||||
const XCFrameworkStep = @This();
|
||||
|
||||
const std = @import("std");
|
||||
const Step = std.build.Step;
|
||||
const RunStep = std.build.RunStep;
|
||||
const FileSource = std.build.FileSource;
|
||||
const Step = std.Build.Step;
|
||||
const RunStep = std.Build.Step.Run;
|
||||
const LazyPath = std.Build.LazyPath;
|
||||
|
||||
pub const Options = struct {
|
||||
/// The name of the xcframework to create.
|
||||
@ -16,10 +16,10 @@ pub const Options = struct {
|
||||
out_path: []const u8,
|
||||
|
||||
/// Library file (dylib, a) to package.
|
||||
library: std.build.FileSource,
|
||||
library: LazyPath,
|
||||
|
||||
/// Path to a directory with the headers.
|
||||
headers: std.build.FileSource,
|
||||
headers: LazyPath,
|
||||
};
|
||||
|
||||
step: *Step,
|
||||
@ -42,9 +42,9 @@ pub fn create(b: *std.Build, opts: Options) *XCFrameworkStep {
|
||||
run.has_side_effects = true;
|
||||
run.addArgs(&.{ "xcodebuild", "-create-xcframework" });
|
||||
run.addArg("-library");
|
||||
run.addFileSourceArg(opts.library);
|
||||
run.addFileArg(opts.library);
|
||||
run.addArg("-headers");
|
||||
run.addFileSourceArg(opts.headers);
|
||||
run.addFileArg(opts.headers);
|
||||
run.addArg("-output");
|
||||
run.addArg(opts.out_path);
|
||||
break :run run;
|
||||
|
Reference in New Issue
Block a user