river/build.zig

34 lines
1.3 KiB
Zig
Raw Normal View History

2020-03-19 08:29:22 -07:00
const Builder = @import("std").build.Builder;
pub fn build(b: *Builder) void {
// Standard target options allows the person running `zig build` to choose
// what target to build for. Here we do not override the defaults, which
// means any target is allowed, and the default is native. Other options
// for restricting supported target set are available.
const target = b.standardTargetOptions(.{});
// Standard release options allow the person running `zig build` to select
// between Debug, ReleaseSafe, ReleaseFast, and ReleaseSmall.
const mode = b.standardReleaseOptions();
2020-03-27 03:58:59 -07:00
const exe = b.addExecutable("river", "src/main.zig");
2020-03-19 08:29:22 -07:00
exe.setTarget(target);
exe.setBuildMode(mode);
2020-03-20 18:34:59 -07:00
exe.addIncludeDir("protocol");
2020-03-19 08:29:22 -07:00
exe.linkLibC();
2020-03-20 18:34:59 -07:00
exe.addIncludeDir("/usr/include/pixman-1");
exe.addCSourceFile("include/render.c", &[_][]const u8{"-std=c99"});
exe.addIncludeDir(".");
2020-03-20 18:34:59 -07:00
//exe.linkSystemLibrary("pixman");
2020-03-20 14:52:03 -07:00
exe.linkSystemLibrary("wayland-server");
exe.linkSystemLibrary("wlroots");
exe.linkSystemLibrary("xkbcommon");
2020-03-19 08:29:22 -07:00
exe.install();
const run_cmd = exe.run();
run_cmd.step.dependOn(b.getInstallStep());
const run_step = b.step("run", "Run the app");
run_step.dependOn(&run_cmd.step);
}