mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-10-22 19:56:20 +00:00
Only use substrate-wasm-builder when std feature is enabled. (#12790)
Co-authored-by: parity-processbot <>
This commit is contained in:
1 parent
9fe5dd5f59
commit
dccef86edb
13 files changed
+109
-80
No files matched your search
@@ -19,7 +19,7 @@ sp-runtime = { version = "7.0.0", default-features = false, path = "../../../pri
|
||||
sp-std = { version = "5.0.0", default-features = false, path = "../../../primitives/std" }
|
||||
|
||||
[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 = ["std"]
|
||||
@@ -28,4 +28,5 @@ std = [
|
||||
"sp-io/std",
|
||||
"sp-runtime/std",
|
||||
"sp-std/std",
|
||||
"substrate-wasm-builder",
|
||||
]
|
||||
@@ -16,22 +16,26 @@
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
use substrate_wasm_builder::WasmBuilder;
|
||||
|
||||
fn main() {
|
||||
// regular build
|
||||
WasmBuilder::new()
|
||||
.with_current_project()
|
||||
.export_heap_base()
|
||||
.import_memory()
|
||||
.build();
|
||||
#[cfg(feature = "std")]
|
||||
{
|
||||
substrate_wasm_builder::WasmBuilder::new()
|
||||
.with_current_project()
|
||||
.export_heap_base()
|
||||
.import_memory()
|
||||
.build();
|
||||
}
|
||||
|
||||
// and building with tracing activated
|
||||
WasmBuilder::new()
|
||||
.with_current_project()
|
||||
.export_heap_base()
|
||||
.import_memory()
|
||||
.set_file_name("wasm_binary_with_tracing.rs")
|
||||
.append_to_rust_flags(r#"--cfg feature="with-tracing""#)
|
||||
.build();
|
||||
#[cfg(feature = "std")]
|
||||
{
|
||||
substrate_wasm_builder::WasmBuilder::new()
|
||||
.with_current_project()
|
||||
.export_heap_base()
|
||||
.import_memory()
|
||||
.set_file_name("wasm_binary_with_tracing.rs")
|
||||
.append_to_rust_flags(r#"--cfg feature="with-tracing""#)
|
||||
.build();
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user