Zig2048/build.zig

42 lines
955 B
Zig
Raw Normal View History

2026-08-21 03:47:26 +01:00
const std = @import("std");
pub fn build(b: *std.Build) void {
const target = b.standardTargetOptions(.{});
2026-08-21 14:08:23 +01:00
const optimize = b.standardOptimizeOption(.{});
2026-08-21 03:47:26 +01:00
const exe = b.addExecutable(.{
.name = "_2048zig",
.root_module = b.createModule(.{
.root_source_file = b.path("src/main.zig"),
2026-08-21 14:08:23 +01:00
2026-08-21 03:47:26 +01:00
.target = target,
.optimize = optimize,
2026-08-21 14:08:23 +01:00
.imports = &.{},
2026-08-21 03:47:26 +01:00
}),
});
b.installArtifact(exe);
const run_step = b.step("run", "Run the app");
const run_cmd = b.addRunArtifact(exe);
run_step.dependOn(&run_cmd.step);
run_cmd.step.dependOn(b.getInstallStep());
if (b.args) |args| {
run_cmd.addArgs(args);
}
const exe_tests = b.addTest(.{
.root_module = exe.root_module,
});
const run_exe_tests = b.addRunArtifact(exe_tests);
const test_step = b.step("test", "Run tests");
test_step.dependOn(&run_exe_tests.step);
}