Skip to content

Commit f59e6dc

Browse files
committed
Initial commit
0 parents  commit f59e6dc

File tree

6 files changed

+820
-0
lines changed

6 files changed

+820
-0
lines changed

LICENSE

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
MIT License
2+
3+
Copyright (c) 2021 Jakub Konka & Luuk de Gram
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.
22+

README.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# wasm-zig
2+
3+
Common Wasm runtime bindings to C API.
4+
5+
This library is intended to be used in conjunction with some runtime-specific bindings such
6+
as [wasmer-zig] or [wasmtime-zig].
7+
8+
[wasmer-zig]: https://github.com/kubkon/wasmer-zig
9+
[wasmtime-zig]: https://github.com/kubkon/wasmtime-zig
10+
11+
To add this library as your dependency, we strongly recommend [gyro].
12+
13+
[gyro]: https://github.com/mattnite/gyro
14+

build.zig

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
const std = @import("std");
2+
3+
pub fn build(b: *std.build.Builder) void {
4+
// Standard release options allow the person running `zig build` to select
5+
// between Debug, ReleaseSafe, ReleaseFast, and ReleaseSmall.
6+
const mode = b.standardReleaseOptions();
7+
8+
const lib = b.addStaticLibrary("wasm-zig", "src/main.zig");
9+
lib.setBuildMode(mode);
10+
lib.install();
11+
12+
var main_tests = b.addTest("src/main.zig");
13+
main_tests.setBuildMode(mode);
14+
15+
const test_step = b.step("test", "Run library tests");
16+
test_step.dependOn(&main_tests.step);
17+
}

deps.zig

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
const std = @import("std");
2+
pub const pkgs = struct {
3+
pub fn addAllTo(artifact: *std.build.LibExeObjStep) void {
4+
@setEvalBranchQuota(1_000_000);
5+
inline for (std.meta.declarations(pkgs)) |decl| {
6+
if (decl.is_pub and decl.data == .Var) {
7+
artifact.addPackage(@field(pkgs, decl.name));
8+
}
9+
}
10+
}
11+
};
12+
13+
pub const base_dirs = struct {
14+
};

gyro.zzz

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
pkgs:
2+
wasm:
3+
version: 0.0.0
4+
description: "Common Wasm runtime binding to C API"
5+
source_url: "https://github.com/kubkon/wasm-zig"
6+
7+
root: src/main.zig
8+
files:
9+
README.md
10+
LICENSE

0 commit comments

Comments
 (0)