[cmake-developers] Portable STD_CXX11 target property?

Brad King brad.king at kitware.com
Mon Jun 25 15:07:57 EDT 2012


On 6/25/2012 9:15 AM, Stephen Kelly wrote:
> Given that std::list in libstdc++ is not binary compatible between C++98 and 
> C++11, I'm wondering if we can have a STD_CXX11 property to set whether 
> C++11 should be used. Equivalent STD_CXX98 could also be provided perhaps.
> 
> http://thread.gmane.org/gmane.comp.lib.qt.devel/3484/focus=4691

A useful link from that thread:

http://gcc.gnu.org/wiki/Cxx11AbiCompatibility

> I have pushed a std-cxx-target-property branch to my gitorious repo to 
> illustrate the idea further, but I don't think there is any way to specify 
> which c++ standard to restrict to with MSVC, so the idea may already be 
> useless or dead in the water.

I'm not sure how to handle compilers that do not have
an option for this.  Error?  What if a future version
of the compiler were to add an option, and a future
version of CMake were to add support for the option?
Then existing projects would build differently with
a newer CMake.

-Brad



More information about the cmake-developers mailing list