fix: use attributes to check the feature existence

This commit is contained in:
Sherzod Mutalov 2025-08-03 11:12:37 +05:00
parent e51847830a
commit 9ce7527d58

View File

@ -107,7 +107,7 @@ pub fn can_override_npx() -> bool {
// we need to check the CPU for the AVX2 instruction support if we are running under the MacOS // we need to check the CPU for the AVX2 instruction support if we are running under the MacOS
// with Intel CPU. We can override `npx` command with `bun` only if CPU is // with Intel CPU. We can override `npx` command with `bun` only if CPU is
// supporting AVX2, otherwise we need to use default `npx` binary // supporting AVX2, otherwise we need to use default `npx` binary
if cfg!(all(target_os="macos", any(target_arch = "x86", target_arch = "x86_64"))) #[cfg(all(target_os = "macos", any(target_arch = "x86", target_arch = "x86_64")))]
{ {
if !is_x86_feature_detected!("avx2") { if !is_x86_feature_detected!("avx2") {
log::warn!("Your CPU doesn't support AVX2 instruction, default npx binary will be used"); log::warn!("Your CPU doesn't support AVX2 instruction, default npx binary will be used");