build: support android aarch64

This adds the needed support to enable building the standard library for android
aarch64 assuming that the appropriate parameters are passed to CMake.
This commit is contained in:
Saleem Abdulrasool
2018-09-21 10:18:58 -07:00
parent 0494ab651e
commit 583ceaede5
4 changed files with 24 additions and 10 deletions

View File

@@ -10,14 +10,18 @@ function(swift_android_include_for_arch arch var)
endfunction()
function(swift_android_lib_for_arch arch var)
set(_prebuilt "${SWIFT_SDK_ANDROID_ARCH_${arch}_NDK_PREBUILT_PATH}")
set(_host "${SWIFT_SDK_ANDROID_ARCH_${arch}_NDK_TRIPLE}")
set(paths)
if(arch STREQUAL armv7)
list(APPEND paths
"${SWIFT_SDK_ANDROID_ARCH_${arch}_NDK_PREBUILT_PATH}/${SWIFT_SDK_ANDROID_ARCH_${arch}_NDK_TRIPLE}/lib/armv7-a")
if(arch STREQUAL armv7)
list(APPEND paths "${_prebuilt}/${_host}/lib/armv7-a")
elseif(arch STREQUAL aarch64)
list(APPEND paths "${_prebuilt}/${_host}/lib64")
else()
message(SEND_ERROR "unknown architecture (${arch}) for android")
endif()
list(APPEND paths "${_prebuilt}/lib/gcc/${_host}/${SWIFT_ANDROID_NDK_GCC_VERSION}.x")
list(APPEND paths
"${SWIFT_SDK_ANDROID_ARCH_${arch}_NDK_PREBUILT_PATH}/lib/gcc/${SWIFT_SDK_ANDROID_ARCH_${arch}_NDK_TRIPLE}/${SWIFT_ANDROID_NDK_GCC_VERSION}.x")
set(${var} ${paths} PARENT_SCOPE)
endfunction()