Skip to content

Commit b073c45

Browse files
committed
[lldb][cmake] Add clang resource dir to LLDB shell tests config
We want to be able to access the Clang resources directory in LLDB shell tests, this commit adds the ability to do this by adding the `CLANG_RESOURCE_DIR` CMake variable to the config for LLDB lit tests
1 parent 6f1adbd commit b073c45

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

lldb/test/Shell/CMakeLists.txt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
11
add_custom_target(lldb-shell-test-deps)
22
set_target_properties(lldb-shell-test-deps PROPERTIES FOLDER "LLDB/Tests")
33
add_dependencies(lldb-shell-test-deps lldb-test-depends)
4+
if(LLDB_BUILT_STANDALONE)
5+
get_target_property(CLANG_RESOURCE_DIR clang-resource-headers INTERFACE_INCLUDE_DIRECTORIES)
6+
set(CLANG_RESOURCE_DIR "${CLANG_RESOURCE_DIR}/..")
7+
else()
8+
get_clang_resource_dir(CLANG_RESOURCE_DIR PREFIX "${CMAKE_BINARY_DIR}")
9+
endif()
410

511
add_lit_testsuites(LLDB-SHELL
612
${CMAKE_CURRENT_SOURCE_DIR}

lldb/test/Shell/lit.site.cfg.py.in

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ config.llvm_use_sanitizer = "@LLVM_USE_SANITIZER@"
3535
# The shell tests use their own module caches.
3636
config.lldb_module_cache = os.path.join("@LLDB_TEST_MODULE_CACHE_LLDB@", "lldb-shell")
3737
config.clang_module_cache = os.path.join("@LLDB_TEST_MODULE_CACHE_CLANG@", "lldb-shell")
38+
config.clang_resource_dir = os.path.join("@CLANG_RESOURCE_DIR@")
3839

3940
import lit.llvm
4041
lit.llvm.initialize(lit_config, config)

0 commit comments

Comments
 (0)