1set(CMAKE_SYSTEM_NAME Android) 2if(NOT $ENV{ANDROID_HOME} STREQUAL "") 3 set(CMAKE_ANDROID_NDK $ENV{ANDROID_HOME}/ndk-bundle) 4else() 5 set(CMAKE_ANDROID_NDK $ENV{HOME}/Android/Sdk/ndk-bundle) 6endif() 7set(CMAKE_ANDROID_NDK_TOOLCHAIN_VERSION clang) 8set(CMAKE_ANDROID_ARCH_ABI arm64-v8a) 9set(CMAKE_ANDROID_STL_TYPE c++_shared) 10if(APPLE) 11 set(CMAKE_RANLIB "${CMAKE_ANDROID_NDK}/toolchains/aarch64-linux-android-4.9/prebuilt/darwin-x86_64/aarch64-linux-android/bin/ranlib") 12 set(CMAKE_AR "${CMAKE_ANDROID_NDK}/toolchains/aarch64-linux-android-4.9/prebuilt/darwin-x86_64/aarch64-linux-android/bin/ar") 13endif() 14