mirror of
https://github.com/microsoft/vcpkg.git
synced 2025-01-14 05:38:00 +08:00
[vcpkg] Improving android support (#12634)
* Fix for Android compilation See https://github.com/microsoft/vcpkg/issues/5809 * Allow for custom android triplets. Fallback to Xamarin installed NDK. * Increased Port-Version for boost-modular-build-helper * More restrictive matching pattern for android toolchain
This commit is contained in:
parent
80fae15c03
commit
60bb798ceb
@ -97,7 +97,11 @@ if(CMAKE_CXX_COMPILER_TARGET AND CMAKE_CXX_COMPILE_OPTIONS_TARGET)
|
||||
endif()
|
||||
endif()
|
||||
if(CMAKE_CXX_COMPILER_EXTERNAL_TOOLCHAIN)
|
||||
set(CXXFLAGS "${CXXFLAGS} <compileflags>${CMAKE_CXX_COMPILE_OPTIONS_EXTERNAL_TOOLCHAIN} <compileflags>${CMAKE_CXX_COMPILER_EXTERNAL_TOOLCHAIN}")
|
||||
if(CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
|
||||
set(CXXFLAGS "${CXXFLAGS} <compileflags>${CMAKE_CXX_COMPILE_OPTIONS_EXTERNAL_TOOLCHAIN}${CMAKE_CXX_COMPILER_EXTERNAL_TOOLCHAIN}")
|
||||
else()
|
||||
set(CXXFLAGS "${CXXFLAGS} <compileflags>${CMAKE_CXX_COMPILE_OPTIONS_EXTERNAL_TOOLCHAIN} <compileflags>${CMAKE_CXX_COMPILER_EXTERNAL_TOOLCHAIN}")
|
||||
endif()
|
||||
endif()
|
||||
if(CMAKE_SYSROOT AND CMAKE_CXX_COMPILE_OPTIONS_SYSROOT)
|
||||
set(CXXFLAGS "${CXXFLAGS} <compileflags>${CMAKE_CXX_COMPILE_OPTIONS_SYSROOT}${CMAKE_SYSROOT}")
|
||||
|
@ -5,13 +5,13 @@ set(ANDROID_TOOLCHAIN clang CACHE STRING "")
|
||||
set(ANDROID_NATIVE_API_LEVEL 21 CACHE STRING "")
|
||||
set(CMAKE_ANDROID_NDK_TOOLCHAIN_VERSION clang CACHE STRING "")
|
||||
|
||||
if (VCPKG_TARGET_TRIPLET STREQUAL "arm64-android")
|
||||
if (VCPKG_TARGET_TRIPLET MATCHES "^arm64-android")
|
||||
set(ANDROID_ABI arm64-v8a CACHE STRING "")
|
||||
elseif(VCPKG_TARGET_TRIPLET STREQUAL "arm-android")
|
||||
elseif(VCPKG_TARGET_TRIPLET MATCHES "^arm-android")
|
||||
set(ANDROID_ABI armeabi-v7a CACHE STRING "")
|
||||
elseif(VCPKG_TARGET_TRIPLET STREQUAL "x64-android")
|
||||
elseif(VCPKG_TARGET_TRIPLET MATCHES "^x64-android")
|
||||
set(ANDROID_ABI x86_64 CACHE STRING "")
|
||||
elseif(VCPKG_TARGET_TRIPLET STREQUAL "x86-android")
|
||||
elseif(VCPKG_TARGET_TRIPLET MATCHES "^x86-android")
|
||||
set(ANDROID_ABI x86 CACHE STRING "")
|
||||
else()
|
||||
message(FATAL_ERROR "Unknown ABI for target triplet ${VCPKG_TARGET_TRIPLET}")
|
||||
@ -26,7 +26,11 @@ endif()
|
||||
if(DEFINED ENV{ANDROID_NDK_HOME})
|
||||
set(ANDROID_NDK_HOME $ENV{ANDROID_NDK_HOME})
|
||||
else()
|
||||
set(ANDROID_NDK_HOME "$ENV{ProgramData}/Microsoft/AndroidNDK64/android-ndk-r13b/")
|
||||
set(ANDROID_NDK_HOME "$ENV{ProgramData}/Microsoft/AndroidNDK64/android-ndk-r13b/")
|
||||
if(NOT EXISTS "${ANDROID_NDK_HOME}")
|
||||
# Use Xamarin default installation folder
|
||||
set(ANDROID_NDK_HOME "$ENV{ProgramFiles\(x86\)}/Android/android-sdk/ndk-bundle")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(NOT EXISTS "${ANDROID_NDK_HOME}/build/cmake/android.toolchain.cmake")
|
||||
|
Loading…
x
Reference in New Issue
Block a user