build: replace App.setBuildMode() with mode option

This commit is contained in:
Ali Chraghi 2022-12-27 16:07:31 +03:30 committed by Stephen Gutekanst
parent b94bc1fd47
commit c4842ea5c5

View file

@ -97,9 +97,9 @@ pub fn build(b: *Builder) !void {
.name = "shaderexp", .name = "shaderexp",
.src = "shaderexp/main.zig", .src = "shaderexp/main.zig",
.target = target, .target = target,
.mode = mode,
}, },
); );
shaderexp_app.setBuildMode(mode);
try shaderexp_app.link(options); try shaderexp_app.link(options);
shaderexp_app.install(); shaderexp_app.install();
@ -193,6 +193,7 @@ pub const App = struct {
name: []const u8, name: []const u8,
src: []const u8, src: []const u8,
target: CrossTarget, target: CrossTarget,
mode: std.builtin.Mode,
deps: ?[]const Pkg = null, deps: ?[]const Pkg = null,
res_dirs: ?[]const []const u8 = null, res_dirs: ?[]const []const u8 = null,
watch_paths: ?[]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.main_pkg_path = sdkPath("/src");
step.addPackage(app_pkg); step.addPackage(app_pkg);
step.setTarget(options.target); step.setTarget(options.target);
step.setBuildMode(options.mode);
return .{ return .{
.b = b, .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 { pub fn getInstallStep(app: *const App) ?*std.build.InstallArtifactStep {
return app.step.install_step; return app.step.install_step;
} }