genex: constant-fold optimization pass
The following discussion from !8118 (closed) should be addressed:
-
@ben.boeckel started a discussion: (+1 comment) Ideally we would drop any
$<LINK_ONLY>
instances here since$<COMPILE_ONLY:$<LINK_ONLY:…>>
is the empty string.
Some constant folding would be nice to do on generator expressions. For example, $<BOOL:${var}>
is genex-constant and can be optimized down. Additionally, COMPILE_ONLY
and LINK_ONLY
are mutually exclusive and the inner instance is empty when within each other.