authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2023-07-23 21:13:58-07:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2023-07-24 02:37:25-07:00
loge8fa19960243a99cef5d9af94c3db52173787a4e
treece9216bc3b770fd91c33579fe1a6f45ab8243141
parent575a7cccc0d9da542bd611f73e570d840f261bf5

std.Build.Step.Compile: getEmittedDocs API enhancements

* Allow calling it multiple times. * Rename it. Sorry, this is to coincide with #16353.

2 files changed, 3 insertions(+), 3 deletions(-)

build.zig+1-1
......@@ -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+2-2
......@@ -1004,8 +1004,8 @@ pub fn getOutputPdbSource(self: *Compile) FileSource {
10041004 return .{ .generated = &self.output_pdb_path_source };
10051005}
10061006
1007pub fn getOutputDocs(self: *Compile) FileSource {
1008 assert(self.generated_docs == null); // This function may only be called once.
1007pub 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 };