From 7b9e49a47fbacd2c776aab47470f1b769a6de58f Mon Sep 17 00:00:00 2001 From: "Jeffrey C. Ollie" Date: Fri, 20 Mar 2026 12:10:47 -0500 Subject: [PATCH] core: build pty.c only on certain platforms (avoids building os iOS) --- src/build/SharedDeps.zig | 42 +++++++++++++++++++++++----------------- 1 file changed, 24 insertions(+), 18 deletions(-) diff --git a/src/build/SharedDeps.zig b/src/build/SharedDeps.zig index cb0b609d5..fe3fb1b2f 100644 --- a/src/build/SharedDeps.zig +++ b/src/build/SharedDeps.zig @@ -136,24 +136,30 @@ pub fn add( self.config.terminalOptions().add(b, step.root_module); // C imports needed to manage/create PTYs - { - const c = b.addTranslateC(.{ - .root_source_file = b.path("src/pty.c"), - .target = target, - .optimize = optimize, - }); - switch (target.result.os.tag) { - .macos => { - const libc = try std.zig.LibCInstallation.findNative(.{ - .allocator = b.allocator, - .target = &target.result, - .verbose = false, - }); - c.addSystemIncludePath(.{ .cwd_relative = libc.sys_include_dir.? }); - }, - else => {}, - } - step.root_module.addImport("pty-c", c.createModule()); + switch (target.result.os.tag) { + .freebsd, + .linux, + .macos, + => { + const c = b.addTranslateC(.{ + .root_source_file = b.path("src/pty.c"), + .target = target, + .optimize = optimize, + }); + switch (target.result.os.tag) { + .macos => { + const libc = try std.zig.LibCInstallation.findNative(.{ + .allocator = b.allocator, + .target = &target.result, + .verbose = false, + }); + c.addSystemIncludePath(.{ .cwd_relative = libc.sys_include_dir.? }); + }, + else => {}, + } + step.root_module.addImport("pty-c", c.createModule()); + }, + else => {}, } // Freetype. We always include this even if our font backend doesn't