Skip to content

Commit bc8bef2

Browse files
McSinyxikskuh
authored andcommitted
Update against Zig's new build API
References: ziglang/zig#14498
1 parent e8bb7b3 commit bc8bef2

File tree

1 file changed

+10
-7
lines changed

1 file changed

+10
-7
lines changed

build.zig

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,22 @@
11
const std = @import("std");
22

3-
pub fn build(b: *std.build.Builder) void {
3+
pub fn build(b: *std.Build) void {
44
// Standard target options allows the person running `zig build` to choose
55
// what target to build for. Here we do not override the defaults, which
66
// means any target is allowed, and the default is native. Other options
77
// for restricting supported target set are available.
88
const target = b.standardTargetOptions(.{});
99

10-
// Standard release options allow the person running `zig build` to select
11-
// between Debug, ReleaseSafe, ReleaseFast, and ReleaseSmall.
12-
const mode = b.standardReleaseOptions();
10+
// Standard optimization options allow the person running `zig build`
11+
// to select between Debug, ReleaseSafe, ReleaseFast, and ReleaseSmall.
12+
const optimize = b.standardOptimizeOption(.{});
1313

14-
const exe = b.addExecutable("user-map", "src/main.zig");
15-
exe.setTarget(target);
16-
exe.setBuildMode(mode);
14+
const exe = b.addExecutable(.{
15+
.name = "user-map",
16+
.root_source_file = .{ .path = "src/main.zig" },
17+
.target = target,
18+
.optimize = optimize,
19+
});
1720
exe.install();
1821

1922
const run_cmd = exe.run();

0 commit comments

Comments
 (0)