Skip to content

Commit

Permalink
Merge pull request #7 from iacore/patch-1
Browse files Browse the repository at this point in the history
Make it build
  • Loading branch information
donpdonp authored Jul 13, 2024
2 parents 6600741 + 9eac324 commit b41a0a8
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 8 deletions.
5 changes: 1 addition & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,9 @@ GITEPOCH=$(shell git log -1 --format="%at")
TODAY=$(shell date +%Y.%m.%d -d @${GITEPOCH})
DIST=zootdeck-linux-`uname -i`-${TODAY}

build: ragel/lang.c
build:
zig build -freference-trace

ragel/lang.c: ragel/lang.c.rl
ragel -o ragel/lang.c ragel/lang.c.rl

format:
zig fmt src

Expand Down
10 changes: 7 additions & 3 deletions build.zig
Original file line number Diff line number Diff line change
Expand Up @@ -20,16 +20,20 @@ pub fn build(b: *std.Build) void {
// running `zig build`).
// b.installArtifact(lib);

const gen_ragel = b.addSystemCommand(&.{ "ragel", "-o", "ragel/lang.c", "ragel/lang.c.rl" });

const exe = b.addExecutable(.{
.name = "zootdeck",
.root_source_file = .{ .src_path = .{ .sub_path = "src/main.zig", .owner = b } },
.root_source_file = b.path("src/main.zig"),
.target = target,
.optimize = optimize,
});
exe.linkLibC();
exe.addIncludePath(.{ .cwd_relative = "." });
exe.addIncludePath(b.path("."));
exe.linkSystemLibrary("curl");
exe.linkSystemLibrary("lmdb");
exe.addCSourceFile(.{ .file = .{ .cwd_relative = "ragel/lang.c" } });
exe.addCSourceFile(.{ .file = b.path("ragel/lang.c") });
exe.step.dependOn(&gen_ragel.step);

// This declares intent for the executable to be installed into the
// standard location when the user invokes the "install" step (the default
Expand Down
2 changes: 1 addition & 1 deletion src/config.zig
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ pub fn writefile(settings: Settings, filename: []const u8) void {
if (std.fs.cwd().createFile(filename, .{ .truncate = true })) |*file| {
warn("config.write toJson\n", .{});
//std.json.stringify(configFile, std.json.StringifyOptions{}, file.writer()) catch unreachable;
warn("config saved. {s} {} bytes\n", .{ filename, file.getPos() });
warn("config saved. {s} {} bytes\n", .{ filename, file.getPos() catch unreachable });
file.close();
} else |err| {
warn("config save fail. {!}\n", .{err});
Expand Down

0 comments on commit b41a0a8

Please sign in to comment.