anza-cryptography-source/curve25519/solana-ed25519/build.rs
zz-sol 1587b4c24f
refactor and merge curve and ed crates (#6)
* refactor and merge curve and ed crates

* fmt

* ci

* fmt again

* ci

* Update bench.rs

* fix ubuntu
2026-03-26 08:09:10 -04:00

22 lines
822 B
Rust

//! This codebase is pinned to x86_64 SIMD + 64-bit backend.
#![deny(clippy::unwrap_used, dead_code)]
fn main() {
let target_arch = match std::env::var("CARGO_CFG_TARGET_ARCH") {
Ok(arch) => arch,
_ => "".to_string(),
};
let rustc_version = rustc_version::version().expect("failed to detect rustc version");
if rustc_version.major == 1 && rustc_version.minor <= 64 {
// Old versions of Rust complain when you have an `unsafe fn` and you use `unsafe {}` inside,
// so for those we want to apply the `#[allow(unused_unsafe)]` attribute to get rid of that warning.
println!("cargo:rustc-cfg=allow_unused_unsafe");
}
let _ = target_arch;
println!("cargo:rustc-cfg=curve25519_bits=\"64\"");
println!("cargo:rustc-cfg=curve25519_backend=\"simd\"");
}