diff --git a/build.rs b/build.rs index 4f72182..b1ea2f1 100644 --- a/build.rs +++ b/build.rs @@ -11,9 +11,15 @@ fn main() { None => return, }; + let target = env::var("TARGET").unwrap(); + let emscripten = target == "asmjs-unknown-emscripten" || target == "wasm32-unknown-emscripten"; + // 128-bit integers stabilized in Rust 1.26: // https://blog.rust-lang.org/2018/05/10/Rust-1.26.html - if minor >= 26 { + // + // Disabled on Emscripten targets as Emscripten doesn't + // currently support integers larger than 64 bits. + if minor >= 26 && !emscripten { println!("cargo:rustc-cfg=integer128"); }