build: update to latest zig master

This commit is contained in:
CJ van den Berg 2024-06-04 22:16:04 +02:00
parent 68a95a4984
commit 15e8cad161
5 changed files with 10 additions and 9 deletions

3
.gitignore vendored
View file

@ -1,3 +1,4 @@
/.cache/
/zig-*/
/zig-out/
/.zig-cache/
/themes/

View file

@ -3,12 +3,12 @@ const std = @import("std");
pub fn build(b: *std.Build) void {
const target = b.standardTargetOptions(.{});
const cbor_mod = b.createModule(.{ .root_source_file = .{ .path = "src/cbor.zig" } });
const theme_mod = b.createModule(.{ .root_source_file = .{ .path = "src/theme.zig" } });
const cbor_mod = b.createModule(.{ .root_source_file = b.path("src/cbor.zig") });
const theme_mod = b.createModule(.{ .root_source_file = b.path("src/theme.zig") });
const themes_compile = b.addExecutable(.{
.name = "themes_compile",
.target = target,
.root_source_file = .{ .path = "src/compile.zig" },
.root_source_file = b.path("src/compile.zig"),
});
add_themes(b, themes_compile);
themes_compile.root_module.addImport("cbor", cbor_mod);

View file

@ -1 +1 @@
0.12.0-dev.2341+92211135f
0.13.0-dev.363+7fc3fb955

View file

@ -2,11 +2,11 @@ const std = @import("std");
pub fn build(b: *std.Build) void {
const theme_mod = b.addModule("theme", .{
.root_source_file = .{ .path = "src/theme.zig" },
.root_source_file = b.path("src/theme.zig"),
});
_ = b.addModule("themes", .{
.root_source_file = .{ .path = "src/themes.zig" },
.root_source_file = b.path("src/themes.zig"),
.imports = &.{
.{ .name = "theme", .module = theme_mod },
},

View file

@ -943,7 +943,7 @@ fn fatal(comptime format: []const u8, args: anytype) noreturn {
fn hjson(data: []const u8) ![]const u8 {
const cmd = [_][]const u8{ "hjson", "-j" }; // Replace with your shell command
var child = std.ChildProcess.init(&cmd, allocator);
var child = std.process.Child.init(&cmd, allocator);
child.stdin_behavior = .Pipe;
child.stdout_behavior = .Pipe;
child.stderr_behavior = .Pipe;
@ -961,7 +961,7 @@ fn hjson(data: []const u8) ![]const u8 {
}
const term = try child.wait();
switch (term) {
std.ChildProcess.Term.Exited => |code| if (code == 0) return out.toOwnedSlice(),
std.process.Child.Term.Exited => |code| if (code == 0) return out.toOwnedSlice(),
else => {},
}
std.debug.panic("Exited with code {any}", .{term});