From 6da2ef911260295f4a797af925d330dd71b6ea86 Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Tue, 2 Jul 2024 14:01:40 -0700 Subject: [PATCH] build: if emit-docs is not set, still create share/man --- build.zig | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/build.zig b/build.zig index f10b065da..976ace79d 100644 --- a/build.zig +++ b/build.zig @@ -446,7 +446,17 @@ pub fn build(b: *std.Build) !void { } // Documenation - if (emit_docs) try buildDocumentation(b, config); + if (emit_docs) { + try buildDocumentation(b, config); + } else { + // We need to create the zig-out/share/man directory so that + // macOS builds continue to work even if emit-docs doesn't + // work. + var wf = b.addWriteFiles(); + const path = "share/man/.placeholder"; + const placeholder = wf.add(path, "emit-docs not true so no man pages"); + b.getInstallStep().dependOn(&b.addInstallFile(placeholder, path).step); + } // App (Linux) if (target.result.os.tag == .linux and config.app_runtime != .none) {