authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2025-02-23 12:45:35-08:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2025-02-23 12:45:35-08:00
loge47f340e23b44426c3d70ccbf1d2db5409ce6885
tree608feef86e2a580bf4d5a4e827bc6b5256f97522
parent86f35479d9e0e0501a55d360467bf82dd45c54f9

std.Build.Step.ConfigHeader: follow deprecation policy


1 files changed, 6 insertions(+), 3 deletions(-)

lib/std/Build/Step/ConfigHeader.zig+6-3
...@@ -7,6 +7,9 @@ pub const Style = union(enum) {...@@ -7,6 +7,9 @@ pub const Style = union(enum) {
7 /// A configure format supported by autotools that uses `#undef foo` to7 /// A configure format supported by autotools that uses `#undef foo` to
8 /// mark lines that can be substituted with different values.8 /// mark lines that can be substituted with different values.
9 autoconf_undef: std.Build.LazyPath,9 autoconf_undef: std.Build.LazyPath,
10 /// Deprecated. Renamed to `autoconf_undef`.
11 /// To be removed after 0.14.0 is tagged.
12 autoconf: std.Build.LazyPath,
10 /// A configure format supported by autotools that uses `@FOO@` output variables.13 /// A configure format supported by autotools that uses `@FOO@` output variables.
11 autoconf_at: std.Build.LazyPath,14 autoconf_at: std.Build.LazyPath,
12 /// The configure format supported by CMake. It uses `@FOO@`, `${}` and15 /// The configure format supported by CMake. It uses `@FOO@`, `${}` and
...@@ -19,7 +22,7 @@ pub const Style = union(enum) {...@@ -19,7 +22,7 @@ pub const Style = union(enum) {
1922
20 pub fn getPath(style: Style) ?std.Build.LazyPath {23 pub fn getPath(style: Style) ?std.Build.LazyPath {
21 switch (style) {24 switch (style) {
22 .autoconf_undef, .autoconf_at, .cmake => |s| return s,25 .autoconf_undef, .autoconf, .autoconf_at, .cmake => |s| return s,
23 .blank, .nasm => return null,26 .blank, .nasm => return null,
24 }27 }
25 }28 }
...@@ -193,7 +196,7 @@ fn make(step: *Step, options: Step.MakeOptions) !void {...@@ -193,7 +196,7 @@ fn make(step: *Step, options: Step.MakeOptions) !void {
193 const asm_generated_line = "; " ++ header_text ++ "\n";196 const asm_generated_line = "; " ++ header_text ++ "\n";
194197
195 switch (config_header.style) {198 switch (config_header.style) {
196 .autoconf_undef, .autoconf_at => |file_source| {199 .autoconf_undef, .autoconf, .autoconf_at => |file_source| {
197 try output.appendSlice(c_generated_line);200 try output.appendSlice(c_generated_line);
198 const src_path = file_source.getPath2(b, step);201 const src_path = file_source.getPath2(b, step);
199 const contents = std.fs.cwd().readFileAlloc(arena, src_path, config_header.max_bytes) catch |err| {202 const contents = std.fs.cwd().readFileAlloc(arena, src_path, config_header.max_bytes) catch |err| {
...@@ -202,7 +205,7 @@ fn make(step: *Step, options: Step.MakeOptions) !void {...@@ -202,7 +205,7 @@ fn make(step: *Step, options: Step.MakeOptions) !void {
202 });205 });
203 };206 };
204 switch (config_header.style) {207 switch (config_header.style) {
205 .autoconf_undef => try render_autoconf_undef(step, contents, &output, config_header.values, src_path),208 .autoconf_undef, .autoconf => try render_autoconf_undef(step, contents, &output, config_header.values, src_path),
206 .autoconf_at => try render_autoconf_at(step, contents, &output, config_header.values, src_path),209 .autoconf_at => try render_autoconf_at(step, contents, &output, config_header.values, src_path),
207 else => unreachable,210 else => unreachable,
208 }211 }