mirror of
https://codeberg.org/ziglang/zig.git
synced 2026-03-08 06:04:46 +01:00
- 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)
28 lines
880 B
Zig
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);
|
|
}
|