summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRadosław Gryta <radek.gryta@gmail.com>2024-02-25 11:53:11 +0100
committerGitHub <noreply@github.com>2024-02-25 12:53:11 +0200
commit12894088170f62e4cad4f8d6a3043c185b414bab (patch)
tree8a70a4f052567e944f8992e9c99d4525b4b1b166
parentab336a9d5e5352ecdcdf4c12d2d54cf4ef82ce31 (diff)
cmake : fix compilation for Android armeabi-v7a (#5702)
-rw-r--r--CMakeLists.txt10
1 files changed, 8 insertions, 2 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 3c462900..48880f72 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -936,10 +936,16 @@ if (CMAKE_OSX_ARCHITECTURES STREQUAL "arm64" OR CMAKE_GENERATOR_PLATFORM_LWR STR
list(APPEND ARCH_FLAGS -mfpu=neon-fp-armv8 -mno-unaligned-access)
endif()
if (${CMAKE_SYSTEM_PROCESSOR} MATCHES "armv7")
- # Raspberry Pi 2
- list(APPEND ARCH_FLAGS -mfpu=neon-fp-armv8 -mno-unaligned-access -funsafe-math-optimizations)
+ if ("${CMAKE_SYSTEM_NAME}" STREQUAL "Android")
+ # Android armeabi-v7a
+ list(APPEND ARCH_FLAGS -mfpu=neon-vfpv4 -mno-unaligned-access -funsafe-math-optimizations)
+ else()
+ # Raspberry Pi 2
+ list(APPEND ARCH_FLAGS -mfpu=neon-fp-armv8 -mno-unaligned-access -funsafe-math-optimizations)
+ endif()
endif()
if (${CMAKE_SYSTEM_PROCESSOR} MATCHES "armv8")
+ # Android arm64-v8a
# Raspberry Pi 3, 4, Zero 2 (32-bit)
list(APPEND ARCH_FLAGS -mno-unaligned-access)
endif()