Skip to content

Instantly share code, notes, and snippets.

@travisstaloch
Last active August 2, 2024 19:28
Show Gist options
  • Save travisstaloch/ed5bb79a533f47d9649bd1000bec954f to your computer and use it in GitHub Desktop.
Save travisstaloch/ed5bb79a533f47d9649bd1000bec954f to your computer and use it in GitHub Desktop.
minimal build.zig for wasm, August 2024, zig version 0.14.0-dev.591+1c35e73b6
const std = @import("std");
pub fn build(b: *std.Build) void {
const optimize = b.standardOptimizeOption(.{});
const exe = b.addExecutable(.{
.name = "lib",
.root_source_file = .{ .path = "src/lib.zig" },
.target = b.resolveTargetQuery(std.Target.Query.parse(
.{ .arch_os_abi = "wasm32-freestanding" },
) catch unreachable),
.optimize = optimize,
});
exe.entry = .disabled;
exe.rdynamic = true;
b.installArtifact(exe);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment