[cmake-developers] C++11 and target_compiler_feature proposal
Stephen Kelly
steveire at gmail.com
Fri Oct 25 09:02:37 EDT 2013
Brad King wrote:
> * Using try_compile to detect feature support may be unreliable in the
> case of partially implemented features. It is better to test the current
> compiler version against that documented by the vendor to support given
> features. The test case added in the cxx11 topic already does this to
> determine expected results.
I think there is a remaining issue with features and buggy-ness.
The new VS release has broken variadic templates support:
http://thread.gmane.org/gmane.comp.lib.boost.devel/244986/focus=245333
That was worked around with a patch to boost. How do we determine if a bug
is severe enough that we should consider it not enabled for the compiler?
It also has broken initializer_lists, which leads to the same question:
http://thread.gmane.org/gmane.comp.lib.boost.devel/245202/focus=245221
For 'broken' things like cxx_initializer_lists and cxx_variadic_templates, I
recommend that we enable the feature if the compiler vendor says it is
available.
Downstreams can define
* Foo_BROKEN_VARIADIC_OVERLOADS (VS 2013)
* Foo_BROKEN_INITIALIZER_LIST_OVERLOADS (VS 2013)
if they wish in a wrapper around our generated header.
We can even list such brokenness in the CMAKE_CXX_KNOWN_FEATURES
documentation entry for it.
Comments?
Thanks,
Steve.
More information about the cmake-developers
mailing list