game/build.zig

43 lines
1.1 KiB
Zig

const std = @import("std");
pub fn build(b: *std.Build) void {
const target = b.standardTargetOptions(.{});
const optimize = b.standardOptimizeOption(.{});
const exe_mod = b.createModule(.{
.root_source_file = b.path("src/main.zig"),
.target = target,
.optimize = optimize,
});
exe_mod.addIncludePath(.{ .cwd_relative = "./deps/"});
const exe = b.addExecutable(.{
.name = "game",
.root_module = exe_mod,
});
exe.root_module.addCMacro("GL_GLEXT_PROTOTYPES", "1");
exe.linkLibC();
exe.linkSystemLibrary("OpenGl");
exe.linkSystemLibrary("X11");
exe.linkSystemLibrary("GLX");
exe.linkSystemLibrary("gallium");
exe.addLibraryPath(.{ .cwd_relative = "./libs/" });
exe.linkSystemLibrary("openwindow");
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);
}