fix: wasi run step
This commit is contained in:
parent
df3b636f35
commit
2cb7b2709d
2 changed files with 13 additions and 1 deletions
|
|
@ -81,6 +81,12 @@ cd temporalz
|
|||
|
||||
```bash
|
||||
zig build run
|
||||
|
||||
# Node.js
|
||||
zig build run -Dtarget=wasm32-freestanding
|
||||
|
||||
# wasmtime
|
||||
zig build run -Dtarget=wasm32-wasi
|
||||
```
|
||||
|
||||
#### Run Tests
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@ pub fn build(b: *std.Build) void {
|
|||
});
|
||||
exe.root_module.addImport("temporalz", temporalz.module("temporalz"));
|
||||
b.installArtifact(exe);
|
||||
b.enable_wasmtime = true;
|
||||
b.enable_wasmtime = true; // This doesn't work since Zig 0.17.0 release
|
||||
|
||||
const run_step = b.step("run", "Run the app");
|
||||
switch (target.result.os.tag) {
|
||||
|
|
@ -29,6 +29,12 @@ 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());
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue