[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
diff --git a/cross-project-tests/lit.cfg.py b/cross-project-tests/lit.cfg.py
index 2df478d..9af7361 100644
--- a/cross-project-tests/lit.cfg.py
+++ b/cross-project-tests/lit.cfg.py
@@ -71,7 +71,8 @@
 # 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))