diff options
Diffstat (limited to 'build.zig')
| -rw-r--r-- | build.zig | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/build.zig b/build.zig new file mode 100644 index 0000000..686fc56 --- /dev/null +++ b/build.zig @@ -0,0 +1,26 @@ +const Builder = @import("std").build.Builder; +const builtin = @import("builtin"); + +pub fn build(b: *Builder) void { + const mode = b.standardReleaseOptions(); + const windows = b.option(bool, "windows", "create windows build") orelse false; + + var exe = b.addExecutable("test", "src/main.zig"); + exe.setBuildMode(mode); + + if (windows) { + exe.setTarget(builtin.Arch.x86_64, builtin.Os.windows, builtin.Abi.gnu); + } + + exe.linkSystemLibrary("c"); + exe.linkSystemLibrary("glfw"); + exe.linkSystemLibrary("epoxy"); + exe.addIncludeDir("cimgui"); + exe.linkSystemLibraryName("cimgui/cimgui.so"); + exe.install(); + + const play = b.step("play", "Play the game"); + const run = exe.run(); + run.step.dependOn(b.getInstallStep()); + play.dependOn(&run.step); +} |
