Skip to content

Commit

Permalink
build: update to latest zig master
Browse files Browse the repository at this point in the history
  • Loading branch information
neurocyte committed Jun 4, 2024
1 parent 68a95a4 commit 15e8cad
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 9 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/.cache/
/zig-*/
/zig-out/
/.zig-cache/
/themes/
6 changes: 3 additions & 3 deletions build.zig
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion build.zig.version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.12.0-dev.2341+92211135f
0.13.0-dev.363+7fc3fb955
4 changes: 2 additions & 2 deletions src/build-dest.zig
Original file line number Diff line number Diff line change
Expand Up @@ -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 },
},
Expand Down
4 changes: 2 additions & 2 deletions src/compile.zig
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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});
Expand Down

0 comments on commit 15e8cad

Please sign in to comment.