diff --git a/.travis.yml b/.travis.yml index 9c3c0004..8d1de07a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -10,6 +10,9 @@ matrix: - rust: stable env: - FEATURES='rayon' + - rust: stable + env: + - FEATURES='std' - rust: beta - rust: nightly env: diff --git a/Cargo.toml b/Cargo.toml index d3aef2ad..047c2689 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -53,6 +53,9 @@ fxhash = "0.2.1" # Serialization with serde 1.0 serde-1 = ["serde"] +# Force the use of `std`, bypassing target detection. +std = [] + # for testing only, of course test_low_transition_point = [] test_debug = [] diff --git a/build.rs b/build.rs index 645c0f1c..9f9fa054 100644 --- a/build.rs +++ b/build.rs @@ -1,5 +1,8 @@ fn main() { - let ac = autocfg::new(); - ac.emit_sysroot_crate("std"); + // If "std" is explicitly requested, don't bother probing the target for it. + match std::env::var_os("CARGO_FEATURE_STD") { + Some(_) => autocfg::emit("has_std"), + None => autocfg::new().emit_sysroot_crate("std"), + } autocfg::rerun_path("build.rs"); }