Only use substrate-wasm-builder when std feature is enabled. (#12790)

Co-authored-by: parity-processbot <>
This commit is contained in:
Nazar Mokrynskyi
2023-01-06 12:24:12 +02:00
committed by GitHub
parent 9fe5dd5f59
commit dccef86edb
13 changed files with 109 additions and 80 deletions
@@ -19,8 +19,14 @@ sp-runtime-interface = { version = "7.0.0", default-features = false, path = "..
sp-std = { version = "5.0.0", default-features = false, path = "../../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" ]
std = [ "sp-core/std", "sp-io/std", "sp-runtime-interface/std", "sp-std/std" ]
std = [
"sp-core/std",
"sp-io/std",
"sp-runtime-interface/std",
"sp-std/std",
"substrate-wasm-builder",
]
@@ -15,12 +15,13 @@
// 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()
.import_memory()
.build()
#[cfg(feature = "std")]
{
substrate_wasm_builder::WasmBuilder::new()
.with_current_project()
.export_heap_base()
.import_memory()
.build();
}
}
@@ -20,8 +20,14 @@ sp-runtime-interface = { version = "7.0.0", default-features = false, path = "..
sp-std = { version = "5.0.0", default-features = false, path = "../../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" ]
std = [ "sp-core/std", "sp-io/std", "sp-runtime-interface/std", "sp-std/std" ]
std = [
"sp-core/std",
"sp-io/std",
"sp-runtime-interface/std",
"sp-std/std",
"substrate-wasm-builder",
]
@@ -15,12 +15,13 @@
// 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()
.import_memory()
.build()
#[cfg(feature = "std")]
{
substrate_wasm_builder::WasmBuilder::new()
.with_current_project()
.export_heap_base()
.import_memory()
.build();
}
}