From da28f91013c567f5d49c0680cc6caef81003f307 Mon Sep 17 00:00:00 2001 From: Yaron Wittenstein Date: Thu, 22 Aug 2019 16:09:45 +0300 Subject: [PATCH] runtime: removing `default-Backend-X` feature. staying with the shorter versions of `llvm/cranelift/singlepass`. --- lib/runtime-c-api/Cargo.toml | 2 +- lib/runtime/Cargo.toml | 5 +---- lib/runtime/src/lib.rs | 23 +++++++---------------- 3 files changed, 9 insertions(+), 21 deletions(-) diff --git a/lib/runtime-c-api/Cargo.toml b/lib/runtime-c-api/Cargo.toml index e563809626d..9248146b41e 100644 --- a/lib/runtime-c-api/Cargo.toml +++ b/lib/runtime-c-api/Cargo.toml @@ -27,7 +27,7 @@ version = "0.6.0" [features] default = ["cranelift-backend"] debug = ["wasmer-runtime/debug"] -cranelift-backend = ["wasmer-runtime/cranelift", "wasmer-runtime/default-backend-cranelift"] +cranelift-backend = ["wasmer-runtime/cranelift"] llvm-backend = ["wasmer-runtime/llvm"] singlepass-backend = ["wasmer-runtime/singlepass"] diff --git a/lib/runtime/Cargo.toml b/lib/runtime/Cargo.toml index b1383fa20a1..60bbd954b30 100644 --- a/lib/runtime/Cargo.toml +++ b/lib/runtime/Cargo.toml @@ -32,15 +32,12 @@ path = "../llvm-backend" optional = true [features] -default = ["cranelift", "default-backend-cranelift"] +default = ["cranelift"] cranelift = ["wasmer-clif-backend"] cache = ["cranelift"] debug = ["wasmer-clif-backend/debug", "wasmer-runtime-core/debug"] llvm = ["wasmer-llvm-backend"] singlepass = ["wasmer-singlepass-backend"] -default-backend-singlepass = ["singlepass"] -default-backend-llvm = ["llvm"] -default-backend-cranelift = ["cranelift"] [[bench]] name = "nginx" diff --git a/lib/runtime/src/lib.rs b/lib/runtime/src/lib.rs index 5b3ba852689..ecf589e9bf1 100644 --- a/lib/runtime/src/lib.rs +++ b/lib/runtime/src/lib.rs @@ -67,7 +67,7 @@ //! let value = add_one.call(42)?; //! //! assert_eq!(value, 43); -//! +//! //! Ok(()) //! } //! ``` @@ -188,29 +188,20 @@ pub fn instantiate(wasm: &[u8], import_object: &ImportObject) -> error::Result impl Compiler { #[cfg(any( - all( - feature = "default-backend-llvm", - any( - feature = "default-backend-cranelift", - feature = "default-backend-singlepass" - ) - ), - all( - feature = "default-backend-cranelift", - feature = "default-backend-singlepass" - ) + all(feature = "llvm", any(feature = "cranelift", feature = "singlepass")), + all(feature = "cranelift", feature = "singlepass") ))] compile_error!( - "The `default-backend-X` features are mutually exclusive. Please choose just one" + "`cranelift / llvm / singlepass` features are mutually exclusive. Please choose just one" ); - #[cfg(feature = "default-backend-llvm")] + #[cfg(feature = "llvm")] use wasmer_llvm_backend::LLVMCompiler as DefaultCompiler; - #[cfg(feature = "default-backend-singlepass")] + #[cfg(feature = "singlepass")] use wasmer_singlepass_backend::SinglePassCompiler as DefaultCompiler; - #[cfg(feature = "default-backend-cranelift")] + #[cfg(feature = "cranelift")] use wasmer_clif_backend::CraneliftCompiler as DefaultCompiler; DefaultCompiler::new()