gn build: Fix check-clang-tools after r362702.

r362702 added a test that requires clang-tidy to be linked
into libclang, so add that to the gn build.

Differential Revision: https://reviews.llvm.org/D65462

llvm-svn: 367340
This commit is contained in:
Nico Weber 2019-07-30 18:16:55 +00:00
parent e0a9dce543
commit 2859bbb3e2
3 changed files with 37 additions and 1 deletions
llvm/utils/gn/secondary
clang-tools-extra
clang-include-fixer/plugin
clang-tidy/plugin
clang/tools/libclang

View File

@ -0,0 +1,18 @@
static_library("plugin") {
output_name = "clangIncludeFixerPlugin"
configs += [ "//llvm/utils/gn/build:clang_code" ]
deps = [
"//clang-tools-extra/clang-include-fixer",
"//clang/lib/AST",
"//clang/lib/Basic",
"//clang/lib/Frontend",
"//clang/lib/Parse",
"//clang/lib/Sema",
"//clang/lib/Tooling",
"//llvm/utils/gn/build/libs/pthread",
]
sources = [
"IncludeFixerPlugin.cpp",
]
}

View File

@ -1,3 +1,5 @@
import("//clang/lib/StaticAnalyzer/Frontend/enable.gni")
static_library("plugin") {
output_name = "clangTidyPlugin"
configs += [ "//llvm/utils/gn/build:clang_code" ]
@ -12,10 +14,12 @@ static_library("plugin") {
"//clang-tools-extra/clang-tidy/fuchsia",
"//clang-tools-extra/clang-tidy/google",
"//clang-tools-extra/clang-tidy/hicpp",
"//clang-tools-extra/clang-tidy/linuxkernel",
"//clang-tools-extra/clang-tidy/llvm",
"//clang-tools-extra/clang-tidy/misc",
"//clang-tools-extra/clang-tidy/modernize",
"//clang-tools-extra/clang-tidy/objc",
"//clang-tools-extra/clang-tidy/openmp",
"//clang-tools-extra/clang-tidy/performance",
"//clang-tools-extra/clang-tidy/portability",
"//clang-tools-extra/clang-tidy/readability",

View File

@ -39,8 +39,22 @@ target(libclang_target_type, "libclang") {
deps += [ "//clang/lib/ARCMigrate" ]
}
defines = []
# FIXME: Once the GN build has a way to select which bits to build,
# only include this dependency if clang-tools-extra is part of the build.
# FIXME: libclang depending on anything in clang-tools-extra seems like
# a layering violation.
if (true) {
defines += [ "CLANG_TOOL_EXTRA_BUILD" ]
deps += [
"//clang-tools-extra/clang-include-fixer/plugin",
"//clang-tools-extra/clang-tidy/plugin",
]
}
if (host_os == "win") {
defines = [ "_CINDEX_LIB_" ]
defines += [ "_CINDEX_LIB_" ]
}
sources = [