Reputation: 3189
In Visual Studio, have things setup (using vs-android) to apply -std=c++11
through the "Additional Options" in "Compiler Arguments" in the project. Which is good, because it applies it to all compiled files.
Except when it tries to compile a C file:
cc1.exe : warning : command line option '-std=c++11' is valid for C++/ObjC++ but not for C [enabled by default]
Which is just a warning, but it slows down the build ever so slightly every time, and there's a lot of pure C files.
Is there any way to make an exception for this in Visual Studio, so it isn't done to C files, but only C++ files?
Upvotes: 1
Views: 376
Reputation: 23499
Alas, there's no way to do it in the manner you are looking for.
One thing that may work for you, depending on if you are using any other global command-line options or not, is select all of your .C files in the project, and in the compiler options un-check the "Inherit from parent or project defaults" checkbox just above the Additional Options box. You should be able to do it for all of your C files in one shot by ctrl-selecting them and then right-click/Properties/etc. Then any of the extra command-line options you set at the project level will not be used for those files.
Upvotes: 1