lunabot/build.zig

32 lines
894 B
Zig
Raw Normal View History

2019-05-08 02:22:38 +00:00
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");
2019-07-13 12:55:01 +00:00
const source_files = [_][]const u8{"src/journal/main.c"};
2019-05-08 02:22:38 +00:00
for (source_files) |source| {
2019-08-11 14:17:13 +00:00
exe.addCSourceFile(source, [_][]const u8{"-Wall"});
2019-05-09 02:34:12 +00:00
}
2019-07-13 12:55:01 +00:00
const zig_sources = [_][]const u8{"src/journal/journal.zig"};
2019-05-09 02:34:12 +00:00
for (zig_sources) |source| {
const obj = b.addObject("journal", source);
obj.linkSystemLibrary("c");
exe.addObject(obj);
2019-05-08 02:22:38 +00:00
}
// 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);
}