add build.zig

This commit is contained in:
Luna 2019-05-07 23:22:38 -03:00
parent 4327869d23
commit 97b2c0b6a9
2 changed files with 29 additions and 0 deletions

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);
}