I'm trying to create a C/C++ library using the latest version of Android studio (2.2.2).
How can I specify different compile options for different code files?
Some of the .cpp code in my library uses STL and requires "-std=gnu++11" in order to successfully compile.
Some of the code in my library uses .c files, which generates this error if "-std=gnu++11" is specified:
Error:invalid argument '-std=gnu++11' not allowed with 'C/ObjC'
I am currently using a build.gradle script to compile, but I'd also be open to using CMake, if someone can help me set up a CMake script to accomplish the same thing.
I saw other answers that specified cppFlags, rather than cFlags, in order to specify compile flags for only .cpp files. That NDK option appears to be missing from the latest version of Android Studio. When I try to use it, I get this error:
Could not get unknown property 'cppFlags' for object of type com.android.build.gradle.internal.dsl.NdkOptions.
Thanks for your help!