diff options
| author | rsdy <[email protected]> | 2021-10-07 12:23:36 +0100 |
|---|---|---|
| committer | rsdy <[email protected]> | 2021-10-07 12:41:53 +0100 |
| commit | 0a0bb7126e9207d3bb3d9af0f0b5ae646d532cf2 (patch) | |
| tree | 60a4c85dcc6a705a1ab03580fd401a183fcfd3f8 /build.rs | |
| parent | db436a50c2385550e7a0d54b24c7c6b47a6ca037 (diff) | |
Implement better target detection for NEON
Diffstat (limited to 'build.rs')
| -rw-r--r-- | build.rs | 11 |
1 files changed, 10 insertions, 1 deletions
@@ -44,6 +44,14 @@ fn is_x86_32() -> bool { arch == "i386" || arch == "i586" || arch == "i686" } +fn is_arm() -> bool { + is_armv7() || is_aarch64() || target_components()[0] == "arm" +} + +fn is_aarch64() -> bool { + target_components()[0] == "aarch64" +} + fn is_armv7() -> bool { target_components()[0] == "armv7" } @@ -237,7 +245,8 @@ fn main() -> Result<(), Box<dyn std::error::Error>> { } } - if is_neon() { + if (is_arm() && is_neon()) || (is_aarch64() && !is_pure()) { + println!("cargo:rustc-cfg=blake3_neon"); build_neon_c_intrinsics(); } |
