[cmake-developers] Why does CMAKE_CXX_STANDARD set 'gnu' flags?

Nikola Smiljanic popizdeh at gmail.com
Mon Oct 2 07:24:20 EDT 2017


Thanks Brad, so setting CXX_EXTENSIONS to off will switch me to 'standard'
compliant mode?

On Mon, Oct 2, 2017 at 10:01 PM, Brad King <brad.king at kitware.com> wrote:

> On 10/01/2017 08:29 PM, Nikola Smiljanic wrote:
> > I'd like to know why CMake uses 'gnu' flags when setting C++ standard.
> > I find this very surprising as 'gnu' mode enables non standard
> extensions?
>
> Setting the standard level should not affect the extensions, and the
> compiler's
> default mode includes extensions.  There is a separate property for
> extensions:
>
>   https://cmake.org/cmake/help/v3.9/prop_tgt/CXX_EXTENSIONS.html
>
> It is ON by default since most compilers have extensions on by default.
>
> -Brad
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/cmake-developers/attachments/20171002/ae6245f7/attachment.html>


More information about the cmake-developers mailing list