From 41dd733ca7123c9ac4bfc6c781697a660e95b052 Mon Sep 17 00:00:00 2001 From: Can Celik Date: Sat, 4 Apr 2026 19:22:04 +0300 Subject: feat: finish ghostty pane backend integration --- vendor/libghostty-vt/src/build/gtk.zig | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 vendor/libghostty-vt/src/build/gtk.zig (limited to 'vendor/libghostty-vt/src/build/gtk.zig') diff --git a/vendor/libghostty-vt/src/build/gtk.zig b/vendor/libghostty-vt/src/build/gtk.zig new file mode 100644 index 00000000..7adb3cdb --- /dev/null +++ b/vendor/libghostty-vt/src/build/gtk.zig @@ -0,0 +1,27 @@ +const std = @import("std"); + +pub const Targets = packed struct { + x11: bool = false, + wayland: bool = false, +}; + +/// Returns the targets that GTK4 was compiled with. +pub fn targets(b: *std.Build) Targets { + // Run pkg-config. We allow it to fail so that zig build --help + // works without all dependencies. The build will fail later when + // GTK isn't found anyways. + var code: u8 = undefined; + const output = b.runAllowFail( + &.{ "pkg-config", "--variable=targets", "gtk4" }, + &code, + .Ignore, + ) catch return .{}; + + const x11 = std.mem.indexOf(u8, output, "x11") != null; + const wayland = std.mem.indexOf(u8, output, "wayland") != null; + + return .{ + .x11 = x11, + .wayland = wayland, + }; +} -- cgit v1.2.3