chore: use b.enable_wasmtime

This commit is contained in:
Nurul Huda (Apon) 2026-04-16 00:24:00 +06:00
parent f7881c86a9
commit 25dda6b31e
No known key found for this signature in database
GPG key ID: 5D3F1DE2855A2F79
2 changed files with 6 additions and 25 deletions

View file

@ -43,25 +43,11 @@ pub fn build(b: *std.Build) !void {
// --- Steps: Run --- //
{
const run_step = b.step("run", "Run the app");
switch (target.result.os.tag) {
.freestanding => {
const run_cmd = b.addSystemCommand(&.{ "node", "example/src/main.mjs" });
run_cmd.step.dependOn(b.getInstallStep());
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());
const run_cmd = b.addSystemCommand(&.{ b.graph.zig_exe, "build", "run" });
run_cmd.setCwd(b.path("example"));
if (b.args) |args| run_cmd.addArgs(args);
run_step.dependOn(&run_cmd.step);
},
}
}
// --- Steps: Docs --- //

View file

@ -20,6 +20,7 @@ pub fn build(b: *std.Build) void {
});
exe.root_module.addImport("temporalz", temporalz.module("temporalz"));
b.installArtifact(exe);
b.enable_wasmtime = true;
const run_step = b.step("run", "Run the app");
switch (target.result.os.tag) {
@ -28,12 +29,6 @@ pub fn build(b: *std.Build) void {
run_cmd.step.dependOn(b.getInstallStep());
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());