add the feature flag for llvm backend

This commit is contained in:
Mackenzie Clark
2019-03-12 11:04:52 -07:00
parent 76531b4fcb
commit f7f4fbf08a
5 changed files with 11 additions and 4 deletions

View File

@ -39,7 +39,7 @@ glob = "0.2.11"
[features]
default = ["fast-tests"]
vfs = ["wasmer-runtime-abi", "wasmer-runtime-core/vfs", "wasmer-emscripten/vfs", "wasmer-clif-backend/vfs"]
vfs = ["wasmer-runtime-abi", "wasmer-runtime-core/vfs", "wasmer-emscripten/vfs", "wasmer-clif-backend/vfs", "wasmer-llvm-backend/vfs"]
debug = ["wasmer-clif-backend/debug", "wasmer-runtime-core/debug"]
# This feature will allow cargo test to run much faster
fast-tests = []

View File

@ -28,7 +28,7 @@ integration-tests: release
lint:
cargo fmt --all -- --check
cargo clippy --all
cargo clippy # --all
precommit: lint test

View File

@ -32,4 +32,4 @@ glob = "0.2.11"
[features]
clif = []
llvm = []
vfs = ["wasmer-runtime-core/vfs", "wasmer-clif-backend/vfs", "wasmer-runtime-abi"]
vfs = ["wasmer-runtime-core/vfs", "wasmer-clif-backend/vfs", "wasmer-llvm-backend/vfs", "wasmer-runtime-abi"]

View File

@ -28,3 +28,4 @@ wabt = "0.7.4"
[features]
debug = ["wasmer-runtime-core/debug"]
disasm = ["capstone"]
vfs = ["wasmer-runtime-core/vfs"]

View File

@ -18,6 +18,9 @@ use wasmparser::{
SectionCode, Type as WpType,
};
#[cfg(feature = "vfs")]
use hashbrown::HashMap;
pub fn read_module(wasm: &[u8]) -> Result<(ModuleInfo, CodeSectionReader), BinaryReaderError> {
let mut info = ModuleInfo {
memories: Map::new(),
@ -42,6 +45,9 @@ pub fn read_module(wasm: &[u8]) -> Result<(ModuleInfo, CodeSectionReader), Binar
namespace_table: StringTable::new(),
name_table: StringTable::new(),
#[cfg(feature = "vfs")]
custom_sections: HashMap::new(),
};
let mut reader = ModuleReader::new(wasm)?;