Parser does not catch Generator Expression Error

When using the following expression:
if i am missing the final >, cmake generator does not catch this error. This results in weird linker errors in the build phase.

I haven’t checked the code, but what I expect is happening is that all the inner generator expressions are being correctly identified and expanded, but when the outermost one is missing the final >, CMake doesn’t see a generator expression after expanding all the inner ones and so it just treats that outermost one as an ordinary string (I think it’s logic is to only treat something as a generator expression if it is indeed a generator expression, but if you omit the >, then it isn’t one and so it has to be treated as a plain string).

One could potentially mount an argument that a warning could be issued if the value starts with $< and doesn’t end with >. It might be less clear-cut if an unmatched $< appears somewhere other than at the start of the value.

You are spot on. It does treat the outermost as a string. A warning would be be very helpful instead of getting lost in a bizarre linker message (in my case).