diff --git a/ethbloom/Cargo.toml b/ethbloom/Cargo.toml index 4d8b01d..8c525bf 100644 --- a/ethbloom/Cargo.toml +++ b/ethbloom/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "ethbloom" -version = "0.4.0" +version = "0.4.1" authors = ["Parity Technologies "] description = "Ethereum bloom filter" license = "MIT" diff --git a/ethbloom/src/lib.rs b/ethbloom/src/lib.rs index 6fb99e3..6150da8 100644 --- a/ethbloom/src/lib.rs +++ b/ethbloom/src/lib.rs @@ -28,8 +28,6 @@ #![cfg_attr(not(feature="std"), no_std)] -#![cfg_attr(asm_available, feature(asm))] - #[cfg(feature="std")] extern crate core; diff --git a/ethereum-types/Cargo.toml b/ethereum-types/Cargo.toml index 33ea15d..f5c7dcd 100644 --- a/ethereum-types/Cargo.toml +++ b/ethereum-types/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "ethereum-types" -version = "0.2.0" +version = "0.2.1" authors = ["Parity Technologies "] license = "MIT" homepage = "https://github.com/paritytech/primitives" @@ -22,3 +22,4 @@ default = ["std", "heapsizeof", "serialize"] std = ["uint/std", "fixed-hash/std", "ethbloom/std"] heapsizeof = ["uint/heapsizeof", "fixed-hash/heapsizeof", "ethbloom/heapsizeof"] serialize = ["std", "ethereum-types-serialize", "serde", "ethbloom/serialize"] +use_asm = ["uint/use_asm"] \ No newline at end of file diff --git a/ethereum-types/build.rs b/ethereum-types/build.rs index 432acc3..3ba1687 100644 --- a/ethereum-types/build.rs +++ b/ethereum-types/build.rs @@ -11,7 +11,9 @@ extern crate rustc_version; use rustc_version::{version_meta, Channel}; fn main() { - if let Channel::Nightly = version_meta().unwrap().channel { - println!("cargo:rustc-cfg=asm_available"); + if cfg!(feature = "use_asm") { + if let Channel::Nightly = version_meta().unwrap().channel { + println!("cargo:rustc-cfg=asm_available"); + } } } diff --git a/tests/Cargo.toml b/tests/Cargo.toml index e7b2b21..e466302 100644 --- a/tests/Cargo.toml +++ b/tests/Cargo.toml @@ -11,3 +11,6 @@ crunchy = "0.1.5" ethereum-types = { path ="../ethereum-types", features = ["std", "heapsizeof"] } quickcheck = "0.6" uint = { path = "../uint" } + +[features] +use_asm = ["uint/use_asm", "ethereum-types/use_asm"] \ No newline at end of file diff --git a/tests/build.rs b/tests/build.rs index 432acc3..3ba1687 100644 --- a/tests/build.rs +++ b/tests/build.rs @@ -11,7 +11,9 @@ extern crate rustc_version; use rustc_version::{version_meta, Channel}; fn main() { - if let Channel::Nightly = version_meta().unwrap().channel { - println!("cargo:rustc-cfg=asm_available"); + if cfg!(feature = "use_asm") { + if let Channel::Nightly = version_meta().unwrap().channel { + println!("cargo:rustc-cfg=asm_available"); + } } } diff --git a/uint/Cargo.toml b/uint/Cargo.toml index c37a00c..8433f2a 100644 --- a/uint/Cargo.toml +++ b/uint/Cargo.toml @@ -4,7 +4,7 @@ homepage = "http://parity.io" repository = "https://github.com/paritytech/primitives" license = "MIT/Apache-2.0" name = "uint" -version = "0.1.0" +version = "0.1.1" authors = ["Parity Technologies "] build = "build.rs" @@ -22,6 +22,7 @@ crunchy = "0.1.5" [features] std = ["rustc-hex"] heapsizeof = ["heapsize"] +use_asm = [] [[example]] name = "modular" diff --git a/uint/build.rs b/uint/build.rs index 432acc3..3ba1687 100644 --- a/uint/build.rs +++ b/uint/build.rs @@ -11,7 +11,9 @@ extern crate rustc_version; use rustc_version::{version_meta, Channel}; fn main() { - if let Channel::Nightly = version_meta().unwrap().channel { - println!("cargo:rustc-cfg=asm_available"); + if cfg!(feature = "use_asm") { + if let Channel::Nightly = version_meta().unwrap().channel { + println!("cargo:rustc-cfg=asm_available"); + } } }