https://github.com/chelcassanova updated 
https://github.com/llvm/llvm-project/pull/136761

>From d5760f9eb92ef65c853148f8fd39a2ed5d052fdf Mon Sep 17 00:00:00 2001
From: Chelsea Cassanova <chelsea_cassan...@apple.com>
Date: Tue, 22 Apr 2025 13:28:04 -0700
Subject: [PATCH] [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
---
 lldb/test/Shell/CMakeLists.txt     | 2 ++
 lldb/test/Shell/lit.site.cfg.py.in | 1 +
 2 files changed, 3 insertions(+)

diff --git a/lldb/test/Shell/CMakeLists.txt b/lldb/test/Shell/CMakeLists.txt
index 97323ff6fbc31..01c9c0962f284 100644
--- a/lldb/test/Shell/CMakeLists.txt
+++ b/lldb/test/Shell/CMakeLists.txt
@@ -1,6 +1,8 @@
 add_custom_target(lldb-shell-test-deps)
 set_target_properties(lldb-shell-test-deps PROPERTIES FOLDER "LLDB/Tests")
 add_dependencies(lldb-shell-test-deps lldb-test-depends)
+get_target_property(clang_resource_headers_dir clang-resource-headers 
INTERFACE_INCLUDE_DIRECTORIES)
+set(CLANG_RESOURCE_DIR ${clang_resource_headers_dir})
 
 add_lit_testsuites(LLDB-SHELL
   ${CMAKE_CURRENT_SOURCE_DIR}
diff --git a/lldb/test/Shell/lit.site.cfg.py.in 
b/lldb/test/Shell/lit.site.cfg.py.in
index 31a6d68618b77..7e03938b12b23 100644
--- a/lldb/test/Shell/lit.site.cfg.py.in
+++ b/lldb/test/Shell/lit.site.cfg.py.in
@@ -35,6 +35,7 @@ config.llvm_use_sanitizer = "@LLVM_USE_SANITIZER@"
 # The shell tests use their own module caches.
 config.lldb_module_cache = os.path.join("@LLDB_TEST_MODULE_CACHE_LLDB@", 
"lldb-shell")
 config.clang_module_cache = os.path.join("@LLDB_TEST_MODULE_CACHE_CLANG@", 
"lldb-shell")
+config.clang_resource_dir = os.path.join("@CLANG_RESOURCE_DIR@")
 
 import lit.llvm
 lit.llvm.initialize(lit_config, config)

_______________________________________________
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

Reply via email to