From adc36d81e407aafbae5ddaeaf03b6c8379af5965 Mon Sep 17 00:00:00 2001 From: Paul Dicker Date: Wed, 28 Mar 2018 20:19:21 +0200 Subject: [PATCH] Restrict the stdweb feature to the wasm32-unknown-unknown target --- Cargo.toml | 5 ++++- src/lib.rs | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index e70462a1fb9..069037a9b0c 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -33,7 +33,6 @@ rand_core = { version = '0.1.0-pre.0', default-features = false } log = { version = "0.4", optional = true } serde = { version = "1", optional = true } serde_derive = { version = "1", optional = true } -stdweb = { version = "0.4", optional = true } [target.'cfg(unix)'.dependencies] libc = { version = "0.2", optional = true } @@ -47,6 +46,10 @@ cloudabi = { version = "0.0.3", optional = true } [target.'cfg(target_os = "fuchsia")'.dependencies] fuchsia-zircon = { version = "0.3.2", optional = true } +[target.wasm32-unknown-unknown.dependencies] +# use with `--target wasm32-unknown-unknown --features=stdweb` +stdweb = { version = "0.4", optional = true } + [dev-dependencies] # This is for testing serde, unfortunately we can't specify feature-gated dev # deps yet, see: https://github.com/rust-lang/cargo/issues/1596 diff --git a/src/lib.rs b/src/lib.rs index 6abc684d41e..cf9a050b22a 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -188,7 +188,7 @@ #[cfg(feature="serde-1")] extern crate serde; #[cfg(feature="serde-1")] #[macro_use] extern crate serde_derive; -#[cfg(feature = "stdweb")] +#[cfg(all(target_arch = "wasm32", feature = "stdweb"))] #[macro_use] extern crate stdweb;