[Lldb-commits] [lldb] 389955c - [lldb] add check for libcxx runtime
Shoaib Meenai via lldb-commits
lldb-commits at lists.llvm.org
Mon Feb 22 17:55:38 PST 2021
Author: Richard Howell
Date: 2021-02-22T17:53:54-08:00
New Revision: 389955c69a3b9f418e3f39694c94b4519322dd42
URL: https://github.com/llvm/llvm-project/commit/389955c69a3b9f418e3f39694c94b4519322dd42
DIFF: https://github.com/llvm/llvm-project/commit/389955c69a3b9f418e3f39694c94b4519322dd42.diff
LOG: [lldb] add check for libcxx runtime
When enabling LLDB tests with `LLVM_ENABLE_RUNTIMES=libcxx` CMake will
fail with:
```
LLDB test suite requires libc++, but it is currently disabled.
```
The issue is that the targets in LLVM_ENABLE_RUNTIMES are configured
after the targets in LLVM_ENABLE_PROJECTS, so at this point the check
for the `cxx` target will fail. CMake will add a dependency for a target
that does not exist yet however, so by first checking for `libcxx` in
LLVM_ENABLE_RUNTIMES we ensure that the `cxx` target will be present at
build time.
Tested with:
```
% cmake -G Ninja \
-C ~/local/llvm-project/lldb/cmake/caches/Apple-lldb-macOS.cmake \
-DLLVM_ENABLE_PROJECTS="clang;lldb" -DLLVM_ENABLE_RUNTIMES="libcxx" \
-DLIBCXX_INCLUDE_TESTS=NO ~/local/llvm-project/llvm
% ninja check-lldb
```
Reviewed By: smeenai, JDevlieghere
Differential Revision: https://reviews.llvm.org/D97227
Added:
Modified:
lldb/test/CMakeLists.txt
Removed:
################################################################################
diff --git a/lldb/test/CMakeLists.txt b/lldb/test/CMakeLists.txt
index 79fa05f2df29..34fc377e0e20 100644
--- a/lldb/test/CMakeLists.txt
+++ b/lldb/test/CMakeLists.txt
@@ -106,7 +106,7 @@ if(TARGET clang)
else()
# We require libcxx for the test suite, so if we aren't building it,
# try to provide a helpful error about how to resolve the situation.
- if(NOT TARGET cxx)
+ if(NOT TARGET cxx AND NOT libcxx IN_LIST LLVM_ENABLE_RUNTIMES)
if(LLVM_ENABLE_PROJECTS STREQUAL "")
# If `LLVM_ENABLE_PROJECTS` is not being used (implying that we are
# using the old layout), suggest checking it out.
@@ -118,8 +118,9 @@ if(TARGET clang)
# If `LLVM_ENABLE_PROJECTS` is being used, suggest adding it.
message(FATAL_ERROR
"LLDB test suite requires libc++, but it is currently disabled. "
- "Please add `libcxx` to `LLVM_ENABLE_PROJECTS` or disable tests "
- "via `LLDB_INCLUDE_TESTS=OFF`.")
+ "Please add `libcxx` to `LLVM_ENABLE_PROJECTS` or "
+ "`LLVM_ENABLE_RUNTIMES`, or disable tests via "
+ "`LLDB_INCLUDE_TESTS=OFF`.")
endif()
endif()
add_lldb_test_dependency(cxx)
More information about the lldb-commits
mailing list