[cmake]: Fix TOOLCHAIN_NAME error on aarch64

Change-Id: I2a56b86a716bfe2d2220e98d78126825e26ef19b
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
This commit is contained in:
Herman Chen 2020-05-26 20:37:23 +08:00
parent e78625c47b
commit c21d2dee3b
2 changed files with 15 additions and 16 deletions

View File

@ -1127,8 +1127,8 @@ if( APPLE )
endif()
# Force set compilers because standard identification works badly for us
include( CMakeForceCompiler )
CMAKE_FORCE_C_COMPILER( "${CMAKE_C_COMPILER}" GNU )
#include( CMakeForceCompiler )
#CMAKE_FORCE_C_COMPILER( "${CMAKE_C_COMPILER}" GNU )
if( ANDROID_COMPILER_IS_CLANG )
set( CMAKE_C_COMPILER_ID Clang )
endif()
@ -1140,7 +1140,7 @@ else()
endif()
set( CMAKE_C_HAS_ISYSROOT 1 )
set( CMAKE_C_COMPILER_ABI ELF )
CMAKE_FORCE_CXX_COMPILER( "${CMAKE_CXX_COMPILER}" GNU )
#CMAKE_FORCE_CXX_COMPILER( "${CMAKE_CXX_COMPILER}" GNU )
if( ANDROID_COMPILER_IS_CLANG )
set( CMAKE_CXX_COMPILER_ID Clang)
endif()

View File

@ -141,17 +141,26 @@ else
if [ $NDK_VERSION -ge 16 ]; then
TOOLCHAIN_FILE=${ANDROID_NDK}/build/cmake/android.toolchain.cmake
TOOLCHAIN_NAME="arm-linux-androideabi-4.9"
NATIVE_API_LEVEL="android-27"
elif [ $NDK_VERSION -gt 12 ]; then
TOOLCHAIN_FILE=${ANDROID_NDK}/build/cmake/android.toolchain.cmake
TOOLCHAIN_NAME="arm-linux-androideabi-4.9"
NATIVE_API_LEVEL="android-21"
elif [ $NDK_VERSION -le 12 ]; then
TOOLCHAIN_FILE=../android.toolchain.cmake
TOOLCHAIN_NAME="arm-linux-androideabi-4.9"
NATIVE_API_LEVEL="android-21"
fi
#################################################
# Set platform tools
#################################################
if [ "${ANDROID_ABI}" = "armeabi-v7a" ]; then
TOOLCHAIN_NAME="arm-linux-androideabi-4.9"
ANDROID_ABI="armeabi-v7a with NEON"
PLATFORM=$ANDROID_NDK/platforms/${NATIVE_API_LEVEL}/arch-arm
elif [ "${ANDROID_ABI}" = "arm64-v8a" ]; then
TOOLCHAIN_NAME="aarch64-linux-android-4.9"
PLATFORM=$ANDROID_NDK/platforms/${NATIVE_API_LEVEL}/arch-arm64
fi
fi
if [ "${FOUND_NDK}" = "0" ]; then
@ -163,13 +172,3 @@ else
echo "toolchain name: $TOOLCHAIN_NAME"
echo "api level: $NATIVE_API_LEVEL"
fi
#################################################
# Set platform tools
#################################################
if [ "${ANDROID_ABI}" = "armeabi-v7a" ]; then
ANDROID_ABI="armeabi-v7a with NEON"
PLATFORM=$ANDROID_NDK/platforms/${NATIVE_API_LEVEL}/arch-arm
elif [ "${ANDROID_ABI}" = "arm64-v8a" ]; then
PLATFORM=$ANDROID_NDK/platforms/${NATIVE_API_LEVEL}/arch-arm64
fi