mirror of
https://github.com/Kitware/CMake.git
synced 2025-12-31 10:50:16 -06:00
Android: Link c++abi and android_support when necessary
For older NDKs we used `__android_stl_lib` to link these libraries, but
the `CMAKE_ANDROID_NDK_TOOLCHAIN_UNIFIED` code path does not use that.
Link the libraries the way the NDK toolchain file does:
43b2de34ef/build/cmake/android.toolchain.cmake (368)
This commit is contained in:
@@ -53,6 +53,12 @@ if(CMAKE_ANDROID_STL_TYPE)
|
||||
set(_ANDROID_STL_RTTI 0)
|
||||
macro(__android_stl lang)
|
||||
string(APPEND CMAKE_${lang}_FLAGS_INIT " -stdlib=libstdc++")
|
||||
if(_ANDROID_STL_EXCEPTIONS OR _ANDROID_STL_RTTI)
|
||||
string(APPEND CMAKE_${lang}_STANDARD_LIBRARIES " -lc++abi")
|
||||
if(CMAKE_SYSTEM_VERSION LESS 21)
|
||||
list(APPEND CMAKE_${lang}_STANDARD_LIBRARIES "-landroid_support")
|
||||
endif()
|
||||
endif()
|
||||
endmacro()
|
||||
elseif(CMAKE_ANDROID_STL_TYPE STREQUAL "c++_static")
|
||||
set(_ANDROID_STL_EXCEPTIONS 1)
|
||||
|
||||
Reference in New Issue
Block a user