From 28a150246a629f306bc14d3b8110cce5b6cd50e2 Mon Sep 17 00:00:00 2001 From: Jon Siwek Date: Fri, 9 Apr 2021 10:54:53 -0700 Subject: [PATCH] GH-1496: Fix build on armv7 architecture --- src/CMakeLists.txt | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 94cacbd5ea..e4cb73448f 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -362,6 +362,18 @@ set(HH_SRCS ) if (${COMPILER_ARCHITECTURE} STREQUAL "arm") + check_c_source_compiles(" + #if defined(__ARM_NEON__) || defined(__ARM_NEON) + int main() { return 0; } + #else + #error + #endif + " test_arm_neon) + + if (test_arm_neon) + list(APPEND HH_SRCS ../auxil/highwayhash/highwayhash/hh_neon.cc) + endif () + set_source_files_properties(${HH_SRCS} PROPERTIES COMPILE_FLAGS -mfloat-abi=hard -march=armv7-a -mfpu=neon) elseif (${COMPILER_ARCHITECTURE} STREQUAL "aarch64")