core: update to latest Zig build API
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
This commit is contained in:
parent
ff0258f27d
commit
80a071be37
2 changed files with 7 additions and 9 deletions
|
|
@ -4,7 +4,6 @@ const system_sdk = @import("libs/mach-glfw/system_sdk.zig");
|
|||
const glfw = @import("libs/mach-glfw/build.zig");
|
||||
const sysjs = @import("libs/mach-sysjs/build.zig");
|
||||
const gamemode = @import("libs/mach-gamemode/build.zig");
|
||||
const wasmserve = @import("libs/mach-wasmserve/wasmserve.zig");
|
||||
const gpu_dawn = @import("libs/mach-gpu-dawn/sdk.zig").Sdk(.{
|
||||
.glfw_include_dir = sdkPath("/libs/mach-glfw/upstream/glfw/include"),
|
||||
.system_sdk = system_sdk,
|
||||
|
|
@ -17,7 +16,6 @@ const core = @import("sdk.zig").Sdk(.{
|
|||
.gpu_dawn = gpu_dawn,
|
||||
.glfw = glfw,
|
||||
.gamemode = gamemode,
|
||||
.wasmserve = wasmserve,
|
||||
.sysjs = sysjs,
|
||||
});
|
||||
|
||||
|
|
|
|||
|
|
@ -46,8 +46,8 @@ pub fn Sdk(comptime deps: anytype) type {
|
|||
deps.gamemode.link(main_tests);
|
||||
}
|
||||
main_tests.addIncludePath(sdkPath("/include"));
|
||||
main_tests.install();
|
||||
return main_tests.run();
|
||||
b.installArtifact(main_tests);
|
||||
return b.addRunArtifact(main_tests);
|
||||
}
|
||||
|
||||
pub fn buildSharedLib(b: *std.Build, optimize: std.builtin.OptimizeMode, target: std.zig.CrossTarget, options: Options) !*std.build.CompileStep {
|
||||
|
|
@ -176,7 +176,7 @@ pub fn Sdk(comptime deps: anytype) type {
|
|||
}
|
||||
|
||||
pub fn install(app: *const App) void {
|
||||
app.step.install();
|
||||
app.b.installArtifact(app.step);
|
||||
|
||||
// Install additional files (mach.js and mach-sysjs.js)
|
||||
// in case of wasm
|
||||
|
|
@ -208,15 +208,15 @@ pub fn Sdk(comptime deps: anytype) type {
|
|||
}
|
||||
}
|
||||
|
||||
pub fn run(app: *const App) *std.build.RunStep {
|
||||
pub fn addRunArtifact(app: *const App) *std.build.RunStep {
|
||||
if (app.platform == .web) {
|
||||
@panic("cannot run wasm binary; use mach app instead");
|
||||
@panic("mach: to run wasm binaries, use `mach build` instead of `zig build`");
|
||||
}
|
||||
return app.step.run();
|
||||
return app.b.addRunArtifact(app.step);
|
||||
}
|
||||
|
||||
pub fn getInstallStep(app: *const App) ?*std.build.InstallArtifactStep {
|
||||
return app.step.install_step;
|
||||
return app.b.addInstallArtifact(app.step);
|
||||
}
|
||||
};
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue