Skip to content

Commit

Permalink
Address #43
Browse files Browse the repository at this point in the history
  • Loading branch information
myrrlyn committed Apr 18, 2021
1 parent 84ec9b8 commit 0eef94d
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions lexical-core/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,15 @@ fn main() {
// See `lexical-core/src/atof/algorithm/math.rs` for detailed
// instructions of architecture instruction support for 64-bit
// mathematical operations.
let limb_width_64 = cfg!(any(
target_arch = "aarch64",
target_arch = "mips64",
target_arch = "powerpc64",
target_arch = "x86_64"
));
let limb_width_64 = match std::env::var("CARGO_CFG_TARGET_ARCH") {
Ok(arch) => ["aarch64", "mips64", "powerpc64", "x86_64"].contains(&&*arch),
Err(_) => cfg!(any(
target_arch = "aarch64",
target_arch = "mips64",
target_arch = "powerpc64",
target_arch = "x86_64"
))
};
if limb_width_64 {
println!("cargo:rustc-cfg=limb_width_64");
} else {
Expand Down

0 comments on commit 0eef94d

Please sign in to comment.