fn main() {
println!("cargo:rerun-if-changed=build.rs");
if std::env::var("CARGO_FEATURE_JIT").is_ok() {
#[cfg(target_arch = "x86_64")]
if !std::arch::is_x86_feature_detected!("avx2") {
eprintln!(
"`x86_64` build with `jit` enabled requires AVX2 instructions"
);
std::process::exit(1);
} else if !std::arch::is_x86_feature_detected!("bmi2") {
eprintln!(
"`x86_64` build with `jit` enabled requires BMI2 instructions"
);
std::process::exit(1);
}
#[cfg(target_arch = "aarch64")]
if !std::arch::is_aarch64_feature_detected!("neon") {
eprintln!(
"`aarch64` build with `jit` enabled requires NEON instructions"
);
std::process::exit(1);
}
}
}