summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIgor Kudrin <ikudrin@accesssoftek.com>2024-05-02 01:55:18 +0700
committerGitHub <noreply@github.com>2024-05-02 01:55:18 +0700
commitf0fbccb15384393a2ede3328517c1050e9f468ae (patch)
tree3b5d72d59b3730820522cc0b25d8123bc4f73b37
parent6d44a1ef55b559e59d725b07ffe1da988b4e5f1c (diff)
[clang-tidy] Enable plugin tests with LLVM_INSTALL_TOOLCHAIN_ONLY (#90370)
The only reason for the removed condition was that there was a dependency for `CTTestTidyModule` on the `clang-tidy-headers` target, which was only created under the same `NOT LLVM_INSTALL_TOOLCHAIN_ONLY` condition. It looks like this target is not needed for `CTTestTidyModule` to build and run, so the dependency can be removed along with the condition. See also https://reviews.llvm.org/D111100 for earlier discussions.
-rw-r--r--clang-tools-extra/test/CMakeLists.txt45
-rw-r--r--clang-tools-extra/test/lit.site.cfg.py.in2
2 files changed, 22 insertions, 25 deletions
diff --git a/clang-tools-extra/test/CMakeLists.txt b/clang-tools-extra/test/CMakeLists.txt
index f4c529ee8af2..7a1c168e22f9 100644
--- a/clang-tools-extra/test/CMakeLists.txt
+++ b/clang-tools-extra/test/CMakeLists.txt
@@ -67,33 +67,30 @@ foreach(dep ${LLVM_UTILS_DEPS})
endif()
endforeach()
-if (NOT LLVM_INSTALL_TOOLCHAIN_ONLY)
- if (NOT WIN32 OR NOT LLVM_LINK_LLVM_DYLIB)
- llvm_add_library(
- CTTestTidyModule
- MODULE clang-tidy/CTTestTidyModule.cpp
- PLUGIN_TOOL clang-tidy
- DEPENDS clang-tidy-headers)
- endif()
+if (NOT WIN32 OR NOT LLVM_LINK_LLVM_DYLIB)
+ llvm_add_library(
+ CTTestTidyModule
+ MODULE clang-tidy/CTTestTidyModule.cpp
+ PLUGIN_TOOL clang-tidy)
+endif()
- if(CLANG_BUILT_STANDALONE)
- # LLVMHello library is needed below
- if (EXISTS ${LLVM_MAIN_SRC_DIR}/lib/Transforms/Hello
- AND NOT TARGET LLVMHello)
- add_subdirectory(${LLVM_MAIN_SRC_DIR}/lib/Transforms/Hello
- lib/Transforms/Hello)
- endif()
+if(CLANG_BUILT_STANDALONE)
+ # LLVMHello library is needed below
+ if (EXISTS ${LLVM_MAIN_SRC_DIR}/lib/Transforms/Hello
+ AND NOT TARGET LLVMHello)
+ add_subdirectory(${LLVM_MAIN_SRC_DIR}/lib/Transforms/Hello
+ lib/Transforms/Hello)
endif()
+endif()
- if(TARGET CTTestTidyModule)
- list(APPEND CLANG_TOOLS_TEST_DEPS CTTestTidyModule LLVMHello)
- target_include_directories(CTTestTidyModule PUBLIC BEFORE "${CLANG_TOOLS_SOURCE_DIR}")
- if(CLANG_PLUGIN_SUPPORT AND (WIN32 OR CYGWIN))
- set(LLVM_LINK_COMPONENTS
- Support
- )
- endif()
- endif()
+if(TARGET CTTestTidyModule)
+ list(APPEND CLANG_TOOLS_TEST_DEPS CTTestTidyModule LLVMHello)
+ target_include_directories(CTTestTidyModule PUBLIC BEFORE "${CLANG_TOOLS_SOURCE_DIR}")
+ if(CLANG_PLUGIN_SUPPORT AND (WIN32 OR CYGWIN))
+ set(LLVM_LINK_COMPONENTS
+ Support
+ )
+ endif()
endif()
add_lit_testsuite(check-clang-extra "Running clang-tools-extra/test"
diff --git a/clang-tools-extra/test/lit.site.cfg.py.in b/clang-tools-extra/test/lit.site.cfg.py.in
index 4eb830a1baf1..e6503a4c097c 100644
--- a/clang-tools-extra/test/lit.site.cfg.py.in
+++ b/clang-tools-extra/test/lit.site.cfg.py.in
@@ -10,7 +10,7 @@ config.python_executable = "@Python3_EXECUTABLE@"
config.target_triple = "@LLVM_TARGET_TRIPLE@"
config.host_triple = "@LLVM_HOST_TRIPLE@"
config.clang_tidy_staticanalyzer = @CLANG_TIDY_ENABLE_STATIC_ANALYZER@
-config.has_plugins = @CLANG_PLUGIN_SUPPORT@ & ~@LLVM_INSTALL_TOOLCHAIN_ONLY@
+config.has_plugins = @CLANG_PLUGIN_SUPPORT@
# 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.
config.llvm_tools_dir = lit_config.substitute("@LLVM_TOOLS_DIR@")