zig/test/standalone/config_header/build.zig
Linus Groh 39fa831947 std: Remove a handful of things deprecated during the 0.15 release cycle
- std.Build.Step.Compile.root_module mutators -> std.Build.Module
- std.Build.Step.Compile.want_lto -> std.Build.Step.Compile.lto
- std.Build.Step.ConfigHeader.getOutput -> std.Build.Step.ConfigHeader.getOutputFile
- std.Build.Step.Run.max_stdio_size -> std.Build.Step.Run.stdio_limit
- std.enums.nameCast -> @field(E, tag_name) / @field(E, @tagName(tag))
- std.Io.tty.detectConfig -> std.Io.tty.Config.detect
- std.mem.trimLeft -> std.mem.trimStart
- std.mem.trimRight -> std.mem.trimEnd
- std.meta.intToEnum -> std.enums.fromInt
- std.meta.TagPayload -> @FieldType(U, @tagName(tag))
- std.meta.TagPayloadByName -> @FieldType(U, tag_name)
2025-11-27 20:17:04 +00:00

28 lines
880 B
Zig

const std = @import("std");
pub fn build(b: *std.Build) void {
const config_header = b.addConfigHeader(
.{ .style = .{ .autoconf_undef = b.path("config.h.in") } },
.{
.SOME_NO = null,
.SOME_TRUE = true,
.SOME_FALSE = false,
.SOME_ZERO = 0,
.SOME_ONE = 1,
.SOME_TEN = 10,
.SOME_ENUM = @as(enum { foo, bar }, .foo),
.SOME_ENUM_LITERAL = .@"test",
.SOME_STRING = "test",
.PREFIX_SPACE = null,
.PREFIX_TAB = null,
.POSTFIX_SPACE = null,
.POSTFIX_TAB = null,
},
);
const check_config_header = b.addCheckFile(config_header.getOutputFile(), .{ .expected_exact = @embedFile("config.h") });
const test_step = b.step("test", "Test it");
test_step.dependOn(&check_config_header.step);
}