[CMake] Setting CXX_STANDARD 11 Enables GNU Extensions

Nils Gladitz nilsgladitz at gmail.com
Fri Jul 3 18:20:30 EDT 2015


On 03.07.2015 22:55, digitalriptide wrote:
> If I enable C++11 for some target via
> set_target_properties( SomeTarget PROPERTIES CXX_STANDARD 11 )
> set_target_properties( SomeTarget PROPERTIES CXX_STANDARD_REQUIRED ON )
> with GCC, the code will then compile with -std=gnu++11. Compiling with 
> -std=gnu++11 enables C++11 *and* the GNU extensions. Is there an 
> option that will result in -std=c++11 in lieu of -std=gnu++11, to 
> build without the the GNU extensions?
>

There is http://www.cmake.org/cmake/help/v3.2/prop_tgt/CXX_EXTENSIONS.html

Nils



More information about the CMake mailing list