forked from andrewrk/tetris
-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathbuild.zig
29 lines (22 loc) · 820 Bytes
/
build.zig
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
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("tetris", "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("m");
exe.linkSystemLibrary("glfw");
exe.linkSystemLibrary("epoxy");
exe.linkSystemLibrary("png");
exe.linkSystemLibrary("z");
b.default_step.dependOn(&exe.step);
b.installArtifact(exe);
const play = b.step("play", "Play the game");
const run = exe.run();
play.dependOn(&run.step);
}