Fixed #7158: detection of arm neon.

(cherry picked from commit 6e075a6a7d)
This commit is contained in:
Armin Novak 2021-07-07 08:58:02 +02:00 committed by akallabeth
parent dfd5abc42b
commit 50bc2d59e8
3 changed files with 14 additions and 3 deletions

View File

@ -598,6 +598,12 @@ if(ANDROID)
set (WITH_NEON OFF)
endif()
if(ANDROID_ABI STREQUAL arm64-v8a)
# https://github.com/android/ndk/issues/910
add_definitions(-D__ARM_NEON)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -mfloat-abi=softfp")
endif()
if("${CMAKE_BUILD_TYPE}" STREQUAL "Debug")
add_definitions(-DNDK_DEBUG=1)

View File

@ -211,7 +211,12 @@ if(FAAC_FOUND)
endif()
if(WITH_NEON)
set_source_files_properties(${CODEC_NEON_SRCS} PROPERTIES COMPILE_FLAGS "-mfpu=neon -Wno-unused-variable" )
check_symbol_exists("_M_AMD64" "" MSVC_ARM64)
check_symbol_exists("__aarch64__" "" ARCH_ARM64)
if (NOT MSVC_ARM64 AND NOT ARCH_ARM64)
set_source_files_properties(${CODEC_NEON_SRCS} PROPERTIES COMPILE_FLAGS "-mfpu=neon" )
endif()
set(CODEC_SRCS ${CODEC_SRCS} ${CODEC_NEON_SRCS})
endif()

View File

@ -21,7 +21,7 @@
#include "config.h"
#endif
#if defined(__ARM_NEON__)
#if defined(__ARM_NEON)
#include <stdio.h>
#include <stdlib.h>
@ -241,4 +241,4 @@ void rfx_init_neon(RFX_CONTEXT* context)
}
}
#endif // __ARM_NEON__
#endif // __ARM_NEON