From 85d302d522863b377ed3dbb6a9674b79206cc26f Mon Sep 17 00:00:00 2001 From: Madeorsk Date: Fri, 11 Oct 2024 11:29:07 +0200 Subject: [PATCH] Add docs build in build.zig. --- build.zig | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/build.zig b/build.zig index 7e3faf3..e09137e 100644 --- a/build.zig +++ b/build.zig @@ -42,4 +42,16 @@ pub fn build(b: *std.Build) void { // running the unit tests. const test_step = b.step("test", "Run unit tests."); test_step.dependOn(&run_lib_unit_tests.step); + + + // Documentation generation. + const install_docs = b.addInstallDirectory(.{ + .source_dir = lib.getEmittedDocs(), + .install_dir = .prefix, + .install_subdir = "docs", + }); + + // Documentation generation step. + const docs_step = b.step("docs", "Emit documentation."); + docs_step.dependOn(&install_docs.step); }