aboutsummaryrefslogtreecommitdiff
path: root/vendor/libghostty-vt/src/terminal/build_options.zig
diff options
context:
space:
mode:
authorOgulcan Celik <ogulcancelik@gmail.com>2026-05-07 18:29:21 +0300
committerOgulcan Celik <ogulcancelik@gmail.com>2026-05-07 18:29:21 +0300
commitdcfe11a7588fcd42471159453810abc9b7720a57 (patch)
treec32a77266028e73ca2382b96c96f8438a5fcd621 /vendor/libghostty-vt/src/terminal/build_options.zig
parent2dfed860103c4e4505ac7f25def9fe37da1e1e6a (diff)
build: update libghostty-vt vendor
vendor ghostty 063ac3e and remove the musl libc++ link workaround. expose the new selection formatter and hyperlink uri apis for follow-up rendering work. add manual artifact validation for static linux builds.
Diffstat (limited to 'vendor/libghostty-vt/src/terminal/build_options.zig')
-rw-r--r--vendor/libghostty-vt/src/terminal/build_options.zig40
1 files changed, 27 insertions, 13 deletions
diff --git a/vendor/libghostty-vt/src/terminal/build_options.zig b/vendor/libghostty-vt/src/terminal/build_options.zig
index 6c0a4df6..136e0f10 100644
--- a/vendor/libghostty-vt/src/terminal/build_options.zig
+++ b/vendor/libghostty-vt/src/terminal/build_options.zig
@@ -2,6 +2,14 @@ const std = @import("std");
/// Options set by Zig build.zig and exposed via `terminal_options`.
pub const Options = struct {
+ pub const Artifact = enum {
+ /// Ghostty application
+ ghostty,
+
+ /// libghostty-vt, Zig module
+ lib,
+ };
+
/// The target artifact to build. This will gate some functionality.
artifact: Artifact,
@@ -47,34 +55,40 @@ pub const Options = struct {
opts.addOption(bool, "simd", self.simd);
opts.addOption(bool, "slow_runtime_safety", self.slow_runtime_safety);
+ // Kitty graphics is almost always true. This used to be conditional on
+ // some other factors but we've since generalized the implementation
+ // to support optional PNG decoding, OS capabilities like filesystems,
+ // etc. So its safe to always enable it and just have the
+ // implementation deal with unsupported features as needed.
+ //
+ // We disable it on wasm32-freestanding because we at the least
+ // require the ability to get timestamps and there is no way to
+ // do that with freestanding targets.
+ const target = m.resolved_target.?.result;
+ opts.addOption(
+ bool,
+ "kitty_graphics",
+ !(target.cpu.arch == .wasm32 and target.os.tag == .freestanding),
+ );
+
// These are synthesized based on other options.
- opts.addOption(bool, "kitty_graphics", self.oniguruma);
opts.addOption(bool, "tmux_control_mode", self.oniguruma);
// Version information.
- var buf: [1024]u8 = undefined;
opts.addOption(
[]const u8,
"version_string",
- std.fmt.bufPrint(
- &buf,
+ b.fmt(
"{f}",
.{self.version},
- ) catch @panic("version string too long"),
+ ),
);
opts.addOption(usize, "version_major", self.version.major);
opts.addOption(usize, "version_minor", self.version.minor);
opts.addOption(usize, "version_patch", self.version.patch);
+ opts.addOption(?[]const u8, "version_pre", self.version.pre);
opts.addOption(?[]const u8, "version_build", self.version.build);
m.addOptions("terminal_options", opts);
}
};
-
-pub const Artifact = enum {
- /// Ghostty application
- ghostty,
-
- /// libghostty-vt, Zig module
- lib,
-};