mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-12 22:51:13 +00:00
wasm-builder: Make it easier to build a WASM binary (#4177)
Basically combines all the recommended calls into one `build_using_defaults()` call or `init_with_defaults()` when there are some custom changes required.
This commit is contained in:
@@ -33,15 +33,9 @@
|
||||
//! use substrate_wasm_builder::WasmBuilder;
|
||||
//!
|
||||
//! fn main() {
|
||||
//! WasmBuilder::new()
|
||||
//! // Tell the builder to build the project (crate) this `build.rs` is part of.
|
||||
//! .with_current_project()
|
||||
//! // Make sure to export the `heap_base` global, this is required by Substrate
|
||||
//! .export_heap_base()
|
||||
//! // Build the Wasm file so that it imports the memory (need to be provided by at instantiation)
|
||||
//! .import_memory()
|
||||
//! // Build it.
|
||||
//! .build()
|
||||
//! // Builds the WASM binary using the recommended defaults.
|
||||
//! // If you need more control, you can call `new` or `init_with_defaults`.
|
||||
//! WasmBuilder::build_using_defaults();
|
||||
//! }
|
||||
//! ```
|
||||
//!
|
||||
|
||||
Reference in New Issue
Block a user