Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 01ee9fe

Browse files
[clang-tidy] Fix bazel build after #131804 (lazy style). (#159289)
This PR provides a quick fix for the bazel builds that got broken by #131804. That PR introduced a new CMake option that enables custom clang-tidy checks that are provided by cmake-query. This PR disables those checks, which is the minimal fix. A more proper fix would introduce a new `custom` check that is added to the tool if a particular flag value is set; however, the library depends on clang-query, which isn't part of the bazel build, yet, and I don't want to spend the time now to make all of that work as well. The discussion in the PR provides my current state in case somebody wants to pick up that work. Signed-off-by: Ingo Müller <[email protected]>
1 parent d8e1c20 commit 01ee9fe

File tree

1 file changed

+11
-8
lines changed
  • utils/bazel/llvm-project-overlay/clang-tools-extra/clang-tidy

1 file changed

+11
-8
lines changed

utils/bazel/llvm-project-overlay/clang-tools-extra/clang-tidy/BUILD.bazel

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -33,14 +33,17 @@ config_setting(
3333
expand_template(
3434
name = "config",
3535
out = "clang-tidy-config.h",
36-
substitutions = select({
37-
":static_analyzer_enabled": {
38-
"#cmakedefine01 CLANG_TIDY_ENABLE_STATIC_ANALYZER": "#define CLANG_TIDY_ENABLE_STATIC_ANALYZER 1",
39-
},
40-
"//conditions:default": {
41-
"#cmakedefine01 CLANG_TIDY_ENABLE_STATIC_ANALYZER": "#define CLANG_TIDY_ENABLE_STATIC_ANALYZER 0",
42-
},
43-
}),
36+
substitutions =
37+
{
38+
"#cmakedefine01 CLANG_TIDY_ENABLE_QUERY_BASED_CUSTOM_CHECKS": "#define CLANG_TIDY_ENABLE_QUERY_BASED_CUSTOM_CHECKS 0",
39+
} | select({
40+
":static_analyzer_enabled": {
41+
"#cmakedefine01 CLANG_TIDY_ENABLE_STATIC_ANALYZER": "#define CLANG_TIDY_ENABLE_STATIC_ANALYZER 1",
42+
},
43+
"//conditions:default": {
44+
"#cmakedefine01 CLANG_TIDY_ENABLE_STATIC_ANALYZER": "#define CLANG_TIDY_ENABLE_STATIC_ANALYZER 0",
45+
},
46+
}),
4447
template = "clang-tidy-config.h.cmake",
4548
visibility = ["//visibility:private"],
4649
)

0 commit comments

Comments
 (0)