[compiler-rt] b6876dd - [CMake][profile] Don't use `TARGET lld` to avoid ordering issues
Petr Hosek via llvm-commits
llvm-commits at lists.llvm.org
Mon Feb 22 23:33:29 PST 2021
Author: Petr Hosek
Date: 2021-02-22T23:33:21-08:00
New Revision: b6876ddc82323ba1527acfd5004be39d594652ff
URL: https://github.com/llvm/llvm-project/commit/b6876ddc82323ba1527acfd5004be39d594652ff
DIFF: https://github.com/llvm/llvm-project/commit/b6876ddc82323ba1527acfd5004be39d594652ff.diff
LOG: [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
Added:
Modified:
compiler-rt/test/profile/CMakeLists.txt
Removed:
################################################################################
diff --git a/compiler-rt/test/profile/CMakeLists.txt b/compiler-rt/test/profile/CMakeLists.txt
index 446e850a3bc1..51895f224b78 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()
More information about the llvm-commits
mailing list