[llvm] c7054d9 - [gn] port 584af2f89e95 (clang-tidy custom)

Nico Weber via llvm-commits llvm-commits at lists.llvm.org
Fri Sep 19 07:38:55 PDT 2025


Author: Nico Weber
Date: 2025-09-19T10:38:46-04:00
New Revision: c7054d92442e5e1dae26c1e652761c147b537ec4

URL: https://github.com/llvm/llvm-project/commit/c7054d92442e5e1dae26c1e652761c147b537ec4
DIFF: https://github.com/llvm/llvm-project/commit/c7054d92442e5e1dae26c1e652761c147b537ec4.diff

LOG: [gn] port 584af2f89e95 (clang-tidy custom)

Added: 
    llvm/utils/gn/secondary/clang-tools-extra/clang-tidy/custom/BUILD.gn

Modified: 
    llvm/utils/gn/secondary/clang-tools-extra/clang-tidy/BUILD.gn

Removed: 
    


################################################################################
diff  --git a/llvm/utils/gn/secondary/clang-tools-extra/clang-tidy/BUILD.gn b/llvm/utils/gn/secondary/clang-tools-extra/clang-tidy/BUILD.gn
index cd987b6d87ed2..16065377ec919 100644
--- a/llvm/utils/gn/secondary/clang-tools-extra/clang-tidy/BUILD.gn
+++ b/llvm/utils/gn/secondary/clang-tools-extra/clang-tidy/BUILD.gn
@@ -18,6 +18,10 @@ write_cmake_config("clang-tidy-config") {
     values += [ "CLANG_TIDY_ENABLE_STATIC_ANALYZER=" ]
   }
 
+  # FIXME: Add a setting? Tests seem to fail when it's not set though:
+  # https://github.com/llvm/llvm-project/pull/131804#issuecomment-3312465207
+  values += [ "CLANG_TIDY_ENABLE_QUERY_BASED_CUSTOM_CHECKS=1" ]
+
   # Let targets depending on this find the generated file.
   public_configs = [ ":clang-tidy-config_Config" ]
 }
@@ -73,6 +77,7 @@ group("all-checks") {
     "//clang-tools-extra/clang-tidy/cert",
     "//clang-tools-extra/clang-tidy/concurrency",
     "//clang-tools-extra/clang-tidy/cppcoreguidelines",
+    "//clang-tools-extra/clang-tidy/custom",
     "//clang-tools-extra/clang-tidy/darwin",
     "//clang-tools-extra/clang-tidy/fuchsia",
     "//clang-tools-extra/clang-tidy/google",

diff  --git a/llvm/utils/gn/secondary/clang-tools-extra/clang-tidy/custom/BUILD.gn b/llvm/utils/gn/secondary/clang-tools-extra/clang-tidy/custom/BUILD.gn
new file mode 100644
index 0000000000000..9abc61d2b5b9d
--- /dev/null
+++ b/llvm/utils/gn/secondary/clang-tools-extra/clang-tidy/custom/BUILD.gn
@@ -0,0 +1,14 @@
+static_library("custom") {
+  output_name = "clangTidyCustomModule"
+  configs += [ "//llvm/utils/gn/build:clang_code" ]
+  deps = [
+    "//clang-tools-extra/clang-query",
+    "//clang-tools-extra/clang-tidy",
+    "//clang-tools-extra/clang-tidy/utils",
+    "//llvm/lib/Support",
+  ]
+  sources = [
+    "CustomTidyModule.cpp",
+    "QueryCheck.cpp",
+  ]
+}


        


More information about the llvm-commits mailing list