Skip to content

Commit e47f340

Browse files
committed
std.Build.Step.ConfigHeader: follow deprecation policy
1 parent 86f3547 commit e47f340

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

lib/std/Build/Step/ConfigHeader.zig

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@ pub const Style = union(enum) {
77
/// A configure format supported by autotools that uses `#undef foo` to
88
/// mark lines that can be substituted with different values.
99
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,
1013
/// A configure format supported by autotools that uses `@FOO@` output variables.
1114
autoconf_at: std.Build.LazyPath,
1215
/// The configure format supported by CMake. It uses `@FOO@`, `${}` and
@@ -19,7 +22,7 @@ pub const Style = union(enum) {
1922

2023
pub fn getPath(style: Style) ?std.Build.LazyPath {
2124
switch (style) {
22-
.autoconf_undef, .autoconf_at, .cmake => |s| return s,
25+
.autoconf_undef, .autoconf, .autoconf_at, .cmake => |s| return s,
2326
.blank, .nasm => return null,
2427
}
2528
}
@@ -193,7 +196,7 @@ fn make(step: *Step, options: Step.MakeOptions) !void {
193196
const asm_generated_line = "; " ++ header_text ++ "\n";
194197

195198
switch (config_header.style) {
196-
.autoconf_undef, .autoconf_at => |file_source| {
199+
.autoconf_undef, .autoconf, .autoconf_at => |file_source| {
197200
try output.appendSlice(c_generated_line);
198201
const src_path = file_source.getPath2(b, step);
199202
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 {
202205
});
203206
};
204207
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),
206209
.autoconf_at => try render_autoconf_at(step, contents, &output, config_header.values, src_path),
207210
else => unreachable,
208211
}

0 commit comments

Comments
 (0)