build: make zig build run on macOS work with an empty zig-out

This commit is contained in:
Mitchell Hashimoto
2025-07-05 07:22:35 -07:00
parent 5fc0bbc58f
commit 8b44d0b3bb
5 changed files with 81 additions and 23 deletions

View File

@@ -29,15 +29,7 @@ pub fn build(b: *std.Build) !void {
// If we aren't emitting docs we need to emit a placeholder so
// our macOS xcodeproject builds since it expects the `share/man`
// directory to exist to copy into the app bundle.
var wf = b.addWriteFiles();
const path = "share/man/.placeholder";
b.getInstallStep().dependOn(&b.addInstallFile(
wf.add(
path,
"emit-docs not true so no man pages",
),
path,
).step);
docs.installDummy(b.getInstallStep());
}
// Ghostty webdata
@@ -155,6 +147,12 @@ pub fn build(b: *std.Build) !void {
&xcframework_native,
);
// The app depends on the resources and i18n to be in the
// install directory too.
resources.addStepDependencies(&macos_app_native_only.build.step);
i18n.addStepDependencies(&macos_app_native_only.build.step);
docs.installDummy(&macos_app_native_only.build.step);
const run_step = b.step("run", "Run the app");
run_step.dependOn(&macos_app_native_only.open.step);
}