[cmake-developers] These two generator expressions should be equivalent, but one working while the other not working. Bug?

Brad King brad.king at kitware.com
Thu Oct 24 08:08:40 EDT 2019


On 10/24/19 12:18 AM, Alan W. Irwin wrote:
>      $<D_COMPILER_ID:GNU>
> 
>    Expression did not evaluate to a known generator expression

The `*_COMPILER_ID` generator expressions are a hard-coded set
corresponding to the languages supported by upstream CMake:

* C_COMPILER_ID
* CXX_COMPILER_ID
* CUDA_COMPILER_ID
* Fortran_COMPILER_ID
* OBJC_COMPILER_ID   (new in 3.16)
* OBJCXX_COMPILER_ID (new in 3.16)

This is because the language name is part of the expression name.

In the `$<COMPILE_LANG_AND_ID:D,GNU>` case, the language name
is one of the parameters.

-Brad


More information about the cmake-developers mailing list