mirror of
https://github.com/ghostty-org/ghostty.git
synced 2025-08-02 14:57:31 +03:00
fix various build scripts
This commit is contained in:
23
build.zig
23
build.zig
@ -250,7 +250,7 @@ pub fn build(b: *std.Build) !void {
|
||||
// If we're installing, we get the install step so we can add
|
||||
// additional dependencies to it.
|
||||
const install_step = if (app_runtime != .none) step: {
|
||||
const step = b.addInstallArtifact(exe);
|
||||
const step = b.addInstallArtifact(exe, .{});
|
||||
b.getInstallStep().dependOn(&step.step);
|
||||
break :step step;
|
||||
} else null;
|
||||
@ -392,7 +392,7 @@ pub fn build(b: *std.Build) !void {
|
||||
// App (Mac)
|
||||
if (target.isDarwin()) {
|
||||
const bin_install = b.addInstallFile(
|
||||
.{ .generated = &exe.output_path_source },
|
||||
exe.getEmittedBin(),
|
||||
"Ghostty.app/Contents/MacOS/ghostty",
|
||||
);
|
||||
b.getInstallStep().dependOn(&bin_install.step);
|
||||
@ -419,7 +419,7 @@ pub fn build(b: *std.Build) !void {
|
||||
|
||||
// Create a single static lib with all our dependencies merged
|
||||
var lib_list = try addDeps(b, lib, true);
|
||||
try lib_list.append(.{ .generated = &lib.output_path_source });
|
||||
try lib_list.append(lib.getEmittedBin());
|
||||
const libtool = LibtoolStep.create(b, .{
|
||||
.name = "ghostty",
|
||||
.out_name = "libghostty-aarch64-fat.a",
|
||||
@ -448,7 +448,7 @@ pub fn build(b: *std.Build) !void {
|
||||
|
||||
// Create a single static lib with all our dependencies merged
|
||||
var lib_list = try addDeps(b, lib, true);
|
||||
try lib_list.append(.{ .generated = &lib.output_path_source });
|
||||
try lib_list.append(lib.getEmittedBin());
|
||||
const libtool = LibtoolStep.create(b, .{
|
||||
.name = "ghostty",
|
||||
.out_name = "libghostty-x86_64-fat.a",
|
||||
@ -530,7 +530,7 @@ pub fn build(b: *std.Build) !void {
|
||||
_ = try addDeps(b, wasm, true);
|
||||
|
||||
// Install
|
||||
const wasm_install = b.addInstallArtifact(wasm);
|
||||
const wasm_install = b.addInstallArtifact(wasm, .{});
|
||||
wasm_install.dest_dir = .{ .prefix = {} };
|
||||
|
||||
const step = b.step("wasm", "Build the wasm library");
|
||||
@ -792,16 +792,19 @@ fn addDeps(
|
||||
|
||||
if (!lib) {
|
||||
// We always statically compile glad
|
||||
step.addIncludePath("vendor/glad/include/");
|
||||
step.addCSourceFile("vendor/glad/src/gl.c", &.{});
|
||||
step.addIncludePath(.{ .path = "vendor/glad/include/" });
|
||||
step.addCSourceFile(.{
|
||||
.file = .{ .path = "vendor/glad/src/gl.c" },
|
||||
.flags = &.{},
|
||||
});
|
||||
|
||||
// When we're targeting flatpak we ALWAYS link GTK so we
|
||||
// get access to glib for dbus.
|
||||
if (flatpak) {
|
||||
step.linkSystemLibrary("gtk4");
|
||||
switch (step.target.getCpuArch()) {
|
||||
.aarch64 => step.addLibraryPath("/usr/lib/aarch64-linux-gnu"),
|
||||
.x86_64 => step.addLibraryPath("/usr/lib/x86_64-linux-gnu"),
|
||||
.aarch64 => step.addLibraryPath(.{ .path = "/usr/lib/aarch64-linux-gnu" }),
|
||||
.x86_64 => step.addLibraryPath(.{ .path = "/usr/lib/x86_64-linux-gnu" }),
|
||||
else => @panic("unsupported flatpak target"),
|
||||
}
|
||||
}
|
||||
@ -915,7 +918,7 @@ fn conformanceSteps(
|
||||
.optimize = optimize,
|
||||
});
|
||||
|
||||
const install = b.addInstallArtifact(c_exe);
|
||||
const install = b.addInstallArtifact(c_exe, .{});
|
||||
install.dest_sub_path = "conformance";
|
||||
b.getInstallStep().dependOn(&install.step);
|
||||
|
||||
|
@ -44,8 +44,8 @@ pub fn link(
|
||||
) !*std.build.LibExeObjStep {
|
||||
const lib = try buildFontconfig(b, step, opt);
|
||||
step.linkLibrary(lib);
|
||||
step.addIncludePath(include_path);
|
||||
step.addIncludePath(include_path_self);
|
||||
step.addIncludePath(.{ .path = include_path });
|
||||
step.addIncludePath(.{ .path = include_path_self });
|
||||
return lib;
|
||||
}
|
||||
|
||||
@ -62,8 +62,8 @@ pub fn buildFontconfig(
|
||||
});
|
||||
|
||||
// Include
|
||||
lib.addIncludePath(include_path);
|
||||
lib.addIncludePath(include_path_self);
|
||||
lib.addIncludePath(.{ .path = include_path });
|
||||
lib.addIncludePath(.{ .path = include_path_self });
|
||||
|
||||
// Link
|
||||
lib.linkLibC();
|
||||
@ -74,7 +74,7 @@ pub fn buildFontconfig(
|
||||
lib.linkSystemLibrary("expat");
|
||||
|
||||
if (opt.expat.include) |dirs|
|
||||
for (dirs) |dir| lib.addIncludePath(dir);
|
||||
for (dirs) |dir| lib.addIncludePath(.{ .path = dir });
|
||||
}
|
||||
if (opt.freetype.enabled) {
|
||||
if (opt.freetype.step) |freetype|
|
||||
@ -83,7 +83,7 @@ pub fn buildFontconfig(
|
||||
lib.linkSystemLibrary("freetype2");
|
||||
|
||||
if (opt.freetype.include) |dirs|
|
||||
for (dirs) |dir| lib.addIncludePath(dir);
|
||||
for (dirs) |dir| lib.addIncludePath(.{ .path = dir });
|
||||
}
|
||||
if (!target.isWindows()) {
|
||||
lib.linkSystemLibrary("pthread");
|
||||
|
@ -37,7 +37,7 @@ pub fn link(
|
||||
) !*std.build.LibExeObjStep {
|
||||
const lib = try buildImgui(b, step, opt);
|
||||
step.linkLibrary(lib);
|
||||
inline for (include_paths) |path| step.addIncludePath(path);
|
||||
inline for (include_paths) |path| step.addIncludePath(.{ .path = path });
|
||||
return lib;
|
||||
}
|
||||
|
||||
@ -54,7 +54,7 @@ pub fn buildImgui(
|
||||
});
|
||||
|
||||
// Include
|
||||
inline for (include_paths) |path| lib.addIncludePath(path);
|
||||
inline for (include_paths) |path| lib.addIncludePath(.{ .path = path });
|
||||
|
||||
// Link
|
||||
lib.linkLibC();
|
||||
@ -88,7 +88,7 @@ pub fn buildImgui(
|
||||
lib.linkSystemLibrary("freetype2");
|
||||
|
||||
if (opt.freetype.include) |dirs|
|
||||
for (dirs) |dir| lib.addIncludePath(dir);
|
||||
for (dirs) |dir| lib.addIncludePath(.{ .path = dir });
|
||||
|
||||
// Enable in defines
|
||||
try flags.appendSlice(&.{
|
||||
@ -97,7 +97,10 @@ pub fn buildImgui(
|
||||
});
|
||||
|
||||
// Add necessary C file
|
||||
lib.addCSourceFile(root ++ "imgui/misc/freetype/imgui_freetype.cpp", flags.items);
|
||||
lib.addCSourceFile(.{
|
||||
.file = .{ .path = root ++ "imgui/misc/freetype/imgui_freetype.cpp" },
|
||||
.flags = flags.items,
|
||||
});
|
||||
}
|
||||
|
||||
// C files
|
||||
@ -117,7 +120,10 @@ pub fn buildImgui(
|
||||
.{ root, backend, ext },
|
||||
);
|
||||
|
||||
lib.addCSourceFile(path, flags.items);
|
||||
lib.addCSourceFile(.{
|
||||
.file = .{ .path = path },
|
||||
.flags = flags.items,
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
2
vendor/zig-libxml2
vendored
2
vendor/zig-libxml2
vendored
@ -1 +1 @@
|
||||
Subproject commit 252c732429a686e4a835831038263a554e752c40
|
||||
Subproject commit 5aae6093c9faa8699d4a39b530b44daf5df91c0e
|
Reference in New Issue
Block a user