Skip to content

Commit

Permalink
autodoc generation wip
Browse files Browse the repository at this point in the history
  • Loading branch information
floooh committed Aug 11, 2024
1 parent b226687 commit ff73289
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions build.zig
Original file line number Diff line number Diff line change
Expand Up @@ -61,4 +61,20 @@ pub fn build(b: *Build) void {
.optimize = optimize,
.mod_chipz = mod_chipz,
});
buildDocs(b, target);
}

fn buildDocs(b: *Build, target: Build.ResolvedTarget) void {
const obj_autodocs = b.addObject(.{
.name = "chipz",
.root_source_file = b.path("src/chipz.zig"),
.target = target,
.optimize = .Debug,
});
const install_autodocs = b.addInstallDirectory(.{
.source_dir = obj_autodocs.getEmittedDocs(),
.install_dir = .prefix,
.install_subdir = "docs",
});
b.getInstallStep().dependOn(&install_autodocs.step);
}

0 comments on commit ff73289

Please sign in to comment.