Cargo Features
[dependencies]
aplang = { version = "0.1.10", default-features = false, features = ["native", "portable", "splash", "wasm"] }
- native default = stacker
-
"native" feature for non-wasm platforms, enabling native dependencies
Enables color and suggestions of clap
dependencies based on features
binboth
- portable = clap
-
"portable" allows for fully static linking at the cost of low stack size
cargo build --no-default-features --features portableEnables fancy-no-syscall of miette
- splash default
- wasm = js-sys, wasm-bindgen, web-sys
-
YOU SHALL NOT RUN AS A BINARY WITH THE WASM FEATURE!
"wasm" feature, enabling wasm-specific dependencies
cargo build --no-default-features --features wasm
RUSTFLAGS='--cfg getrandom_backend="wasm_js"'
you must set these flags to build for wasmEnables wasm_js of getrandom, fancy-no-syscall of miette
Affects
aplang::wasm
… - default = native, splash
-
default is empty, so you can explicitly opt-in to "wasm"
Features from optional dependencies
In crates that don't use the dep:
syntax, optional dependencies automatically become Cargo features. These features may have been created by mistake, and this functionality may be removed in the future.