diff --git a/zng/cc.rs b/zng/cc.rs index 10ec3e65..12e08a89 100644 --- a/zng/cc.rs +++ b/zng/cc.rs @@ -196,6 +196,7 @@ pub fn build_zlib_ng(target: &str, compat: bool) { let target_os = env::var("CARGO_CFG_TARGET_OS").unwrap(); let arch = env::var("CARGO_CFG_TARGET_ARCH").expect("failed to retrieve target arch"); + let features = env::var("CARGO_CFG_TARGET_FEATURE").unwrap(); let is_linux_or_android = matches!(target_os.as_str(), "linux" | "android"); if is_linux_or_android { @@ -311,7 +312,9 @@ pub fn build_zlib_ng(target: &str, compat: bool) { } // neon - cfg.define("ARM_NEON", None); + if features.contains("neon") { + cfg.define("ARM_NEON", None); + } // NOTE: These intrinsics were only added in gcc 9.4, which is _relatively_ // recent, and if the define is not set zlib-ng just provides its