aboutsummaryrefslogtreecommitdiff
path: root/lib/std/Build
diff options
context:
space:
mode:
authorAndrew Kelley <andrew@ziglang.org>2025-02-23 12:45:35 -0800
committerAndrew Kelley <andrew@ziglang.org>2025-02-23 12:45:35 -0800
commite47f340e23b44426c3d70ccbf1d2db5409ce6885 (patch)
tree608feef86e2a580bf4d5a4e827bc6b5256f97522 /lib/std/Build
parent86f35479d9e0e0501a55d360467bf82dd45c54f9 (diff)
downloadzig-e47f340e23b44426c3d70ccbf1d2db5409ce6885.tar.gz
zig-e47f340e23b44426c3d70ccbf1d2db5409ce6885.zip
std.Build.Step.ConfigHeader: follow deprecation policy
Diffstat (limited to 'lib/std/Build')
-rw-r--r--lib/std/Build/Step/ConfigHeader.zig9
1 files changed, 6 insertions, 3 deletions
diff --git a/lib/std/Build/Step/ConfigHeader.zig b/lib/std/Build/Step/ConfigHeader.zig
index ca866a87c6..6bfda7667b 100644
--- a/lib/std/Build/Step/ConfigHeader.zig
+++ b/lib/std/Build/Step/ConfigHeader.zig
@@ -7,6 +7,9 @@ pub const Style = union(enum) {
/// A configure format supported by autotools that uses `#undef foo` to
/// mark lines that can be substituted with different values.
autoconf_undef: std.Build.LazyPath,
+ /// Deprecated. Renamed to `autoconf_undef`.
+ /// To be removed after 0.14.0 is tagged.
+ autoconf: std.Build.LazyPath,
/// A configure format supported by autotools that uses `@FOO@` output variables.
autoconf_at: std.Build.LazyPath,
/// The configure format supported by CMake. It uses `@FOO@`, `${}` and
@@ -19,7 +22,7 @@ pub const Style = union(enum) {
pub fn getPath(style: Style) ?std.Build.LazyPath {
switch (style) {
- .autoconf_undef, .autoconf_at, .cmake => |s| return s,
+ .autoconf_undef, .autoconf, .autoconf_at, .cmake => |s| return s,
.blank, .nasm => return null,
}
}
@@ -193,7 +196,7 @@ fn make(step: *Step, options: Step.MakeOptions) !void {
const asm_generated_line = "; " ++ header_text ++ "\n";
switch (config_header.style) {
- .autoconf_undef, .autoconf_at => |file_source| {
+ .autoconf_undef, .autoconf, .autoconf_at => |file_source| {
try output.appendSlice(c_generated_line);
const src_path = file_source.getPath2(b, step);
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 {
});
};
switch (config_header.style) {
- .autoconf_undef => try render_autoconf_undef(step, contents, &output, config_header.values, src_path),
+ .autoconf_undef, .autoconf => try render_autoconf_undef(step, contents, &output, config_header.values, src_path),
.autoconf_at => try render_autoconf_at(step, contents, &output, config_header.values, src_path),
else => unreachable,
}