Fix compilation errors with cranelift.

This commit is contained in:
losfair 2019-11-21 23:37:17 +08:00
parent d45076151e
commit 73cc86de0c
2 changed files with 3 additions and 0 deletions

View File

@ -81,6 +81,7 @@ extra-debug = ["wasmer-clif-backend/debug", "wasmer-runtime-core/debug"]
# This feature will allow cargo test to run much faster
fast-tests = []
backend-cranelift = [
"wasmer-clif-backend",
"wasmer-runtime-core/backend-cranelift",
"wasmer-runtime/cranelift",
"wasmer-middleware-common-tests/clif",

View File

@ -907,6 +907,8 @@ fn get_compiler_by_backend(backend: Backend, _opts: &Run) -> Option<Box<dyn Comp
Backend::Singlepass => return None,
#[cfg(feature = "backend-cranelift")]
Backend::Cranelift => Box::new(CraneliftCompiler::new()),
#[cfg(not(feature = "backend-cranelift"))]
Backend::Cranelift => return None,
#[cfg(feature = "backend-llvm")]
Backend::LLVM => Box::new(LLVMCompiler::new()),
#[cfg(not(feature = "backend-llvm"))]