diff options
Diffstat (limited to '')
| -rw-r--r-- | build.zig | 37 |
1 files changed, 22 insertions, 15 deletions
@@ -2,22 +2,29 @@ const Builder = @import("std").build.Builder; const builtin = @import("builtin"); pub fn build(b: *Builder) void { - const target = b.standardTargetOptions(.{}); - const mode = b.standardReleaseOptions(); - const windows = b.option(bool, "windows", "create windows build") orelse false; + const mode = b.standardReleaseOptions(); - var exe = b.addExecutable("test", "src/main.zig"); - exe.setBuildMode(mode); + const lib = b.addStaticLibrary("imgui", "src/main.zig"); + lib.setBuildMode(mode); + lib.linkSystemLibrary("c"); + lib.linkSystemLibrary("glfw"); + lib.linkSystemLibrary("epoxy"); + lib.addIncludeDir("cimgui"); + lib.linkSystemLibraryName("cimgui/cimgui.so"); + lib.install(); - exe.linkSystemLibrary("c"); - exe.linkSystemLibrary("glfw"); - exe.linkSystemLibrary("epoxy"); - exe.addIncludeDir("cimgui"); - exe.linkSystemLibraryName("cimgui/cimgui.so"); - exe.install(); + var exe = b.addExecutable("demo", "src/demo.zig"); + exe.setBuildMode(mode); - const play = b.step("play", "Play the game"); - const run = exe.run(); - run.step.dependOn(b.getInstallStep()); - play.dependOn(&run.step); + exe.linkSystemLibrary("c"); + exe.linkSystemLibrary("glfw"); + exe.linkSystemLibrary("epoxy"); + exe.addIncludeDir("cimgui"); + exe.linkSystemLibraryName("cimgui/cimgui.so"); + exe.install(); + + const demo = b.step("demo", "Run the demo"); + const run = exe.run(); + run.step.dependOn(b.getInstallStep()); + demo.dependOn(&run.step); } |
