Open DziubanMaciej opened 10 months ago
My first thought was to add a new CMake pass, just to process LINK_LIBRARIES
and INTERFACE_LINK_LIBRARIES
. In the main pass we'd dump unevaluated properties, process them in C++ (resolve problematic genexes) and then feed them back to CMake for a second pass to evaluate rest of the properties.
This is ok, for LINK_LIBRARIES
, but to resolve INTERFACE_LINK_LIBRARIES
, we need to know the dependencies, which we won't have at this point... Another pass? Some magical field in CmagTarget
? This is hard...
There are some generator expressions, which are evaluated differently based on the target they are bound to.
$<LINK_LANGUAGES:languages>
(required for https://github.com/DziubanMaciej/cmag/issues/40)$<LINK_LANGUAGE>
$<LINK_LANG_AND_ID:language,compiler_ids>
$<COMPILE_LANGUAGE:languages>
$<COMPILE_LANGUAGE>
$<COMPILE_LANG_AND_ID:language,compiler_ids>
First problem: they cannot be be evaluated with
$<TARGET_GENEX_EVAL>
. Not sure why, because it technically has all the context required, but it just doesn't work. We cannot know in advance that a property will contain one of these genexes and remove it in the postamble.Second problem: these properties will evaluate to different values when used in
INTERFACE_LINK_LIBRARIES
. Resulting value will depend on the language of target using this interface. We'll probably have to walk through all dependencies to resolve that properly.Third problem (extension of the second): can it be transitive?