We're trying to make use of the new CMake support in Android Studio's 2.2 gradle.
By default, the toolchain is set to use GCC and it seems to be broken, so compilation fails miserably.
How can I tell it to work with clang?
I tried to use -DANDROID_TOOLCHAIN_NAME=arm-linux-androideabi-clang3.5
in the Arguments parameter within the scope of CMake in our build.gradle, but that also fails (it was documented in the comments of android.toolchain.cmake that came with the NDK claiming that such toolchain doesn't exist.
Google seem to have updated their documentation on that, adding a new -DANDROID_TOOLCHAIN=clang argument, see -
http://tools.android.com/tech-docs/external-c-builds
UPDATE Latest Android Studio builds as of today (Aug 21, 2016) have a checkbox when starting a new project, to enable C++ Support, I tested it on Windows and it works.
Cheers
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With