From: Mika Lindqvist Date: Tue, 31 May 2022 12:58:17 +0000 (+0300) Subject: [ARM] We need to include NEON headers when testing for -mfpu=neon. X-Git-Tag: 2.1.0-beta1~233 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c62b35ffac42940ba97af241140839cbc84f6f04;p=thirdparty%2Fzlib-ng.git [ARM] We need to include NEON headers when testing for -mfpu=neon. * If -mfpu is already specified in C_FLAGS, it can disable NEON support. --- diff --git a/cmake/detect-intrinsics.cmake b/cmake/detect-intrinsics.cmake index c638b3bc2..1ddab2253 100644 --- a/cmake/detect-intrinsics.cmake +++ b/cmake/detect-intrinsics.cmake @@ -152,7 +152,12 @@ macro(check_neon_compiler_flag) # Check whether compiler supports NEON flag set(CMAKE_REQUIRED_FLAGS "${NEONFLAG} ${NATIVEFLAG}") check_c_source_compiles( - "int main() { return 0; }" + "#ifdef _M_ARM64 + # include + #else + # include + #endif + int main() { return 0; }" MFPU_NEON_AVAILABLE FAIL_REGEX "not supported") set(CMAKE_REQUIRED_FLAGS) endmacro() diff --git a/configure b/configure index b90c2342f..26529dbb5 100755 --- a/configure +++ b/configure @@ -1106,6 +1106,11 @@ EOF check_neon_compiler_flag() { # Check whether -mfpu=neon is available on ARM processors. cat > $test.c << EOF +#ifdef _M_ARM64 + # include + #else + # include +#endif int main() { return 0; } EOF if try $CC -c $CFLAGS -mfpu=neon $test.c; then