From 9f015b7f4977f8f0d904dff047e36b81f27ea0ed Mon Sep 17 00:00:00 2001 From: Tim Culverhouse Date: Tue, 14 May 2024 12:53:29 -0500 Subject: [PATCH] docs: refactor docs build step --- build.zig | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/build.zig b/build.zig index 241b5f0..d5dabe9 100644 --- a/build.zig +++ b/build.zig @@ -93,18 +93,17 @@ pub fn build(b: *std.Build) void { b.default_step.dependOn(lints_step); // Docs - const docs = b.addStaticLibrary(.{ + const docs_step = b.step("docs", "Build the vaxis library docs"); + const docs_obj = b.addObject(.{ .name = "vaxis", .root_source_file = root_source_file, .target = target, .optimize = optimize, }); - docs.root_module.addImport("vaxis", vaxis_mod); - const build_docs = b.addInstallDirectory(.{ - .source_dir = docs.getEmittedDocs(), + const docs = docs_obj.getEmittedDocs(); + docs_step.dependOn(&b.addInstallDirectory(.{ + .source_dir = docs, .install_dir = .prefix, .install_subdir = "docs", - }); - const build_docs_step = b.step("docs", "Build the vaxis library docs"); - build_docs_step.dependOn(&build_docs.step); + }).step); }