From e13c292facfd85b1082e6a9d2a0fb37f53844194 Mon Sep 17 00:00:00 2001 From: baldurk Date: Wed, 26 Sep 2018 11:12:44 +0100 Subject: [PATCH] Explicitly select c++_static STL, default Android STL is totally broken --- CMakeLists.txt | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index fe67174d8..c83ebfaa8 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -13,6 +13,11 @@ if(BUILD_ANDROID) if(NOT ANDROID_PLATFORM) set(ANDROID_PLATFORM "android-21") endif() + + # default to libc++_static as the other options can cause crashes + if(NOT ANDROID_STL) + set(ANDROID_STL "c++_static") + endif() # Choose clang if the NDK has both gcc and clang, since gcc sometimes fails set(CMAKE_ANDROID_NDK_TOOLCHAIN_VERSION "clang")