From 43f9073059a24704fda673889b77e360dedd8402 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nguy=E1=BB=85n=20Gia=20Phong?= Date: Wed, 15 Feb 2023 17:34:41 +0900 Subject: [PATCH] Update against Zig's new build API References: https://github.com/ziglang/zig/pull/14498 --- build.zig | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/build.zig b/build.zig index 8173614..e1c36b0 100644 --- a/build.zig +++ b/build.zig @@ -1,19 +1,22 @@ const std = @import("std"); -pub fn build(b: *std.build.Builder) void { +pub fn build(b: *std.Build) void { // Standard target options allows the person running `zig build` to choose // what target to build for. Here we do not override the defaults, which // means any target is allowed, and the default is native. Other options // for restricting supported target set are available. const target = b.standardTargetOptions(.{}); - // Standard release options allow the person running `zig build` to select - // between Debug, ReleaseSafe, ReleaseFast, and ReleaseSmall. - const mode = b.standardReleaseOptions(); + // Standard optimization options allow the person running `zig build` + // to select between Debug, ReleaseSafe, ReleaseFast, and ReleaseSmall. + const optimize = b.standardOptimizeOption(.{}); - const exe = b.addExecutable("user-map", "src/main.zig"); - exe.setTarget(target); - exe.setBuildMode(mode); + const exe = b.addExecutable(.{ + .name = "user-map", + .root_source_file = .{ .path = "src/main.zig" }, + .target = target, + .optimize = optimize, + }); exe.install(); const run_cmd = exe.run();