main journal function rewritten in zig #1

Manually merged
luna merged 9 commits from zig-translation into master 2019-08-11 14:20:16 +00:00
2 changed files with 29 additions and 0 deletions
Showing only changes of commit 97b2c0b6a9 - Show all commits

1
.gitignore vendored
View file

@ -53,3 +53,4 @@ Mkfile.old
dkms.conf
bin/
zig-cache/

28
build.zig Normal file
View file

@ -0,0 +1,28 @@
const Builder = @import("std").build.Builder;
pub fn build(b: *Builder) void {
const mode = b.standardReleaseOptions();
const exe = b.addExecutable("journal", null);
exe.setBuildMode(mode);
exe.linkSystemLibrary("c");
//exe.addCompileFlags([][]const u8{"-W -O"});
const source_files = [][]const u8{
"src/journal/main.c",
"src/journal/journal.c",
};
for (source_files) |source| {
exe.addCSourceFile(source, [][]const u8{});
}
// enable us to run the main journal executable via
// the build system
const run_cmd = exe.run();
const run_step = b.step("run", "Run journal");
run_step.dependOn(&run_cmd.step);
b.default_step.dependOn(&exe.step);
b.installArtifact(exe);
}