summaryrefslogtreecommitdiff
path: root/build.zig
diff options
context:
space:
mode:
authorMitchell Hashimoto <m@mitchellh.com>2025-09-28 13:59:13 -0700
committerMitchell Hashimoto <m@mitchellh.com>2025-09-28 14:17:51 -0700
commitf614fb7c1b0bcf0f7256aea0040ec5425be09929 (patch)
treeaabf264dedfe54f323409d150a234c61f9b89f68 /build.zig
parent08ecbe328a2ef1feec00f0aee0b47755c22a81a7 (diff)
build: use build options to configure terminal C ABI mode
Fixes various issues: - C ABI detection was faulty, which caused some Zig programs to use the C ABI mode and some C programs not to. Let's be explicit. - Unit tests now tests C ABI mode. - Build binary no longer rebuilds on any terminal change (a regression). - Zig programs can choose to depend on the C ABI version of the terminal lib by using the `ghostty-vt-c` module.
Diffstat (limited to 'build.zig')
-rw-r--r--build.zig9
1 files changed, 9 insertions, 0 deletions
diff --git a/build.zig b/build.zig
index 008fc849e..62fa77511 100644
--- a/build.zig
+++ b/build.zig
@@ -255,6 +255,15 @@ pub fn build(b: *std.Build) !void {
});
const mod_vt_test_run = b.addRunArtifact(mod_vt_test);
test_lib_vt_step.dependOn(&mod_vt_test_run.step);
+
+ const mod_vt_c_test = b.addTest(.{
+ .root_module = mod.vt_c,
+ .target = config.target,
+ .optimize = config.optimize,
+ .filters = test_filters,
+ });
+ const mod_vt_c_test_run = b.addRunArtifact(mod_vt_c_test);
+ test_lib_vt_step.dependOn(&mod_vt_c_test_run.step);
}
// Tests