Commit bf2f1f2
Barrett Ruth
·
2026-10-17 12:55:52 -0400 EDT
parent ad59851
feat: support OpenBSD
2 files changed,
+15,
-5
+7,
-5
jump to top
+7,
-5
jump to top
| ... | ... | @@ -45,10 +45,9 @@ pub fn build(b: *std.Build) void { | |
| 45 | 45 | .@"emit-macos-app" = false, | |
| 46 | 46 | }) else null; | |
| 47 | 47 | 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); | |
| 52 | 51 | } | |
| 53 | 52 | ||
| 54 | 53 | // zmx module: programmatic interface for embedding or external tools |
| ... | ... | @@ -58,9 +57,12 @@ pub fn build(b: *std.Build) void { | |
| 58 | 57 | .optimize = optimize, | |
| 59 | 58 | .link_libc = true, | |
| 60 | 59 | }); | |
| 60 | + | ||
| 61 | 61 | zmx_pkg_mod.addOptions("build_options", options); | |
| 62 | 62 | 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); | |
| 64 | 66 | } | |
| 65 | 67 | ||
| 66 | 68 | // Examples: build the usage examples in examples/ against the zmx module |
+8,
-0
jump to top
+8,
-0
jump to top
| ... | ... | @@ -8,6 +8,14 @@ pub const c = switch (builtin.os.tag) { | |
| 8 | 8 | @cInclude("stdlib.h"); | |
| 9 | 9 | @cInclude("unistd.h"); | |
| 10 | 10 | }), | |
| 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 | + | }), | |
| 11 | 19 | .freebsd => @cImport({ | |
| 12 | 20 | @cInclude("termios.h"); // ioctl and constants | |
| 13 | 21 | @cInclude("libutil.h"); // openpty() |