build: update zig
This commit is contained in:
parent
061494e81a
commit
d00e76f3ab
3 changed files with 9 additions and 7 deletions
|
@ -1 +1 @@
|
|||
0.12.0-dev.3439+31a7f22b8
|
||||
0.12.0-dev.3496+a2df84d0f
|
||||
|
|
|
@ -8,8 +8,8 @@
|
|||
.hash = "1220882e05fd3aad5cfdcf13b988b0ecb26a7009870379a1e7aa7fad9e2486b3a8fa",
|
||||
},
|
||||
.clap = .{
|
||||
.url = "https://github.com/Hejsil/zig-clap/archive/209ba4da76e46412acfe18f711cb0b041ff37f10.tar.gz",
|
||||
.hash = "12200103e7b4a0cb162f2912df4fe97914024a25b5c9fcce6ea4119744f3f2a7f24e",
|
||||
.url = "https://github.com/Hejsil/zig-clap/archive/8c98e6404b22aafc0184e999d8f068b81cc22fa1.tar.gz",
|
||||
.hash = "122014e73fd712190e109950837b97f6143f02d7e2b6986e1db70b6f4aadb5ba6a0d",
|
||||
},
|
||||
.tracy = .{
|
||||
.url = "https://github.com/neurocyte/zig-tracy/archive/d2113e7d778ebe7a063e95b5182ff145343aac38.tar.gz",
|
||||
|
|
|
@ -139,7 +139,7 @@ fn getTargetType(comptime Namespace: type) type {
|
|||
return @field(Namespace, "Target");
|
||||
}
|
||||
|
||||
fn getCommands(comptime Namespace: type) []CmdDef(*getTargetType(Namespace)) {
|
||||
fn getCommands(comptime Namespace: type) []const CmdDef(*getTargetType(Namespace)) {
|
||||
comptime switch (@typeInfo(Namespace)) {
|
||||
.Struct => |info| {
|
||||
var count = 0;
|
||||
|
@ -158,7 +158,8 @@ fn getCommands(comptime Namespace: type) []CmdDef(*getTargetType(Namespace)) {
|
|||
i += 1;
|
||||
}
|
||||
}
|
||||
return &cmds;
|
||||
const cmds_const = cmds;
|
||||
return &cmds_const;
|
||||
},
|
||||
else => @compileError("expected tuple or struct type"),
|
||||
};
|
||||
|
@ -168,10 +169,10 @@ pub fn Collection(comptime Namespace: type) type {
|
|||
const cmds = comptime getCommands(Namespace);
|
||||
const Target = getTargetType(Namespace);
|
||||
const Clsr = Closure(*Target);
|
||||
var fields: [cmds.len]std.builtin.Type.StructField = undefined;
|
||||
var fields_var: [cmds.len]std.builtin.Type.StructField = undefined;
|
||||
inline for (cmds, 0..) |cmd, i| {
|
||||
@setEvalBranchQuota(10_000);
|
||||
fields[i] = .{
|
||||
fields_var[i] = .{
|
||||
.name = cmd.name,
|
||||
.type = Clsr,
|
||||
.default_value = null,
|
||||
|
@ -179,6 +180,7 @@ pub fn Collection(comptime Namespace: type) type {
|
|||
.alignment = if (@sizeOf(Clsr) > 0) @alignOf(Clsr) else 0,
|
||||
};
|
||||
}
|
||||
const fields: [cmds.len]std.builtin.Type.StructField = fields_var;
|
||||
const Fields = @Type(.{
|
||||
.Struct = .{
|
||||
.is_tuple = false,
|
||||
|
|
Loading…
Add table
Reference in a new issue