Skip to content

Commit 3827600

Browse files
committed
[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
1 parent 4446a72 commit 3827600

File tree

3 files changed

+8
-2
lines changed

3 files changed

+8
-2
lines changed

cross-project-tests/CMakeLists.txt

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ set(CROSS_PROJECT_TESTS_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR})
1515
set(CROSS_PROJECT_TESTS_BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR})
1616

1717
set(CROSS_PROJECT_TEST_DEPS
18-
clang
1918
FileCheck
2019
count
2120
llvm-config
@@ -24,6 +23,10 @@ set(CROSS_PROJECT_TEST_DEPS
2423
not
2524
)
2625

26+
if ("clang" IN_LIST LLVM_ENABLE_PROJECTS)
27+
list(APPEND CROSS_PROJECT_TEST_DEPS clang)
28+
endif()
29+
2730
if ("mlir" IN_LIST LLVM_ENABLE_PROJECTS)
2831
add_llvm_executable(check-gdb-mlir-support
2932
debuginfo-tests/llvm-prettyprinters/gdb/mlir-support.cpp
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
if 'clang' not in config.available_features:
2+
config.unsupported = True

cross-project-tests/lit.cfg.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,8 @@ def get_required_attr(config, attr_name):
7171
# use_clang() and use_lld() respectively, so set them to "", if needed.
7272
if not hasattr(config, 'clang_src_dir'):
7373
config.clang_src_dir = ""
74-
llvm_config.use_clang()
74+
llvm_config.use_clang(required=('clang' in config.llvm_enabled_projects))
75+
7576
if not hasattr(config, 'lld_src_dir'):
7677
config.lld_src_dir = ""
7778
llvm_config.use_lld(required=('lld' in config.llvm_enabled_projects))

0 commit comments

Comments
 (0)