bingus/build.zig

44 lines
1.3 KiB
Zig

const std = @import("std");
pub fn build(b: *std.build.Builder) void {
const target = b.standardTargetOptions(.{});
const optimize = b.standardOptimizeOption(.{});
const exe = b.addExecutable(.{
.name = "bingus",
.root_source_file = .{ .path = "src/main.zig" },
.target = target,
.optimize = optimize,
});
const dep_args = .{ .target = target, .optimize = optimize };
const boxflow_dep = b.dependency("boxflow", dep_args);
const atlassian_dep = b.dependency("atlassian", dep_args);
const zalgebra_dep = b.dependency("zalgebra", dep_args);
exe.addModule("boxflow", boxflow_dep.module("boxflow"));
exe.addModule("atlassian", atlassian_dep.module("atlassian"));
exe.addModule("zalgebra", zalgebra_dep.module("zalgebra"));
exe.linkLibC();
exe.linkSystemLibrary("glfw3");
exe.linkSystemLibrary("freetype2");
//exe.strip = optimize != .Debug and optimize != .Re;
exe.strip = switch (optimize) {
.Debug, .ReleaseSafe => false,
.ReleaseFast, .ReleaseSmall => true,
};
b.installArtifact(exe);
const run_cmd = b.addRunArtifact(exe);
run_cmd.step.dependOn(b.getInstallStep());
if (b.args) |args| {
run_cmd.addArgs(args);
}
const run_step = b.step("run", "Run the app");
run_step.dependOn(&run_cmd.step);
}