Skip to content

[lldb][cmake] Add clang resource dir to LLDB shell tests config (#136… #10601

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions lldb/cmake/modules/LLDBConfig.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,17 @@ if(LLDB_ENABLE_SWIFT_SUPPORT)
endif()
endif()

if(LLDB_BUILT_STANDALONE)
if (TARGET clang-resource-headers)
get_target_property(CLANG_RESOURCE_DIR clang-resource-headers INTERFACE_INCLUDE_DIRECTORIES)
set(CLANG_RESOURCE_DIR "${CLANG_RESOURCE_DIR}/..")
else()
set(CLANG_RESOURCE_DIR "${LLDB_EXTERNAL_CLANG_RESOURCE_DIR}")
endif()
else()
get_clang_resource_dir(CLANG_RESOURCE_DIR PREFIX "${CMAKE_BINARY_DIR}")
endif()

# GCC silently accepts any -Wno-<foo> option, but warns about those options
# being unrecognized only if the compilation triggers other warnings to be
# printed. Therefore, check for whether the compiler supports options in the
Expand Down
1 change: 1 addition & 0 deletions lldb/test/Shell/lit.site.cfg.py.in
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,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)
Expand Down