[NFC][Py Reformat] Reformat python files in llvm
[llvm-project.git] / llvm / utils / gn / secondary / clang-tools-extra / clang-tidy / BUILD.gn
blobcd987b6d87ed24bc1b5054a982f81f919e07bd1a
1 import("//clang/lib/StaticAnalyzer/Frontend/enable.gni")
2 import("//llvm/utils/gn/build/write_cmake_config.gni")
3 import("enable.gni")
5 config("clang-tidy-config_Config") {
6   visibility = [ ":clang-tidy-config" ]
7   include_dirs = [ "$target_gen_dir" ]
10 write_cmake_config("clang-tidy-config") {
11   input = "clang-tidy-config.h.cmake"
12   output = "$target_gen_dir/clang-tidy-config.h"
13   values = []
15   if (clang_tidy_enable_static_analyzer) {
16     values += [ "CLANG_TIDY_ENABLE_STATIC_ANALYZER=1" ]
17   } else {
18     values += [ "CLANG_TIDY_ENABLE_STATIC_ANALYZER=" ]
19   }
21   # Let targets depending on this find the generated file.
22   public_configs = [ ":clang-tidy-config_Config" ]
25 static_library("clang-tidy") {
26   output_name = "clangTidy"
27   configs += [ "//llvm/utils/gn/build:clang_code" ]
28   deps = [
29     ":clang-tidy-config",
30     "//clang/include/clang/StaticAnalyzer/Checkers",
31     "//clang/lib/AST",
32     "//clang/lib/ASTMatchers",
33     "//clang/lib/Basic",
34     "//clang/lib/Format",
35     "//clang/lib/Frontend",
36     "//clang/lib/Lex",
37     "//clang/lib/Rewrite",
38     "//clang/lib/Sema",
39     "//clang/lib/Serialization",
40     "//clang/lib/Tooling",
41     "//clang/lib/Tooling/Core",
42     "//llvm/lib/Support",
43   ]
45   if (clang_tidy_enable_static_analyzer) {
46     deps += [
47       "//clang/lib/StaticAnalyzer/Core",
48       "//clang/lib/StaticAnalyzer/Frontend",
49     ]
50   }
52   sources = [
53     "ClangTidy.cpp",
54     "ClangTidyCheck.cpp",
55     "ClangTidyDiagnosticConsumer.cpp",
56     "ClangTidyModule.cpp",
57     "ClangTidyOptions.cpp",
58     "ClangTidyProfiling.cpp",
59     "ExpandModularHeadersPPCallbacks.cpp",
60     "GlobList.cpp",
61     "NoLintDirectiveHandler.cpp",
62   ]
65 group("all-checks") {
66   # If you add a check, also add it to ClangTidyForceLinker.h.
67   deps = [
68     "//clang-tools-extra/clang-tidy/abseil",
69     "//clang-tools-extra/clang-tidy/altera",
70     "//clang-tools-extra/clang-tidy/android",
71     "//clang-tools-extra/clang-tidy/boost",
72     "//clang-tools-extra/clang-tidy/bugprone",
73     "//clang-tools-extra/clang-tidy/cert",
74     "//clang-tools-extra/clang-tidy/concurrency",
75     "//clang-tools-extra/clang-tidy/cppcoreguidelines",
76     "//clang-tools-extra/clang-tidy/darwin",
77     "//clang-tools-extra/clang-tidy/fuchsia",
78     "//clang-tools-extra/clang-tidy/google",
79     "//clang-tools-extra/clang-tidy/hicpp",
80     "//clang-tools-extra/clang-tidy/linuxkernel",
81     "//clang-tools-extra/clang-tidy/llvm",
82     "//clang-tools-extra/clang-tidy/llvmlibc",
83     "//clang-tools-extra/clang-tidy/misc",
84     "//clang-tools-extra/clang-tidy/modernize",
85     "//clang-tools-extra/clang-tidy/objc",
86     "//clang-tools-extra/clang-tidy/openmp",
87     "//clang-tools-extra/clang-tidy/performance",
88     "//clang-tools-extra/clang-tidy/portability",
89     "//clang-tools-extra/clang-tidy/readability",
90     "//clang-tools-extra/clang-tidy/zircon",
91   ]
92   if (clang_tidy_enable_static_analyzer) {
93     deps += [ "//clang-tools-extra/clang-tidy/mpi" ]
94   }