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

WASM target #16

Merged
merged 1 commit into from
May 3, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .zig-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.12.0-dev.2541+894493549
0.12.0
14 changes: 14 additions & 0 deletions build.zig
Original file line number Diff line number Diff line change
@@ -63,6 +63,17 @@ pub fn build(b: *std.Build) void {
const dylib_header = b.addInstallFile(.{ .path = "zig-cache/fastlanez.h" }, "include/fastlanez.h");
dylib_header.step.dependOn(&dylib.step);

// Freestanding Executable (required for WASM)
const freestanding = b.addExecutable(.{
.name = "fastlanez",
.target = target,
.optimize = optimize,
.root_source_file = .{ .path = "src/lib.zig" },
});
freestanding.rdynamic = true;
freestanding.entry = .disabled;
const freestanding_install = b.addInstallArtifact(freestanding, .{});

const lib_step = b.step("lib", "Build static C library");
lib_step.dependOn(&lib_header.step);
lib_step.dependOn(&lib_install.step);
@@ -71,6 +82,9 @@ pub fn build(b: *std.Build) void {
dylib_step.dependOn(&lib_header.step);
dylib_step.dependOn(&dylib_install.step);

const freestanding_step = b.step("freestanding", "Build a freestanding executable");
freestanding_step.dependOn(&freestanding_install.step);

// Unit Tests
const unit_tests = b.addTest(.{
.root_source_file = .{ .path = "src/fastlanez.zig" },
2 changes: 2 additions & 0 deletions src/lib.zig
Original file line number Diff line number Diff line change
@@ -74,3 +74,5 @@ comptime {
@export(Wrapper.decode, .{ .name = "fl_delta_decode_" ++ @typeName(E) });
}
}

pub fn main() void {}