Skip to content
/ wabt Public

WebAssembly Binary Toolkit (wabt) on the zig build system

License

Notifications You must be signed in to change notification settings

dasimmet/wabt

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

WebAssembly Tools on the zig build system

uses the Zig build system to build WebAssembly's binary C tools.

building

zig build

add to your zig project

zig fetch --save git+https://github.com/dasimmet/wabt.git
> ./zig-out/bin/wasm2c --help
usage: wasm2c [options] filename

  Read a file in the WebAssembly binary format, and convert it to
  a C source file and header.
> ./zig-out/bin/wasm-merge --help
================================================================================
wasm-merge INFILE1 NAME1 INFILE2 NAME2 [..]

Merge wasm files into one.

build.zig usage

const wabt = @import("wabt");

// wasm-opt

const optimized_wasm: LazyPath = wabt.wasm_opt(
    b.path("my.wasm"),                // source path
    "optimized.wasm",                 // out_basename
    .{"--mvp-features", "-Oz", "-c"}, // extra args
);

// wasm2wat

const my_wat: LazyPath = wabt.wasm2wat(
    optimized_wasm, // source path
    "my.wat",       // out_basename
    .{},            // extra args
);

About

WebAssembly Binary Toolkit (wabt) on the zig build system

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages