chore: use b.enable_wasmtime
This commit is contained in:
parent
f7881c86a9
commit
25dda6b31e
2 changed files with 6 additions and 25 deletions
24
build.zig
24
build.zig
|
|
@ -43,25 +43,11 @@ pub fn build(b: *std.Build) !void {
|
||||||
// --- Steps: Run --- //
|
// --- Steps: Run --- //
|
||||||
{
|
{
|
||||||
const run_step = b.step("run", "Run the app");
|
const run_step = b.step("run", "Run the app");
|
||||||
switch (target.result.os.tag) {
|
const run_cmd = b.addSystemCommand(&.{ b.graph.zig_exe, "build", "run" });
|
||||||
.freestanding => {
|
run_cmd.setCwd(b.path("example"));
|
||||||
const run_cmd = b.addSystemCommand(&.{ "node", "example/src/main.mjs" });
|
|
||||||
run_cmd.step.dependOn(b.getInstallStep());
|
if (b.args) |args| run_cmd.addArgs(args);
|
||||||
run_step.dependOn(&run_cmd.step);
|
run_step.dependOn(&run_cmd.step);
|
||||||
},
|
|
||||||
.wasi => {
|
|
||||||
const run_cmd = b.addSystemCommand(&.{"wasmtime"});
|
|
||||||
run_cmd.addFileArg(exe.getEmittedBin());
|
|
||||||
run_cmd.step.dependOn(b.getInstallStep());
|
|
||||||
run_step.dependOn(&run_cmd.step);
|
|
||||||
},
|
|
||||||
else => {
|
|
||||||
const run_cmd = b.addRunArtifact(exe);
|
|
||||||
run_cmd.step.dependOn(b.getInstallStep());
|
|
||||||
if (b.args) |args| run_cmd.addArgs(args);
|
|
||||||
run_step.dependOn(&run_cmd.step);
|
|
||||||
},
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// --- Steps: Docs --- //
|
// --- Steps: Docs --- //
|
||||||
|
|
|
||||||
|
|
@ -20,6 +20,7 @@ pub fn build(b: *std.Build) void {
|
||||||
});
|
});
|
||||||
exe.root_module.addImport("temporalz", temporalz.module("temporalz"));
|
exe.root_module.addImport("temporalz", temporalz.module("temporalz"));
|
||||||
b.installArtifact(exe);
|
b.installArtifact(exe);
|
||||||
|
b.enable_wasmtime = true;
|
||||||
|
|
||||||
const run_step = b.step("run", "Run the app");
|
const run_step = b.step("run", "Run the app");
|
||||||
switch (target.result.os.tag) {
|
switch (target.result.os.tag) {
|
||||||
|
|
@ -28,12 +29,6 @@ pub fn build(b: *std.Build) void {
|
||||||
run_cmd.step.dependOn(b.getInstallStep());
|
run_cmd.step.dependOn(b.getInstallStep());
|
||||||
run_step.dependOn(&run_cmd.step);
|
run_step.dependOn(&run_cmd.step);
|
||||||
},
|
},
|
||||||
.wasi => {
|
|
||||||
const run_cmd = b.addSystemCommand(&.{"wasmtime"});
|
|
||||||
run_cmd.addFileArg(exe.getEmittedBin());
|
|
||||||
run_cmd.step.dependOn(b.getInstallStep());
|
|
||||||
run_step.dependOn(&run_cmd.step);
|
|
||||||
},
|
|
||||||
else => {
|
else => {
|
||||||
const run_cmd = b.addRunArtifact(exe);
|
const run_cmd = b.addRunArtifact(exe);
|
||||||
run_cmd.step.dependOn(b.getInstallStep());
|
run_cmd.step.dependOn(b.getInstallStep());
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue