Skip to content

Commit

Permalink
Merge pull request #17 from stacks-network/feat/build-script-for-stan…
Browse files Browse the repository at this point in the history
…dard-wat
  • Loading branch information
Acaccia authored Aug 15, 2023
2 parents 69d34a4 + 40354e1 commit b435caf
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 27 deletions.
1 change: 1 addition & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 5 additions & 1 deletion clar2wasm/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
name = "clar2wasm"
version = "0.1.0"
edition = "2021"
build = "build.rs"

[dependencies]
# TODO: switch back to tag after PR is merged
Expand All @@ -11,6 +12,9 @@ regex = "1.9.1"
walrus = "0.20.1"
lazy_static = "1.4.0"

[build-dependencies]
wat = "1.0.69"

[dev-dependencies]
wasmtime = "11.0.1"
criterion = "0.5.1"
Expand All @@ -24,4 +28,4 @@ path = "src/bin/main.rs"

[[bench]]
name = "benchmark"
harness = false
harness = false
26 changes: 0 additions & 26 deletions clar2wasm/Makefile.toml

This file was deleted.

13 changes: 13 additions & 0 deletions clar2wasm/build.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
/// Generate the standard library as a Wasm binary from the WAT source.
fn main() {
match wat::parse_file("src/standard/standard.wat") {
Ok(binary) => {
std::fs::write("src/standard/standard.wasm", binary)
.expect("Failed to write standard library");
}
Err(error) => {
panic!("Failed to parse standard library: {error}");
}
};
println!("cargo:rerun-if-changed=src/standard/standard.wat");
}
Binary file removed clar2wasm/src/standard/standard.wasm
Binary file not shown.

0 comments on commit b435caf

Please sign in to comment.