From: Radosław Gryta Date: Sun, 25 Feb 2024 10:53:11 +0000 (+0100) Subject: cmake : fix compilation for Android armeabi-v7a (#5702) X-Git-Tag: upstream/0.0.4488~2230 X-Git-Url: https://git.djapps.eu/?a=commitdiff_plain;h=12894088170f62e4cad4f8d6a3043c185b414bab;p=pkg%2Fggml%2Fsources%2Fllama.cpp cmake : fix compilation for Android armeabi-v7a (#5702) --- 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()