diff options
author | James Henderson <james.henderson@sony.com> | 2021-02-09 18:19:27 +0300 |
---|---|---|
committer | James Henderson <james.henderson@sony.com> | 2021-06-28 13:31:40 +0300 |
commit | 3827600ff3f78b788b910ea1ebc6f86b132b6048 (patch) | |
tree | 698c7d23d8f11b9f6ee31d74e1b39f7d2294b03a /cross-project-tests | |
parent | 4446a72ad2dc2c268015dea4c649fcf4bca7f619 (diff) |
[cross-project-tests] Make clang optional if not in LLVM_ENABLE_PROJECTS
Also mark debuginfo_tests as UNSUPPORTED if clang can't be found and
remove it from the list of test dependencies if not in
LLVM_ENABLE_PROJECTS.
Differential Revision: https://reviews.llvm.org/D96511
Reviewed by: aprantl
Diffstat (limited to 'cross-project-tests')
-rw-r--r-- | cross-project-tests/CMakeLists.txt | 5 | ||||
-rw-r--r-- | cross-project-tests/debuginfo-tests/lit.local.cfg | 2 | ||||
-rw-r--r-- | cross-project-tests/lit.cfg.py | 3 |
3 files changed, 8 insertions, 2 deletions
diff --git a/cross-project-tests/CMakeLists.txt b/cross-project-tests/CMakeLists.txt index 57bcc769cd6c..a4ae34d70227 100644 --- a/cross-project-tests/CMakeLists.txt +++ b/cross-project-tests/CMakeLists.txt @@ -15,7 +15,6 @@ set(CROSS_PROJECT_TESTS_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}) set(CROSS_PROJECT_TESTS_BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}) set(CROSS_PROJECT_TEST_DEPS - clang FileCheck count llvm-config @@ -24,6 +23,10 @@ set(CROSS_PROJECT_TEST_DEPS not ) +if ("clang" IN_LIST LLVM_ENABLE_PROJECTS) + list(APPEND CROSS_PROJECT_TEST_DEPS clang) +endif() + if ("mlir" IN_LIST LLVM_ENABLE_PROJECTS) add_llvm_executable(check-gdb-mlir-support debuginfo-tests/llvm-prettyprinters/gdb/mlir-support.cpp diff --git a/cross-project-tests/debuginfo-tests/lit.local.cfg b/cross-project-tests/debuginfo-tests/lit.local.cfg new file mode 100644 index 000000000000..62f90a181d63 --- /dev/null +++ b/cross-project-tests/debuginfo-tests/lit.local.cfg @@ -0,0 +1,2 @@ +if 'clang' not in config.available_features: + config.unsupported = True diff --git a/cross-project-tests/lit.cfg.py b/cross-project-tests/lit.cfg.py index 2df478d29bf8..9af7361a6633 100644 --- a/cross-project-tests/lit.cfg.py +++ b/cross-project-tests/lit.cfg.py @@ -71,7 +71,8 @@ if is_msvc: # use_clang() and use_lld() respectively, so set them to "", if needed. if not hasattr(config, 'clang_src_dir'): config.clang_src_dir = "" -llvm_config.use_clang() +llvm_config.use_clang(required=('clang' in config.llvm_enabled_projects)) + if not hasattr(config, 'lld_src_dir'): config.lld_src_dir = "" llvm_config.use_lld(required=('lld' in config.llvm_enabled_projects)) |