Advertisement
Guest User

Untitled

a guest
Feb 16th, 2019
143
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.92 KB | None | 0 0
  1. const Builder = @import("std").build.Builder;
  2. const builtin = @import("builtin");
  3.  
  4. pub fn build(b: *Builder) void {
  5.  
  6. const mode = b.standardReleaseOptions();
  7. const windows = b.option(bool, "windows", "create windows build") orelse false;
  8.  
  9. var exe = b.addExecutable("gl-test", "src/main.zig");
  10. exe.setBuildMode(mode);
  11.  
  12. if (windows) {
  13. exe.setTarget(builtin.Arch.x86_64, builtin.Os.windows, builtin.Environ.msvc);
  14. }
  15.  
  16. exe.addIncludeDir("c-compat");
  17. exe.addLibPath("c-compat");
  18.  
  19. exe.linkSystemLibrary("c");
  20. exe.linkSystemLibrary("glfw3.lib");
  21. exe.linkSystemLibrary("epoxy.lib");
  22.  
  23. b.default_step.dependOn(&exe.step);
  24.  
  25. b.installArtifact(exe);
  26.  
  27. const run_step = b.step("run", "Run the app");
  28. const run_cmd = b.addCommand(".", b.env_map, [][]const u8{exe.getOutputPath()});
  29. run_step.dependOn(&run_cmd.step);
  30. run_cmd.step.dependOn(&exe.step);
  31. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement