1
Fork 0
mirror of https://github.com/RGBCube/DOOM-fire-zig synced 2025-07-28 17:47:45 +00:00

Update to zig 0.11.0

This commit is contained in:
Kaizhao Zhang 2023-09-13 20:07:23 +08:00
parent 2dd8bffc91
commit b918912276
No known key found for this signature in database
GPG key ID: 15D4774D6F72B487
2 changed files with 20 additions and 14 deletions

View file

@ -9,16 +9,19 @@ pub fn build(b: *std.build.Builder) void {
// Standard release options allow the person running `zig build` to select
// between Debug, ReleaseSafe, ReleaseFast, and ReleaseSmall.
const mode = b.standardReleaseOptions();
const optimize = b.standardOptimizeOption(.{});
const exe = b.addExecutable("DOOM-fire", "src/main.zig");
const exe = b.addExecutable(.{
.name = "DOOM-fire",
.root_source_file = .{ .path = "src/main.zig" },
.target = target,
.optimize = optimize,
});
exe.linkLibC();
exe.setTarget(target);
exe.setBuildMode(mode);
exe.install();
b.installArtifact(exe);
const run_cmd = exe.run();
const run_cmd = b.addRunArtifact(exe);
run_cmd.step.dependOn(b.getInstallStep());
if (b.args) |args| {
run_cmd.addArgs(args);
@ -27,9 +30,12 @@ pub fn build(b: *std.build.Builder) void {
const run_step = b.step("run", "Run the app");
run_step.dependOn(&run_cmd.step);
const exe_tests = b.addTest("src/main.zig");
exe_tests.setTarget(target);
exe_tests.setBuildMode(mode);
const exe_tests = b.addTest(.{
.name = "exe_tests",
.root_source_file = .{ .path = "src/main.zig" },
.target = target,
.optimize = optimize,
});
const test_step = b.step("test", "Run unit tests");
test_step.dependOn(&exe_tests.step);