mach: do not install apps implicitly by default

This commit is contained in:
iddev5 2022-05-22 23:51:12 +05:30 committed by Stephen Gutekanst
parent 1491167daa
commit dbdb2173b8

View file

@ -59,6 +59,7 @@ pub fn build(b: *std.build.Builder) void {
); );
example_app.setBuildMode(mode); example_app.setBuildMode(mode);
example_app.link(options); example_app.link(options);
example_app.install();
if (target.toTarget().cpu.arch != .wasm32) { if (target.toTarget().cpu.arch != .wasm32) {
const example_run_cmd = example_app.run(); const example_run_cmd = example_app.run();
@ -80,6 +81,7 @@ pub fn build(b: *std.build.Builder) void {
); );
shaderexp_app.setBuildMode(mode); shaderexp_app.setBuildMode(mode);
shaderexp_app.link(options); shaderexp_app.link(options);
shaderexp_app.install();
const shaderexp_run_cmd = shaderexp_app.run(); const shaderexp_run_cmd = shaderexp_app.run();
shaderexp_run_cmd.step.dependOn(&shaderexp_app.getInstallStep().?.step); shaderexp_run_cmd.step.dependOn(&shaderexp_app.getInstallStep().?.step);
@ -149,7 +151,6 @@ const App = struct {
step.addPackage(app_pkg); step.addPackage(app_pkg);
step.setTarget(options.target); step.setTarget(options.target);
step.install();
return .{ return .{
.b = b, .b = b,
@ -158,6 +159,10 @@ const App = struct {
}; };
} }
pub fn install(app: *const App) void {
app.step.install();
}
pub fn link(app: *const App, options: Options) void { pub fn link(app: *const App, options: Options) void {
const gpu_options = gpu.Options{ const gpu_options = gpu.Options{
.glfw_options = @bitCast(@import("gpu/libs/mach-glfw/build.zig").Options, options.glfw_options), .glfw_options = @bitCast(@import("gpu/libs/mach-glfw/build.zig").Options, options.glfw_options),