Skip to content

Commit 90c6c21

Browse files
committed
std.Build.Step.Compile: getEmittedDocs API enhancements
* Allow calling it multiple times. * Rename it. Sorry, this is to coincide with #16353.
1 parent 2919d3d commit 90c6c21

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

build.zig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ pub fn build(b: *std.Build) !void {
6161
autodoc_test.overrideZigLibDir("lib");
6262
autodoc_test.emit_bin = .no_emit; // https://github.com/ziglang/zig/issues/16351
6363
const install_std_docs = b.addInstallDirectory(.{
64-
.source_dir = autodoc_test.getOutputDocs(),
64+
.source_dir = autodoc_test.getEmittedDocs(),
6565
.install_dir = .prefix,
6666
.install_subdir = "doc/std",
6767
});

lib/std/Build/Step/Compile.zig

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1004,8 +1004,8 @@ pub fn getOutputPdbSource(self: *Compile) FileSource {
10041004
return .{ .generated = &self.output_pdb_path_source };
10051005
}
10061006

1007-
pub fn getOutputDocs(self: *Compile) FileSource {
1008-
assert(self.generated_docs == null); // This function may only be called once.
1007+
pub fn getEmittedDocs(self: *Compile) FileSource {
1008+
if (self.generated_docs) |g| return .{ .generated = g };
10091009
const arena = self.step.owner.allocator;
10101010
const generated_file = arena.create(GeneratedFile) catch @panic("OOM");
10111011
generated_file.* = .{ .step = &self.step };

0 commit comments

Comments
 (0)