diff --git a/cross-project-tests/CMakeLists.txt b/cross-project-tests/CMakeLists.txt --- a/cross-project-tests/CMakeLists.txt +++ b/cross-project-tests/CMakeLists.txt @@ -15,7 +15,6 @@ set(CROSS_PROJECT_TESTS_BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}) set(CROSS_PROJECT_TEST_DEPS - clang FileCheck count llvm-config @@ -24,6 +23,10 @@ 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 --- /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 --- a/cross-project-tests/lit.cfg.py +++ b/cross-project-tests/lit.cfg.py @@ -71,7 +71,12 @@ # 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 llvm_config.config.clang: + llvm_config.with_environment('PATHTOCLANG', llvm_config.config.clang) + llvm_config.with_environment('PATHTOCLANGPP', llvm_config.use_llvm_tool('clang++')) + llvm_config.with_environment('PATHTOCLANGCL', llvm_config.use_llvm_tool('clang-cl')) + if 'lld' in config.llvm_enabled_projects: if not hasattr(config, 'lld_src_dir'): config.lld_src_dir = "" @@ -81,9 +86,6 @@ # Propagate path to symbolizer for ASan/MSan. llvm_config.with_system_environment( ['ASAN_SYMBOLIZER_PATH', 'MSAN_SYMBOLIZER_PATH']) -llvm_config.with_environment('PATHTOCLANG', llvm_config.config.clang) -llvm_config.with_environment('PATHTOCLANGPP', llvm_config.use_llvm_tool('clang++')) -llvm_config.with_environment('PATHTOCLANGCL', llvm_config.use_llvm_tool('clang-cl')) # Check which debuggers are available: built_lldb = llvm_config.use_llvm_tool('lldb', search_env='CLANG')