[clang-tools-extra] [clang-tidy] support query based custom check (PR #131804)

Aaron Ballman via cfe-commits cfe-commits at lists.llvm.org
Thu Mar 20 07:03:24 PDT 2025


================
@@ -0,0 +1,20 @@
+set(LLVM_LINK_COMPONENTS
+  support
+  )
+
+add_clang_library(clangTidyCustomModule STATIC
+  CustomTidyModule.cpp
+  QueryCheck.cpp
+
+  LINK_LIBS
+  clangTidy
+  clangTidyUtils
+
+  DEPENDS
+  ClangDriverOptions
+  )
+
+clang_target_link_libraries(clangTidyCustomModule
+  PRIVATE
+  clangQuery
----------------
AaronBallman wrote:

I think the suggestion from @PiotrZSL is a reasonable compromise.

I'm presuming it's not an issue that the `clangQuery` library links against a bunch of clang libraries that clang-tidy already links against, but it would be good to double-check that we're not accidentally getting two copies of those libraries in a static link build.

https://github.com/llvm/llvm-project/pull/131804


More information about the cfe-commits mailing list