Make docs compilation happy

This commit is contained in:
Syrus 2019-11-21 18:35:19 -08:00
parent 7b9485320d
commit 9a146c57fc
4 changed files with 8 additions and 4 deletions

View File

@ -77,6 +77,7 @@ default = ["fast-tests", "wasi", "backend-cranelift"]
"loader-kernel" = ["wasmer-kernel-loader"]
debug = ["wasmer-runtime-core/debug"]
trace = ["wasmer-runtime-core/trace"]
docs = ["wasmer-runtime/docs"]
extra-debug = ["wasmer-clif-backend/debug", "wasmer-runtime-core/debug"]
# This feature will allow cargo test to run much faster
fast-tests = []

View File

@ -265,4 +265,4 @@ dep-graph:
cargo deps --optional-deps --filter wasmer-wasi wasmer-wasi-tests wasmer-kernel-loader wasmer-dev-utils wasmer-llvm-backend wasmer-emscripten wasmer-emscripten-tests wasmer-runtime-core wasmer-runtime wasmer-middleware-common wasmer-middleware-common-tests wasmer-singlepass-backend wasmer-clif-backend wasmer --manifest-path Cargo.toml | dot -Tpng > wasmer_depgraph.png
docs:
cargo doc --features=backend-singlepass,backend-llvm,wasi,managed
cargo doc --features=backend-cranelift,backend-singlepass,backend-llvm,docs,wasi,managed

View File

@ -35,6 +35,7 @@ optional = true
[features]
default = ["cranelift", "default-backend-cranelift"]
docs = []
cranelift = ["wasmer-clif-backend"]
cache = ["cranelift"]
debug = ["wasmer-clif-backend/debug", "wasmer-runtime-core/debug"]

View File

@ -208,12 +208,14 @@ pub fn default_compiler() -> impl Compiler {
#[cfg(any(
all(
feature = "default-backend-llvm",
not(feature = "docs"),
any(
feature = "default-backend-cranelift",
feature = "default-backend-singlepass"
)
),
all(
not(feature = "docs"),
feature = "default-backend-cranelift",
feature = "default-backend-singlepass"
)
@ -222,13 +224,13 @@ pub fn default_compiler() -> impl Compiler {
"The `default-backend-X` features are mutually exclusive. Please choose just one"
);
#[cfg(feature = "default-backend-llvm")]
#[cfg(all(feature = "default-backend-llvm", not(feature = "docs")))]
use wasmer_llvm_backend::LLVMCompiler as DefaultCompiler;
#[cfg(feature = "default-backend-singlepass")]
#[cfg(all(feature = "default-backend-singlepass", not(feature = "docs")))]
use wasmer_singlepass_backend::SinglePassCompiler as DefaultCompiler;
#[cfg(feature = "default-backend-cranelift")]
#[cfg(any(feature = "default-backend-singlepass", feature = "docs"))]
use wasmer_clif_backend::CraneliftCompiler as DefaultCompiler;
DefaultCompiler::new()