Improve build times by disabling wasm-builder in no_std (#2308)

There is no need to compile wasm-builder in `no_std` as we skip the compilation of the crate any
way. So, we can also directly disable wasm-builder as dependency in `no_std` to improve build times.
This commit is contained in:
Bastian Köcher
2023-03-20 09:53:09 +01:00
committed by GitHub
parent f1769cb212
commit e2ec2e4d9c
28 changed files with 239 additions and 75 deletions
@@ -12,7 +12,7 @@ edition = "2021"
targets = ["x86_64-unknown-linux-gnu"]
[build-dependencies]
substrate-wasm-builder = { git = "https://github.com/paritytech/substrate", branch = "master" }
substrate-wasm-builder = { git = "https://github.com/paritytech/substrate", branch = "master", optional = true }
[dependencies]
codec = { package = "parity-scale-codec", version = "3.0.0", default-features = false, features = ["derive"] }
@@ -124,6 +124,7 @@ std = [
"xcm-builder/std",
"xcm-executor/std",
"xcm/std",
"substrate-wasm-builder",
]
runtime-benchmarks = [
@@ -14,12 +14,14 @@
// You should have received a copy of the GNU General Public License
// along with Cumulus. If not, see <http://www.gnu.org/licenses/>.
use substrate_wasm_builder::WasmBuilder;
#[cfg(feature = "std")]
fn main() {
WasmBuilder::new()
substrate_wasm_builder::WasmBuilder::new()
.with_current_project()
.export_heap_base()
.import_memory()
.build()
}
#[cfg(not(feature = "std"))]
fn main() {}