1
Fork 0

update to zig 0.13.0

This commit is contained in:
Christofer Nolander 2024-07-31 09:46:49 +02:00
commit 370520949f
3 changed files with 7 additions and 7 deletions

2
.gitignore vendored
View file

@ -1,5 +1,5 @@
zig-out
zig-cache
.zig-cache
stderr.log
__pycache__
.venv

View file

@ -24,7 +24,7 @@ pub fn build(b: *std.Build) !void {
{
const unit_tests = b.addTest(.{
.name = "unit-tests",
.root_source_file = .{ .path = "src/main.zig" },
.root_source_file = b.path("src/main.zig"),
.target = target,
.optimize = optimize,
});
@ -75,7 +75,7 @@ fn addExecutable(b: *std.Build, options: struct {
}) !*std.Build.Step.Compile {
const exe = b.addExecutable(.{
.name = "glsl_analyzer",
.root_source_file = .{ .path = "src/main.zig" },
.root_source_file = b.path("src/main.zig"),
.target = options.target,
.optimize = options.optimize,
});
@ -88,7 +88,7 @@ fn attachModules(step: *std.Build.Step.Compile) !void {
step.linkLibC();
const compressed_spec = try CompressStep.create(b, "spec.json.zlib", .{ .path = b.pathFromRoot("spec/spec.json") });
const compressed_spec = try CompressStep.create(b, "spec.json.zlib", b.path("spec/spec.json"));
step.root_module.addAnonymousImport("glsl_spec.json.zlib", .{ .root_source_file = compressed_spec.getOutput() });
const options = b.addOptions();
@ -123,10 +123,10 @@ const CompressStep = struct {
}
pub fn getOutput(self: *@This()) std.Build.LazyPath {
return .{ .generated = &self.generated_file };
return .{ .generated = .{ .file = &self.generated_file } };
}
fn make(step: *std.Build.Step, _: *std.Progress.Node) anyerror!void {
fn make(step: *std.Build.Step, _: std.Progress.Node) anyerror!void {
const b = step.owner;
const self: *@This() = @fieldParentPtr("step", step);
const input_path = self.input.getPath(b);

View file

@ -1588,7 +1588,7 @@ pub const Tokenizer = struct {
}
}
break :blk std.ComptimeStringMap(Tag, table.slice());
break :blk std.StaticStringMap(Tag).initComptime(table.slice());
};
return map.get(identifier) orelse .identifier;