Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 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("gl-test", "src/main.zig");
- exe.setBuildMode(mode);
- if (windows) {
- exe.setTarget(builtin.Arch.x86_64, builtin.Os.windows, builtin.Environ.msvc);
- }
- exe.addIncludeDir("c-compat");
- exe.addLibPath("c-compat");
- exe.linkSystemLibrary("c");
- exe.linkSystemLibrary("glfw3.lib");
- exe.linkSystemLibrary("epoxy.lib");
- b.default_step.dependOn(&exe.step);
- b.installArtifact(exe);
- const run_step = b.step("run", "Run the app");
- const run_cmd = b.addCommand(".", b.env_map, [][]const u8{exe.getOutputPath()});
- run_step.dependOn(&run_cmd.step);
- run_cmd.step.dependOn(&exe.step);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement