[libc++] Fix eager generator expression in DefineLinkerScript
authorLouis Dionne <ldionne@apple.com>
Fri, 31 Jul 2020 15:18:01 +0000 (11:18 -0400)
committerLouis Dionne <ldionne@apple.com>
Fri, 31 Jul 2020 15:20:19 +0000 (11:20 -0400)
commitd275da17e4f0a17615b24c352aab0d34f647bfa7
treefeafffd695df812b36381d33696192397f96eb9f
parentcfb955ac370cb724c51423a05694aaf5b70903a4
[libc++] Fix eager generator expression in DefineLinkerScript

As explained in https://gitlab.kitware.com/cmake/cmake/-/issues/21045,
both branches of an $<IF> generator expression are evaluated eagerly
by CMake. As a result, if the non-selected branch contains an invalid
generator expression (such as getting the OUTPUT_NAME property of a
non-existent target), a hard error will occur.

This failed builds using the cxxrt ABI library, which doesn't create
a CMake target currently.
libcxx/cmake/Modules/DefineLinkerScript.cmake