Skip to content

Commit 63aaecd

Browse files
committed
[lldb/CMake] Make check-lldb-* work for the standalone build.
In order to run check-lldb-* we need the correct map_config directives in llvm-lit. For the standalone build, LLVM doesn't know about LLDB, and the lldb mappings are missing. In that case we build our own llvm-lit, and tell LLVM to use the llvm-lit in the lldb build directory. Differential revision: https://reviews.llvm.org/D76945
1 parent a87ca9e commit 63aaecd

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

lldb/test/CMakeLists.txt

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,16 @@
11
# Test runner infrastructure for LLDB. This configures the LLDB test trees
22
# for use by Lit, and delegates to LLVM's lit test handlers.
33

4+
if(LLDB_BUILT_STANDALONE)
5+
# In order to run check-lldb-* we need the correct map_config directives in
6+
# llvm-lit. Because this is a standalone build, LLVM doesn't know about LLDB,
7+
# and the lldb mappings are missing. We build our own llvm-lit, and tell LLVM
8+
# to use the llvm-lit in the lldb build directory.
9+
if (EXISTS ${LLVM_MAIN_SRC_DIR}/utils/llvm-lit)
10+
set(LLVM_EXTERNAL_LIT ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/llvm-lit)
11+
endif()
12+
endif()
13+
414
# Configure the build directory.
515
set(LLDB_TEST_BUILD_DIRECTORY "${PROJECT_BINARY_DIR}/lldb-test-build.noindex" CACHE PATH "The build root for building tests.")
616

@@ -180,3 +190,10 @@ add_custom_target(check-lldb)
180190
add_dependencies(check-lldb lldb-test-deps)
181191
set_target_properties(check-lldb PROPERTIES FOLDER "lldb misc")
182192
add_dependencies(check-lldb check-lldb-lit)
193+
194+
if(LLDB_BUILT_STANDALONE)
195+
# This has to happen *AFTER* add_lit_testsuite.
196+
if (EXISTS ${LLVM_MAIN_SRC_DIR}/utils/llvm-lit)
197+
add_subdirectory(${LLVM_MAIN_SRC_DIR}/utils/llvm-lit ${CMAKE_CURRENT_BINARY_DIR}/llvm-lit)
198+
endif()
199+
endif()

0 commit comments

Comments
 (0)