[CMake][profile] Don't use `TARGET lld` to avoid ordering issues
authorPetr Hosek <phosek@google.com>
Tue, 23 Feb 2021 06:19:55 +0000 (22:19 -0800)
committerPetr Hosek <phosek@google.com>
Tue, 23 Feb 2021 07:33:21 +0000 (23:33 -0800)
commitb6876ddc82323ba1527acfd5004be39d594652ff
tree2b35de7bc66066671aab514fe7372ba51717a153
parent67e0d58de4d338add132838810db70218f1064d8
[CMake][profile] Don't use `TARGET lld` to avoid ordering issues

Depending on the order in which lld and compiler-rt projects are
processed by CMake, `TARGET lld` might evaluate to `TRUE` or `FALSE`
even though `lld-available` lit stanza is always set because lld is
being built. We check whether lld project is enabled instead which
is used by other compiler-rt tests.

The ideal solution here would be to use CMake generator expressions,
but those cannot be used for dependencies yet, see:
https://gitlab.kitware.com/cmake/cmake/-/issues/19467

Differential Revision: https://reviews.llvm.org/D97256
compiler-rt/test/profile/CMakeLists.txt