Commit bf2f1f2

Barrett Ruth  ·  2026-10-17 12:55:52 -0400 EDT
parent ad59851
feat: support OpenBSD
2 files changed,  +15, -5
▶ M build.zig
+7, -5
jump to top
......@@ -45,10 +45,9 @@ pub fn build(b: *std.Build) void {
4545 .@"emit-macos-app" = false,
4646 }) else null;
4747 if (dep) |d| {
48- exe_mod.addImport(
49- "ghostty-vt",
50- d.module("ghostty-vt"),
51- );
48+ const vt_mod = d.module("ghostty-vt");
49+ if (target.result.os.tag == .openbsd) vt_mod.sanitize_c = .off;
50+ exe_mod.addImport("ghostty-vt", vt_mod);
5251 }
5352
5453 // zmx module: programmatic interface for embedding or external tools
......@@ -58,9 +57,12 @@ pub fn build(b: *std.Build) void {
5857 .optimize = optimize,
5958 .link_libc = true,
6059 });
60+
6161 zmx_pkg_mod.addOptions("build_options", options);
6262 if (dep) |d| {
63- zmx_pkg_mod.addImport("ghostty-vt", d.module("ghostty-vt"));
63+ const vt_mod = d.module("ghostty-vt");
64+ if (target.result.os.tag == .openbsd) vt_mod.sanitize_c = .off;
65+ zmx_pkg_mod.addImport("ghostty-vt", vt_mod);
6466 }
6567
6668 // Examples: build the usage examples in examples/ against the zmx module
+8, -0
jump to top
......@@ -8,6 +8,14 @@ pub const c = switch (builtin.os.tag) {
88 @cInclude("stdlib.h");
99 @cInclude("unistd.h");
1010 }),
11+ .openbsd => @cImport({
12+ @cInclude("sys/types.h");
13+ @cInclude("sys/ioctl.h");
14+ @cInclude("termios.h");
15+ @cInclude("util.h"); // forkpty()
16+ @cInclude("stdlib.h");
17+ @cInclude("unistd.h");
18+ }),
1119 .freebsd => @cImport({
1220 @cInclude("termios.h"); // ioctl and constants
1321 @cInclude("libutil.h"); // openpty()