The cmake bundled with NDK is the one which gets used by default, but it defines so many options. One of them is -
elseif(ANDROID_STL STREQUAL gnustl_shared)
set(ANDROID_STL_STATIC_LIBRARIES
supc++)
set(ANDROID_STL_SHARED_LIBRARIES
gnustl_shared)
Now, I want gnustl_shared to used, but no supc++, and I cannot find anyway to do it. Removing it manually from android.toolchain.cmake works for me. But I don't want to edit ndk toolchain cmake file on every machine. In my app's cmakelists.txt, I have tried
list(FILTER ANDROID_STL_STATIC_LIBRARIES EXCLUDE REGEX ".*supc.*")
list(FILTER CMAKE_CXX_STANDARD_LIBRARIES_INIT EXCLUDE REGEX ".*supc.*")
But every time, in the generated build.ninja file, I see libsupc++.a in LINK_LIBRARIES.
Is there a clean way for me to exclude this lib while linking ?