From b6876ddc82323ba1527acfd5004be39d594652ff Mon Sep 17 00:00:00 2001 From: Petr Hosek Date: Mon, 22 Feb 2021 22:19:55 -0800 Subject: [PATCH] [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 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/compiler-rt/test/profile/CMakeLists.txt b/compiler-rt/test/profile/CMakeLists.txt index 446e850..51895f2 100644 --- a/compiler-rt/test/profile/CMakeLists.txt +++ b/compiler-rt/test/profile/CMakeLists.txt @@ -5,7 +5,7 @@ set(PROFILE_TESTSUITES) set(PROFILE_TEST_DEPS ${SANITIZER_COMMON_LIT_TEST_DEPS}) if(NOT COMPILER_RT_STANDALONE_BUILD) list(APPEND PROFILE_TEST_DEPS profile llvm-profdata llvm-cov) - if(NOT APPLE AND COMPILER_RT_HAS_LLD AND TARGET lld) + if(NOT APPLE AND COMPILER_RT_HAS_LLD AND "lld" IN_LIST LLVM_ENABLE_PROJECTS) list(APPEND PROFILE_TEST_DEPS lld) endif() endif() -- 2.7.4