mirror of
https://codeberg.org/ziglang/zig.git
synced 2025-12-06 13:54:21 +00:00
std.Build.Step.Compile: getEmittedDocs API enhancements
* Allow calling it multiple times. * Rename it. Sorry, this is to coincide with #16353.
This commit is contained in:
parent
575a7cccc0
commit
e8fa199602
2 changed files with 3 additions and 3 deletions
|
|
@ -61,7 +61,7 @@ pub fn build(b: *std.Build) !void {
|
||||||
autodoc_test.overrideZigLibDir("lib");
|
autodoc_test.overrideZigLibDir("lib");
|
||||||
autodoc_test.emit_bin = .no_emit; // https://github.com/ziglang/zig/issues/16351
|
autodoc_test.emit_bin = .no_emit; // https://github.com/ziglang/zig/issues/16351
|
||||||
const install_std_docs = b.addInstallDirectory(.{
|
const install_std_docs = b.addInstallDirectory(.{
|
||||||
.source_dir = autodoc_test.getOutputDocs(),
|
.source_dir = autodoc_test.getEmittedDocs(),
|
||||||
.install_dir = .prefix,
|
.install_dir = .prefix,
|
||||||
.install_subdir = "doc/std",
|
.install_subdir = "doc/std",
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -1004,8 +1004,8 @@ pub fn getOutputPdbSource(self: *Compile) FileSource {
|
||||||
return .{ .generated = &self.output_pdb_path_source };
|
return .{ .generated = &self.output_pdb_path_source };
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn getOutputDocs(self: *Compile) FileSource {
|
pub fn getEmittedDocs(self: *Compile) FileSource {
|
||||||
assert(self.generated_docs == null); // This function may only be called once.
|
if (self.generated_docs) |g| return .{ .generated = g };
|
||||||
const arena = self.step.owner.allocator;
|
const arena = self.step.owner.allocator;
|
||||||
const generated_file = arena.create(GeneratedFile) catch @panic("OOM");
|
const generated_file = arena.create(GeneratedFile) catch @panic("OOM");
|
||||||
generated_file.* = .{ .step = &self.step };
|
generated_file.* = .{ .step = &self.step };
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue