Skip to content

Commit a232598

Browse files
committed
Attempt to fix lldb tests for bootstrapping build
Created using spr 1.3.6-beta.1
1 parent f8044f3 commit a232598

File tree

2 files changed

+24
-11
lines changed

2 files changed

+24
-11
lines changed

lldb/test/CMakeLists.txt

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -157,15 +157,22 @@ if(TARGET clang)
157157
# TestFullLtoStepping depends on LTO, and only runs when the compiler is clang.
158158
add_lldb_test_dependency(LTO)
159159

160-
if (TARGET libcxx OR ("libcxx" IN_LIST LLVM_ENABLE_RUNTIMES))
160+
if ("libcxx" IN_LIST LLVM_ENABLE_RUNTIMES)
161161
set(LLDB_HAS_LIBCXX ON)
162+
# libc++ can only be used for tests after installing to a fake prefix
163+
# which is done by the install-cxx-test-suite-prefix target in libc++. We
164+
# ensure this is run by depending on the runtimes-test-depends target.
165+
# While this could build too many dependencies, it is currently the only
166+
# test dependencies target exposed by the runtimes build.
167+
add_lldb_test_dependency(runtimes-test-depends)
168+
set(LIBCXX_TEST_INSTALL_DIR "${CMAKE_BINARY_DIR}/runtimes/runtimes-${LLVM_DEFAULT_TARGET_TRIPLE}-bins/libcxx/test-suite-install")
162169
if(LLVM_ENABLE_PER_TARGET_RUNTIME_DIR AND NOT APPLE)
163-
set(LIBCXX_LIBRARY_DIR ${LLVM_LIBRARY_OUTPUT_INTDIR}/${LLVM_DEFAULT_TARGET_TRIPLE})
164-
set(LIBCXX_GENERATED_INCLUDE_DIR "${LLVM_BINARY_DIR}/include/c++/v1")
165-
set(LIBCXX_GENERATED_INCLUDE_TARGET_DIR "${LLVM_BINARY_DIR}/include/${LLVM_DEFAULT_TARGET_TRIPLE}/c++/v1")
170+
set(LIBCXX_LIBRARY_DIR ${LIBCXX_TEST_INSTALL_DIR}/lib/${LLVM_DEFAULT_TARGET_TRIPLE})
171+
set(LIBCXX_GENERATED_INCLUDE_DIR "${LIBCXX_TEST_INSTALL_DIR}/include/c++/v1")
172+
set(LIBCXX_GENERATED_INCLUDE_TARGET_DIR "${LIBCXX_TEST_INSTALL_DIR}/include/${LLVM_DEFAULT_TARGET_TRIPLE}/c++/v1")
166173
else()
167-
set(LIBCXX_LIBRARY_DIR ${CMAKE_BINARY_DIR}/lib${LIBCXX_LIBDIR_SUFFIX})
168-
set(LIBCXX_GENERATED_INCLUDE_DIR "${CMAKE_BINARY_DIR}/include/c++/v1")
174+
set(LIBCXX_LIBRARY_DIR ${LIBCXX_TEST_INSTALL_DIR}/lib${LIBCXX_LIBDIR_SUFFIX})
175+
set(LIBCXX_GENERATED_INCLUDE_DIR "${LIBCXX_TEST_INSTALL_DIR}/include/c++/v1")
169176
endif()
170177
endif()
171178

lldb/utils/lldb-dotest/CMakeLists.txt

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,19 @@ llvm_canonicalize_cmake_booleans(
1414

1515
if ("libcxx" IN_LIST LLVM_ENABLE_RUNTIMES)
1616
set(LLDB_HAS_LIBCXX ON)
17+
# libc++ can only be used for tests after installing to a fake prefix
18+
# which is done by the install-cxx-test-suite-prefix target in libc++. We
19+
# ensure this is run by depending on the runtimes-test-depends target.
20+
# While this could build too many dependencies, it is currently the only
21+
# test dependencies target exposed by the runtimes build.
22+
set(LIBCXX_TEST_INSTALL_DIR "${CMAKE_BINARY_DIR}/runtimes/runtimes-${LLVM_DEFAULT_TARGET_TRIPLE}-bins/libcxx/test-suite-install")
1723
if(LLVM_ENABLE_PER_TARGET_RUNTIME_DIR AND NOT APPLE)
18-
set(LIBCXX_LIBRARY_DIR ${LLVM_LIBRARY_OUTPUT_INTDIR}/${LLVM_DEFAULT_TARGET_TRIPLE})
19-
set(LIBCXX_GENERATED_INCLUDE_DIR "${LLVM_BINARY_DIR}/include/c++/v1")
20-
set(LIBCXX_GENERATED_INCLUDE_TARGET_DIR "${LLVM_BINARY_DIR}/include/${LLVM_DEFAULT_TARGET_TRIPLE}/c++/v1")
24+
set(LIBCXX_LIBRARY_DIR ${LIBCXX_TEST_INSTALL_DIR}/lib/${LLVM_DEFAULT_TARGET_TRIPLE})
25+
set(LIBCXX_GENERATED_INCLUDE_DIR "${LIBCXX_TEST_INSTALL_DIR}/include/c++/v1")
26+
set(LIBCXX_GENERATED_INCLUDE_TARGET_DIR "${LIBCXX_TEST_INSTALL_DIR}/include/${LLVM_DEFAULT_TARGET_TRIPLE}/c++/v1")
2127
else()
22-
set(LIBCXX_LIBRARY_DIR ${CMAKE_BINARY_DIR}/lib${LIBCXX_LIBDIR_SUFFIX})
23-
set(LIBCXX_GENERATED_INCLUDE_DIR "${CMAKE_BINARY_DIR}/include/c++/v1")
28+
set(LIBCXX_LIBRARY_DIR ${LIBCXX_TEST_INSTALL_DIR}/lib${LIBCXX_LIBDIR_SUFFIX})
29+
set(LIBCXX_GENERATED_INCLUDE_DIR "${LIBCXX_TEST_INSTALL_DIR}/include/c++/v1")
2430
endif()
2531
endif()
2632

0 commit comments

Comments
 (0)