Merge branch 'main' into mwp-fixes
This commit is contained in:
28
build.zig
28
build.zig
@@ -2010,6 +2010,34 @@ pub fn build(b: *std.Build) void {
|
||||
const check_step = b.step("check", "Check for compilation errors");
|
||||
check_step.dependOn(&check_exe.step);
|
||||
|
||||
// ============================================================
|
||||
// Documentation Generation
|
||||
// ============================================================
|
||||
const docs_module = b.createModule(.{
|
||||
.root_source_file = b.path("src/p2p.zig"),
|
||||
.target = target,
|
||||
.optimize = optimize,
|
||||
});
|
||||
docs_module.addImport("core", core_module);
|
||||
docs_module.addImport("network", network_module);
|
||||
docs_module.addImport("protocol", protocol_module);
|
||||
docs_module.addImport("files", files_module);
|
||||
docs_module.addImport("noise", noise_module);
|
||||
|
||||
const docs_lib = b.addLibrary(.{
|
||||
.name = "p2p",
|
||||
.root_module = docs_module,
|
||||
});
|
||||
|
||||
const install_docs = b.addInstallDirectory(.{
|
||||
.source_dir = docs_lib.getEmittedDocs(),
|
||||
.install_dir = .{ .custom = "../docs" },
|
||||
.install_subdir = "",
|
||||
});
|
||||
|
||||
const docs_step = b.step("docs", "Generate API documentation");
|
||||
docs_step.dependOn(&install_docs.step);
|
||||
|
||||
// ============================================================
|
||||
// Clean step (informational only)
|
||||
// ============================================================
|
||||
|
||||
Reference in New Issue
Block a user