From 1836e941fd652be9854582b8b9dde4c8fc22eeac Mon Sep 17 00:00:00 2001 From: Jacob Hinchliffe Date: Sun, 16 Jan 2022 22:10:18 +0000 Subject: [PATCH 1/2] Generate documentation from doc comments. --- zig-ecs/build.zig | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/zig-ecs/build.zig b/zig-ecs/build.zig index 5648d61..3a37c3b 100644 --- a/zig-ecs/build.zig +++ b/zig-ecs/build.zig @@ -23,6 +23,11 @@ pub fn build(b: *Builder) void { exe.setOutputDir(std.fs.path.join(b.allocator, &[_][]const u8{ b.cache_root, "bin" }) catch unreachable); exe.addPackagePath("ecs", "src/ecs.zig"); exe.linkSystemLibrary("c"); + + exe.emit_docs = .emit; + const doc = b.step("docs", "Generate documentation."); + doc.dependOn(&exe.step); + const run_cmd = exe.run(); const exe_step = b.step(name, b.fmt("run {s}.zig", .{name})); From b630099aca2d34b2b8a0782db19ae95d2a8c8b97 Mon Sep 17 00:00:00 2001 From: Jacob Date: Sun, 16 Jan 2022 23:55:13 +0000 Subject: [PATCH 2/2] Update build.zig --- zig-ecs/build.zig | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/zig-ecs/build.zig b/zig-ecs/build.zig index 3a37c3b..c7798b7 100644 --- a/zig-ecs/build.zig +++ b/zig-ecs/build.zig @@ -24,9 +24,11 @@ pub fn build(b: *Builder) void { exe.addPackagePath("ecs", "src/ecs.zig"); exe.linkSystemLibrary("c"); - exe.emit_docs = .emit; - const doc = b.step("docs", "Generate documentation."); - doc.dependOn(&exe.step); + const docs = exe; + docs.emit_docs = .emit; + + const doc = b.step("docs", "Generate documentation"); + doc.dependOn(&docs.step); const run_cmd = exe.run();