[CMake] GCC: -std=g++14 vs -std=c++14

Patrick Boettcher patrick.boettcher at posteo.de
Mon Jun 13 05:36:20 EDT 2016


Hi list,

I'm using gcc for a c++14-based project.

To have cmake add the corresponding -std=-flag I'm setting

  set_property(TARGET <tgt> PROPERTY CXX_STANDARD 14)

This makes that when gcc is used cmake adds -std=gnu++14 .

How can I make it set -std=c++14 instead?


Background: my problem is the complex literal 'i' . 

This literal existed in gcc as a C99 extension and the effect is kept
when -std=gnu++14 is set and deactivated when -std=c++14 is set.

The outcome is that '0.0i' is typed as '__complex__ double' and not
'std::complex<double>' as the standard says.

regards.
--
Patrick.





More information about the CMake mailing list