[android] Link C++ runtime according to VCPKG_CRT_LINKAGE (#11266)

https://developer.android.com/ndk/guides/cpp-support
This commit is contained in:
huangqinjin 2020-05-12 04:42:08 +08:00 committed by GitHub
parent 3e2409f47d
commit e886d48561
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -17,6 +17,12 @@ else()
message(FATAL_ERROR "Unknown ABI for target triplet ${VCPKG_TARGET_TRIPLET}")
endif()
if (VCPKG_CRT_LINKAGE STREQUAL "dynamic")
set(ANDROID_STL c++_shared CACHE STRING "")
else()
set(ANDROID_STL c++_static CACHE STRING "")
endif()
if(DEFINED ENV{ANDROID_NDK_HOME})
set(ANDROID_NDK_HOME $ENV{ANDROID_NDK_HOME})
else()