diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 19:33:14 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 19:33:14 +0000 |
commit | 36d22d82aa202bb199967e9512281e9a53db42c9 (patch) | |
tree | 105e8c98ddea1c1e4784a60a5a6410fa416be2de /third_party/rust/ahash/build.rs | |
parent | Initial commit. (diff) | |
download | firefox-esr-36d22d82aa202bb199967e9512281e9a53db42c9.tar.xz firefox-esr-36d22d82aa202bb199967e9512281e9a53db42c9.zip |
Adding upstream version 115.7.0esr.upstream/115.7.0esrupstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'third_party/rust/ahash/build.rs')
-rw-r--r-- | third_party/rust/ahash/build.rs | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/third_party/rust/ahash/build.rs b/third_party/rust/ahash/build.rs new file mode 100644 index 0000000000..8be4964e52 --- /dev/null +++ b/third_party/rust/ahash/build.rs @@ -0,0 +1,45 @@ +#![deny(warnings)] + +use std::env; + +fn main() { + println!("cargo:rerun-if-changed=build.rs"); + if let Some(channel) = version_check::Channel::read() { + if channel.supports_features() { + println!("cargo:rustc-cfg=feature=\"specialize\""); + println!("cargo:rustc-cfg=feature=\"stdsimd\""); + } + } + let os = env::var("CARGO_CFG_TARGET_OS").expect("CARGO_CFG_TARGET_OS was not set"); + if os.eq_ignore_ascii_case("linux") + || os.eq_ignore_ascii_case("android") + || os.eq_ignore_ascii_case("windows") + || os.eq_ignore_ascii_case("macos") + || os.eq_ignore_ascii_case("ios") + || os.eq_ignore_ascii_case("freebsd") + || os.eq_ignore_ascii_case("openbsd") + || os.eq_ignore_ascii_case("dragonfly") + || os.eq_ignore_ascii_case("solaris") + || os.eq_ignore_ascii_case("illumos") + || os.eq_ignore_ascii_case("fuchsia") + || os.eq_ignore_ascii_case("redox") + || os.eq_ignore_ascii_case("cloudabi") + || os.eq_ignore_ascii_case("haiku") + || os.eq_ignore_ascii_case("vxworks") + || os.eq_ignore_ascii_case("emscripten") + || os.eq_ignore_ascii_case("wasi") + { + println!("cargo:rustc-cfg=feature=\"runtime-rng\""); + } + let arch = env::var("CARGO_CFG_TARGET_ARCH").expect("CARGO_CFG_TARGET_ARCH was not set"); + if arch.eq_ignore_ascii_case("x86_64") + || arch.eq_ignore_ascii_case("aarch64") + || arch.eq_ignore_ascii_case("mips64") + || arch.eq_ignore_ascii_case("powerpc64") + || arch.eq_ignore_ascii_case("riscv64gc") + || arch.eq_ignore_ascii_case("s390x") + { + println!("cargo:rustc-cfg=feature=\"folded_multiply\""); + } + +} |