@@ -8,7 +8,7 @@ All WASI APIs are also implemented.
88
99All tests from the "wasmer" lib C repository are also reimplemented on zig. You can learn more about the API of this module through rich examples.
1010
11- The current module works with Zig 0.14.0+ .
11+ The current module works with Zig 0.15.x .
1212
1313## Wasmer C API test examples [ WIP]
1414
@@ -41,25 +41,26 @@ zig build run -Dexamples=true
4141In your zig project folder (where build.zig is located), run:
4242
4343``` bash
44- zig fetch --save " git+https://github.com/Afirium/wasmer-zig-api#v0.3 .0"
44+ zig fetch --save " git+https://github.com/Afirium/wasmer-zig-api#v0.4 .0"
4545```
4646
4747Then, in your ` build.zig ` 's ` build ` function, add the following before
4848` b.installArtifact(exe) ` :
4949
5050``` zig
51- const wasmerZigAPI= b.dependency("wasmer_zig_api", .{
52- .target = target,
53- .optimize = optimize,
54- });
55- exe.root_module.addImport("wasmer", wasmerZigAPI.module("wasmer"));
56- exe.linkLibC();
57- exe.addLibraryPath(.{ .cwd_relative = "/home/path_to_your_wasmer/.wasmer/lib" });
58- exe.linkSystemLibrary("wasmer");
51+ const wasmer_zig_api = b.dependency("wasmer_zig_api", .{
52+ .target = target,
53+ .optimize = optimize,
54+ });
55+
56+ exe.root_module.addImport("wasmer", wasmer_zig_api.module("wasmer"));
57+ exe.root_module.link_libc = true;
58+ exe.root_module.addLibraryPath(.{ .cwd_relative = "/home/path_to_your_wasmer/.wasmer/lib" });
59+ exe.root_module.linkSystemLibrary("wasmer", .{});
5960```
6061
6162## Status
6263
63- | Refname | Wasmer runtime version | Zig ` 0.12 .x ` | Zig ` 0.13.x ` | Zig ` 0.14.x ` | Zig ` 0.15.0-dev ` |
64- | :----------| :-----------------------| :------------: | :------------: | :------------: | :------------ ----:|
65- | ` v0.3 .0 ` | ` v4.0.0+ ` , ` v5.0.0+ ` | ❌ | ❌ | ✅ | ✅ |
64+ | Refname | Wasmer runtime version | Zig ` 0.15 .x ` |
65+ | :----------| :-----------------------| :----------------:|
66+ | ` v0.4 .0 ` | ` v4.0.0+ ` , ` v5.0.0+ ` | ✅ |
0 commit comments