mirror of
https://git.robbyzambito.me/zaprus/
synced 2026-02-04 03:34:48 +00:00
Clean API and add docs
This commit is contained in:
19
build.zig
19
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",
|
||||
|
||||
Reference in New Issue
Block a user