aboutsummaryrefslogtreecommitdiff
path: root/build.zig
diff options
context:
space:
mode:
authorRobby Zambito <contact@robbyzambito.me>2026-02-01 20:57:58 -0500
committerRobby Zambito <contact@robbyzambito.me>2026-02-01 21:02:39 -0500
commitd1ca448835aed0699b6e5cb8bd03aee0dd05344e (patch)
treea3849cfed74d339ca1e7c400ba492d7fbce6ca5a /build.zig
parentf554e7a3bb472c2a8b9e123a7f8ca19a036ba4ac (diff)
parent2c9e648c2c9c487c0239760bff23a70c059f018f (diff)
Release v0.2.00.2.0
Diffstat (limited to 'build.zig')
-rw-r--r--build.zig19
1 files changed, 19 insertions, 0 deletions
diff --git a/build.zig b/build.zig
index 1b7e474..440917f 100644
--- a/build.zig
+++ b/build.zig
@@ -21,6 +21,9 @@ pub fn build(b: *std.Build) void {
// target and optimize options) will be listed when running `zig build --help`
// in this directory.
+ // Get default install step (called with `zig build` or `zig build install`)
+ const install_step = b.getInstallStep();
+
// This creates a module, which represents a collection of source files alongside
// some compilation options, such as optimization mode and linked system libraries.
// Zig modules are the preferred way of making Zig code available to consumers.
@@ -41,6 +44,22 @@ pub fn build(b: *std.Build) void {
.target = target,
});
+ // Only used to generate the documentation
+ const zaprus_lib = b.addLibrary(.{
+ .name = "zaprus",
+ .root_module = mod,
+ });
+
+ const docs_step = b.step("doc", "Emit documentation");
+ const docs_install = b.addInstallDirectory(.{
+ .install_dir = .prefix,
+ .install_subdir = "docs",
+ .source_dir = zaprus_lib.getEmittedDocs(),
+ });
+
+ docs_step.dependOn(&docs_install.step);
+ install_step.dependOn(docs_step);
+
// Create static library
const lib = b.addLibrary(.{
.name = "zaprus",