mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-12 10:01:17 +00:00
Only use substrate-wasm-builder when std feature is enabled. (#12790)
Co-authored-by: parity-processbot <>
This commit is contained in:
@@ -59,7 +59,7 @@ substrate-test-runtime-client = { version = "2.0.0", path = "./client" }
|
||||
futures = "0.3.21"
|
||||
|
||||
[build-dependencies]
|
||||
substrate-wasm-builder = { version = "5.0.0-dev", path = "../../utils/wasm-builder" }
|
||||
substrate-wasm-builder = { version = "5.0.0-dev", path = "../../utils/wasm-builder", optional = true }
|
||||
|
||||
[features]
|
||||
default = [
|
||||
@@ -101,6 +101,7 @@ std = [
|
||||
"sp-trie/std",
|
||||
"sp-transaction-pool/std",
|
||||
"trie-db/std",
|
||||
"substrate-wasm-builder",
|
||||
]
|
||||
# Special feature to disable logging
|
||||
disable-logging = [ "sp-api/disable-logging" ]
|
||||
|
||||
@@ -15,24 +15,28 @@
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
use substrate_wasm_builder::WasmBuilder;
|
||||
|
||||
fn main() {
|
||||
WasmBuilder::new()
|
||||
.with_current_project()
|
||||
.export_heap_base()
|
||||
// Note that we set the stack-size to 1MB explicitly even though it is set
|
||||
// to this value by default. This is because some of our tests (`restoration_of_globals`)
|
||||
// depend on the stack-size.
|
||||
.append_to_rust_flags("-Clink-arg=-zstack-size=1048576")
|
||||
.import_memory()
|
||||
.build();
|
||||
#[cfg(feature = "std")]
|
||||
{
|
||||
substrate_wasm_builder::WasmBuilder::new()
|
||||
.with_current_project()
|
||||
.export_heap_base()
|
||||
// Note that we set the stack-size to 1MB explicitly even though it is set
|
||||
// to this value by default. This is because some of our tests
|
||||
// (`restoration_of_globals`) depend on the stack-size.
|
||||
.append_to_rust_flags("-Clink-arg=-zstack-size=1048576")
|
||||
.import_memory()
|
||||
.build();
|
||||
}
|
||||
|
||||
WasmBuilder::new()
|
||||
.with_current_project()
|
||||
.export_heap_base()
|
||||
.import_memory()
|
||||
.set_file_name("wasm_binary_logging_disabled.rs")
|
||||
.enable_feature("disable-logging")
|
||||
.build();
|
||||
#[cfg(feature = "std")]
|
||||
{
|
||||
substrate_wasm_builder::WasmBuilder::new()
|
||||
.with_current_project()
|
||||
.export_heap_base()
|
||||
.import_memory()
|
||||
.set_file_name("wasm_binary_logging_disabled.rs")
|
||||
.enable_feature("disable-logging")
|
||||
.build();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user