Skip to content

Commit c7054d9

Browse files
committed
[gn] port 584af2f (clang-tidy custom)
1 parent cd0f191 commit c7054d9

File tree

2 files changed

+19
-0
lines changed

2 files changed

+19
-0
lines changed

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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,10 @@ write_cmake_config("clang-tidy-config") {
1818
values += [ "CLANG_TIDY_ENABLE_STATIC_ANALYZER=" ]
1919
}
2020

21+
# FIXME: Add a setting? Tests seem to fail when it's not set though:
22+
# https://github.com/llvm/llvm-project/pull/131804#issuecomment-3312465207
23+
values += [ "CLANG_TIDY_ENABLE_QUERY_BASED_CUSTOM_CHECKS=1" ]
24+
2125
# Let targets depending on this find the generated file.
2226
public_configs = [ ":clang-tidy-config_Config" ]
2327
}
@@ -73,6 +77,7 @@ group("all-checks") {
7377
"//clang-tools-extra/clang-tidy/cert",
7478
"//clang-tools-extra/clang-tidy/concurrency",
7579
"//clang-tools-extra/clang-tidy/cppcoreguidelines",
80+
"//clang-tools-extra/clang-tidy/custom",
7681
"//clang-tools-extra/clang-tidy/darwin",
7782
"//clang-tools-extra/clang-tidy/fuchsia",
7883
"//clang-tools-extra/clang-tidy/google",
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
static_library("custom") {
2+
output_name = "clangTidyCustomModule"
3+
configs += [ "//llvm/utils/gn/build:clang_code" ]
4+
deps = [
5+
"//clang-tools-extra/clang-query",
6+
"//clang-tools-extra/clang-tidy",
7+
"//clang-tools-extra/clang-tidy/utils",
8+
"//llvm/lib/Support",
9+
]
10+
sources = [
11+
"CustomTidyModule.cpp",
12+
"QueryCheck.cpp",
13+
]
14+
}

0 commit comments

Comments
 (0)