From c4842ea5c5fbbfe5ac982bb888354123c2e3e443 Mon Sep 17 00:00:00 2001 From: Ali Chraghi Date: Tue, 27 Dec 2022 16:07:31 +0330 Subject: [PATCH] build: replace App.setBuildMode() with `mode` option --- build.zig | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/build.zig b/build.zig index 3aef28ea..66bc6a3d 100644 --- a/build.zig +++ b/build.zig @@ -97,9 +97,9 @@ pub fn build(b: *Builder) !void { .name = "shaderexp", .src = "shaderexp/main.zig", .target = target, + .mode = mode, }, ); - shaderexp_app.setBuildMode(mode); try shaderexp_app.link(options); shaderexp_app.install(); @@ -193,6 +193,7 @@ pub const App = struct { name: []const u8, src: []const u8, target: CrossTarget, + mode: std.builtin.Mode, deps: ?[]const Pkg = null, res_dirs: ?[]const []const u8 = null, watch_paths: ?[]const []const u8 = null, @@ -247,6 +248,7 @@ pub const App = struct { step.main_pkg_path = sdkPath("/src"); step.addPackage(app_pkg); step.setTarget(options.target); + step.setBuildMode(options.mode); return .{ .b = b, @@ -339,10 +341,6 @@ pub const App = struct { } } - pub fn setBuildMode(app: *const App, mode: std.builtin.Mode) void { - app.step.setBuildMode(mode); - } - pub fn getInstallStep(app: *const App) ?*std.build.InstallArtifactStep { return app.step.install_step; }