[cmake-developers] I fear $<COMPILE_FEATURES:*> is not really useful...
Brad King
brad.king at kitware.com
Tue Aug 25 11:14:12 EDT 2015
On 08/23/2015 06:32 AM, Rolf Eike Beer wrote:
> $<$<COMPILE_FEATURES:cxx_decltype_incomplete_return_types>:BOOST_RESULT_OF_USE_DECLTYPE>
[snip]
> So, in theory, this will set the definition if the compiler supports decltype,
> and just don't set it if not. And it works fine for g++. The problem is when it
> comes to MSVC:
>
> There is no MSVC version that supports this feature properly, so there is no
> variable for this compiler defined. Or just think of $FooBarC++, where noone
> cared to report the supported features. No variable either. For these
> compilers the above expression fails, because this is no recorded feature of
> the compiler. I would have expected it to just not set the definition, but not
> error out.
I haven't investigated in detail but I think this means that the internals
of the COMPILE_FEATURES generator expression need to be taught to tolerate
lack of compile features for the current toolchain to simply return 0.
-Brad
More information about the cmake-developers
mailing list