[cmake-developers] target_compile_features remaining issues

Stephen Kelly steveire at gmail.com
Sun Apr 20 03:57:18 EDT 2014


Brad King wrote:

> On 04/15/2014 11:39 AM, Stephen Kelly wrote:
>>> I think we should reverse our earlier decision and go ahead and add
>>> an error whenever a feature is requested that we do not know *is*
>>> supported for the current {id, version}.
>> 
>> Yes, I think that makes sense. Such an error can be relaxed in the future
>> if desired.
> 
> The change proposed here:
> 
>  Features: Decay language flag if requested is not available.
>  http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=93e7729d
> 
> makes the CXX_STANDARD target property specify a request to be
> decayed rather than a requirement.

Actually it makes the request decay, rather than not decay. 

That property does not communicate a requirement even before the decay- 
patch.

 http://thread.gmane.org/gmane.comp.programming.tools.cmake.devel/9812

> What if a project really wants to require a given standard level?

That request is too non-granular. What does it mean? (In terms of compiler 
versions) 

> Perhaps we can have a feature name like "cxx_std_11" to require a
> given standard level with an error if it is not available.

Which compilers would provide that feature? GCC 4.8.1 and Clang 3.4 
(complete support)? GCC 4.7 (First release after ratification. Has compile 
flag -std=c++11)? GCC 4.3 (Has -std=c++0x)? MSVC? MSVC 2015 (speculative 
full support)? MSVC 2010 (partial support)? MSVC 2008 (Has override 
keyword)?
 
> Steve, how did you envision CXX_STANDARD, CXX_EXTENSIONS, and
> COMPILE_FEATURES to be used together by a project?

COMPILE_FEATURES specify requirements. As a side-effect of processing them, 
the CXX_STANDARD and CXX_EXTENSIONS may be set. Those properties, if an 
appropriate flag is known to represent them, cause a flag to be added to the 
compile line.

 http://www.steveire.com/cmake-future/manual/cmake-compile-features.7.html

Thanks,

Steve.






More information about the cmake-developers mailing list