Skip to content

Commit c7d22d4

Browse files
committed
[lldb][cmake] Populate Clang resource dir for CMakeCache
We want to be able to access the Clang resources directory in LLDB shell tests, this commit adds the ability to do this by populating the `CLANG_RESOURCE_DIR` CMake cache variable and adding it to the LLDB lit config.
1 parent 6f1adbd commit c7d22d4

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

lldb/cmake/modules/LLDBFramework.cmake

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ add_custom_command(TARGET liblldb POST_BUILD
121121
if(NOT APPLE_EMBEDDED)
122122
if (TARGET clang-resource-headers)
123123
add_dependencies(liblldb clang-resource-headers)
124-
set(clang_resource_headers_dir $<TARGET_PROPERTY:clang-resource-headers,INTERFACE_INCLUDE_DIRECTORIES>)
124+
get_target_property(clang_resource_headers_dir clang-resource-headers INTERFACE_INCLUDE_DIRECTORIES)
125125
else()
126126
set(clang_resource_headers_dir ${LLDB_EXTERNAL_CLANG_RESOURCE_DIR}/include)
127127
if(NOT EXISTS ${clang_resource_headers_dir})
@@ -135,6 +135,8 @@ if(NOT APPLE_EMBEDDED)
135135
$<TARGET_FILE_DIR:liblldb>/Resources/Clang/include
136136
COMMENT "LLDB.framework: copy clang vendor-specific headers"
137137
)
138+
139+
set(CLANG_RESOURCE_DIR ${clang_resource_headers_dir} CACHE FILEPATH "")
138140
endif()
139141

140142
# Add an rpath pointing to the directory where LLDB.framework is installed.

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)