diff --git a/clang-tools-extra/test/CMakeLists.txt b/clang-tools-extra/test/CMakeLists.txt --- a/clang-tools-extra/test/CMakeLists.txt +++ b/clang-tools-extra/test/CMakeLists.txt @@ -15,10 +15,15 @@ string(REPLACE ${CMAKE_CFG_INTDIR} ${LLVM_BUILD_MODE} CLANG_TOOLS_DIR ${LLVM_RUNTIME_OUTPUT_INTDIR}) +if (TARGET LLVMHello) + set (LLVM_HAS_LLVM_HELLO 1) +endif() + llvm_canonicalize_cmake_booleans( CLANG_TIDY_ENABLE_STATIC_ANALYZER CLANG_PLUGIN_SUPPORT LLVM_INSTALL_TOOLCHAIN_ONLY + LLVM_HAS_LLVM_HELLO ) configure_lit_site_cfg( @@ -97,7 +102,10 @@ endif() if(TARGET CTTestTidyModule) - list(APPEND CLANG_TOOLS_TEST_DEPS CTTestTidyModule LLVMHello) + list(APPEND CLANG_TOOLS_TEST_DEPS CTTestTidyModule) + if (TARGET LLVMHello) + list(APPEND CLANG_TOOLS_TEST_DEPS CTTestTidyModule) + endif() target_include_directories(CTTestTidyModule PUBLIC BEFORE "${CLANG_TOOLS_SOURCE_DIR}") if(CLANG_PLUGIN_SUPPORT AND (WIN32 OR CYGWIN)) set(LLVM_LINK_COMPONENTS diff --git a/clang-tools-extra/test/clang-tidy/CTTestTidyModule.cpp b/clang-tools-extra/test/clang-tidy/CTTestTidyModule.cpp --- a/clang-tools-extra/test/clang-tidy/CTTestTidyModule.cpp +++ b/clang-tools-extra/test/clang-tidy/CTTestTidyModule.cpp @@ -1,4 +1,4 @@ -// REQUIRES: plugins +// REQUIRES: plugins, llvm-hello // RUN: clang-tidy -checks='-*,mytest*' --list-checks -load %llvmshlibdir/CTTestTidyModule%pluginext -load %llvmshlibdir/LLVMHello%pluginext | FileCheck --check-prefix=CHECK-LIST %s // CHECK-LIST: Enabled checks: // CHECK-LIST-NEXT: mytest1 diff --git a/clang-tools-extra/test/lit.cfg.py b/clang-tools-extra/test/lit.cfg.py --- a/clang-tools-extra/test/lit.cfg.py +++ b/clang-tools-extra/test/lit.cfg.py @@ -155,3 +155,6 @@ # Plugins (loadable modules) if config.has_plugins and config.llvm_plugin_ext: config.available_features.add('plugins') + +if config.has_llvm_hello: + config.available_features.add("llvm-hello") diff --git a/clang-tools-extra/test/lit.site.cfg.py.in b/clang-tools-extra/test/lit.site.cfg.py.in --- a/clang-tools-extra/test/lit.site.cfg.py.in +++ b/clang-tools-extra/test/lit.site.cfg.py.in @@ -13,6 +13,7 @@ config.target_triple = "@TARGET_TRIPLE@" config.clang_tidy_staticanalyzer = @CLANG_TIDY_ENABLE_STATIC_ANALYZER@ config.has_plugins = @CLANG_PLUGIN_SUPPORT@ & ~@LLVM_INSTALL_TOOLCHAIN_ONLY@ +config.has_llvm_hello = @LLVM_HAS_LLVM_HELLO@ # Support substitution of the tools and libs dirs with user parameters. This is # used when we can't determine the tool dir at configuration time.