diff options
Diffstat (limited to 'Modules/Platform/Android-Common.cmake')
-rw-r--r-- | Modules/Platform/Android-Common.cmake | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/Modules/Platform/Android-Common.cmake b/Modules/Platform/Android-Common.cmake index 581fde4..39da933 100644 --- a/Modules/Platform/Android-Common.cmake +++ b/Modules/Platform/Android-Common.cmake @@ -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) @@ -81,6 +87,12 @@ if(CMAKE_ANDROID_STL_TYPE) "Android: STL '${CMAKE_ANDROID_STL_TYPE}' not supported by this NDK." ) endif() + if(DEFINED CMAKE_ANDROID_RTTI) + set(_ANDROID_STL_RTTI ${CMAKE_ANDROID_RTTI}) + endif() + if(DEFINED CMAKE_ANDROID_EXCEPTIONS) + set(_ANDROID_STL_EXCEPTIONS ${CMAKE_ANDROID_EXCEPTIONS}) + endif() elseif(CMAKE_ANDROID_NDK) macro(__android_stl_inc lang dir req) |