build: if emit-docs is not set, still create share/man

This commit is contained in:
Mitchell Hashimoto
2024-07-02 14:01:40 -07:00
parent 4f8a7d3222
commit 6da2ef9112

View File

@ -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) {