Cmake in android studio links to libsupc++.a when using ANDROID_STL=system, even when RTTI and exceptions are explicitly disabled.

43 views
Skip to first unread message

Janusz Jankowski

unread,
Mar 27, 2017, 12:00:25 PM3/27/17
to android-ndk
I'm using AS2.3 with cmake 3.6.3155560. I set cppFlags to "-fno-exceptions", "-fno-rtti" and arguments to "-DANDROID_STL=system"
However I can see in build.ninja that AS still adds path to libsupc++.a to LINK_LIBRARIES what makes my *.so files 3x bigger.

I can get rid of it by explicitly setting arguments like "-DANDROID_STL=system", "-DCMAKE_CXX_STANDARD_LIBRARIES=-Lm", but I don't know if it is ok to do so, afaik supc++ is used for rtti and exceptions features that I don't use anyway (or am I wrong?). Idk why it is linked when it looks like it's not dependency. There is no linker errors and it look like everything works.

So am I missing something or it is bug and it shouldn't be linked when using system STL?

Thanks.

Dan Albert

unread,
Mar 27, 2017, 2:05:52 PM3/27/17
to android-ndk

--
You received this message because you are subscribed to the Google Groups "android-ndk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to android-ndk+unsubscribe@googlegroups.com.
To post to this group, send email to andro...@googlegroups.com.
Visit this group at https://groups.google.com/group/android-ndk.
To view this discussion on the web visit https://groups.google.com/d/msgid/android-ndk/69dd8209-8d8a-4441-891e-3cd74147f3b4%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages