Skip to content
This repository was archived by the owner on Jun 17, 2024. It is now read-only.

Commit 9c72163

Browse files
authored
WASM target (#16)
1 parent 7823fc6 commit 9c72163

File tree

3 files changed

+17
-1
lines changed

3 files changed

+17
-1
lines changed

.zig-version

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
0.12.0-dev.2541+894493549
1+
0.12.0

build.zig

+14
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,17 @@ pub fn build(b: *std.Build) void {
6363
const dylib_header = b.addInstallFile(.{ .path = "zig-cache/fastlanez.h" }, "include/fastlanez.h");
6464
dylib_header.step.dependOn(&dylib.step);
6565

66+
// Freestanding Executable (required for WASM)
67+
const freestanding = b.addExecutable(.{
68+
.name = "fastlanez",
69+
.target = target,
70+
.optimize = optimize,
71+
.root_source_file = .{ .path = "src/lib.zig" },
72+
});
73+
freestanding.rdynamic = true;
74+
freestanding.entry = .disabled;
75+
const freestanding_install = b.addInstallArtifact(freestanding, .{});
76+
6677
const lib_step = b.step("lib", "Build static C library");
6778
lib_step.dependOn(&lib_header.step);
6879
lib_step.dependOn(&lib_install.step);
@@ -71,6 +82,9 @@ pub fn build(b: *std.Build) void {
7182
dylib_step.dependOn(&lib_header.step);
7283
dylib_step.dependOn(&dylib_install.step);
7384

85+
const freestanding_step = b.step("freestanding", "Build a freestanding executable");
86+
freestanding_step.dependOn(&freestanding_install.step);
87+
7488
// Unit Tests
7589
const unit_tests = b.addTest(.{
7690
.root_source_file = .{ .path = "src/fastlanez.zig" },

src/lib.zig

+2
Original file line numberDiff line numberDiff line change
@@ -74,3 +74,5 @@ comptime {
7474
@export(Wrapper.decode, .{ .name = "fl_delta_decode_" ++ @typeName(E) });
7575
}
7676
}
77+
78+
pub fn main() void {}

0 commit comments

Comments
 (0)