[cmake-developers] C++11 and target_compiler_feature proposal
Stephen Kelly
steveire at gmail.com
Tue Oct 22 11:31:39 EDT 2013
Brad King wrote:
> On 10/21/2013 04:05 PM, Stephen Kelly wrote:
>> I'm still not sure that generating a header specific to the compiler (ID
>> and version) is a good idea.
> [snip]
>> So, I think maybe it would make sense to list features separately, and if
>> someone does this:
>
> I thought we had reached that conclusion before. See the bottom of
> this message:
>
>
http://thread.gmane.org/gmane.comp.programming.tools.cmake.devel/6726/focus=7809
>
> Anyway, we agree.
Further-on, you responded:
> Why do you need to check features of a compiler not currently enabled?
>
>> write_compiler_detection_header(
>> FILE ${CMAKE_CURRENT_BINARY_DIR}/grantlee_compiler_detection.h
>> PREFIX Grantlee_
>> FEATURES cxx_final cxx_override
>> )
>
> Yes, though it still needs the mandatory VERSION.
I thought the VERSION would be optional and would default to
CMAKE_MINIMUM_REQUIRED_VERSION:
http://thread.gmane.org/gmane.comp.programming.tools.cmake.devel/6726/focus=7812
>
>> the generated header would look something like this:
>
> Yes.
>
> Actually it appears this header will duplicate most of the compiler
> feature
> knowledge encoded in the CMake platform modules we discussed before. I
> wonder if we can come up with a representation that can be used to
> generate both.
Probably. However, that means that we either shouldn't use the clang
__has_feature() test that I implemented, or we'll have to duplicate all of
that information anyway.
Thanks,
Steve.
More information about the cmake-developers
mailing list