chore(common): features by platform for cargo

This commit is contained in:
Marc Durdin 2021-06-10 16:39:09 +10:00
parent adf25ce657
commit 04806d389e
2 changed files with 8 additions and 2 deletions

View file

@ -209,7 +209,7 @@ build_test_rust() {
# Built library path for multi-arch (Windows) vs single (*nix)
cargo build --target-dir="$TARGET_PATH/rust/$TARGETBASE" $TARGET_FLAG $CARGO_TARGET
cargo build --target-dir="$TARGET_PATH/rust/$TARGETBASE" $TARGET_FLAG $CARGO_TARGET --features=$PLATFORM
# On Windows, final output path is ./build/rust/<arch>/<arch_rust>/debug|release/<libraryname>
# WASM is similar: ./build/rust/wasm/wasm_unknown_unknown/debug|release/<libraryname>

View file

@ -4,12 +4,18 @@ version = "0.1.0"
# This is required for 2018 support of Rust
edition = "2018"
[features]
# We only need to enable wasm dependencies for the
# wasm target
wasm = ["wasm-bindgen"]
native = []
[lib]
name = "rust_mock_processor"
crate-type = ["staticlib", "cdylib"]
[dependencies]
wasm-bindgen = "0.2.63"
wasm-bindgen = { version = "0.2.63", optional = true }
[profile.release]
# Tell `rustc` to optimize for small code size.