docs: refactor docs build step
This commit is contained in:
parent
dea1a875e0
commit
9f015b7f49
1 changed files with 6 additions and 7 deletions
13
build.zig
13
build.zig
|
@ -93,18 +93,17 @@ pub fn build(b: *std.Build) void {
|
||||||
b.default_step.dependOn(lints_step);
|
b.default_step.dependOn(lints_step);
|
||||||
|
|
||||||
// Docs
|
// Docs
|
||||||
const docs = b.addStaticLibrary(.{
|
const docs_step = b.step("docs", "Build the vaxis library docs");
|
||||||
|
const docs_obj = b.addObject(.{
|
||||||
.name = "vaxis",
|
.name = "vaxis",
|
||||||
.root_source_file = root_source_file,
|
.root_source_file = root_source_file,
|
||||||
.target = target,
|
.target = target,
|
||||||
.optimize = optimize,
|
.optimize = optimize,
|
||||||
});
|
});
|
||||||
docs.root_module.addImport("vaxis", vaxis_mod);
|
const docs = docs_obj.getEmittedDocs();
|
||||||
const build_docs = b.addInstallDirectory(.{
|
docs_step.dependOn(&b.addInstallDirectory(.{
|
||||||
.source_dir = docs.getEmittedDocs(),
|
.source_dir = docs,
|
||||||
.install_dir = .prefix,
|
.install_dir = .prefix,
|
||||||
.install_subdir = "docs",
|
.install_subdir = "docs",
|
||||||
});
|
}).step);
|
||||||
const build_docs_step = b.step("docs", "Build the vaxis library docs");
|
|
||||||
build_docs_step.dependOn(&build_docs.step);
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue