From d3ae8566b07d1dc66d26a876b41424fee2c5897e Mon Sep 17 00:00:00 2001 From: Nico Weber Date: Thu, 19 Jan 2023 08:45:56 -0500 Subject: [PATCH] [gn] port 939dce12f9f3 (clangd uses include-cleaner) --- .../gn/secondary/clang-tools-extra/clangd/BUILD.gn | 4 ++++ .../clangd/refactor/tweaks/BUILD.gn | 7 ++++++- .../clang-tools-extra/clangd/tool/BUILD.gn | 7 ++++++- .../clang-tools-extra/include-cleaner/lib/BUILD.gn | 23 ++++++++++++++++++++++ 4 files changed, 39 insertions(+), 2 deletions(-) create mode 100644 llvm/utils/gn/secondary/clang-tools-extra/include-cleaner/lib/BUILD.gn diff --git a/llvm/utils/gn/secondary/clang-tools-extra/clangd/BUILD.gn b/llvm/utils/gn/secondary/clang-tools-extra/clangd/BUILD.gn index 64093c3..b64355f 100644 --- a/llvm/utils/gn/secondary/clang-tools-extra/clangd/BUILD.gn +++ b/llvm/utils/gn/secondary/clang-tools-extra/clangd/BUILD.gn @@ -43,6 +43,7 @@ static_library("clangd") { "//clang-tools-extra/clang-tidy:all-checks", "//clang-tools-extra/clang-tidy:clang-tidy-config", "//clang-tools-extra/clangd/support", + "//clang-tools-extra/include-cleaner/lib", "//clang-tools-extra/pseudo/lib", "//clang/lib/AST", "//clang/lib/ASTMatchers", @@ -68,6 +69,9 @@ static_library("clangd") { include_dirs = [ ".", + # For "clang-include-cleaner/..." includes. + "//clang-tools-extra/include-cleaner/include", + # For "clang-pseudo/..." includes. "//clang-tools-extra/pseudo/include", diff --git a/llvm/utils/gn/secondary/clang-tools-extra/clangd/refactor/tweaks/BUILD.gn b/llvm/utils/gn/secondary/clang-tools-extra/clangd/refactor/tweaks/BUILD.gn index 7ad4e5c..ee3f3aa 100644 --- a/llvm/utils/gn/secondary/clang-tools-extra/clangd/refactor/tweaks/BUILD.gn +++ b/llvm/utils/gn/secondary/clang-tools-extra/clangd/refactor/tweaks/BUILD.gn @@ -11,7 +11,12 @@ source_set("tweaks") { "//clang/lib/Tooling/Core", "//llvm/lib/Support", ] - include_dirs = [ "../.." ] + include_dirs = [ + "../..", + + # For "clang-include-cleaner/..." includes. + "//clang-tools-extra/include-cleaner/include", + ] sources = [ "AddUsing.cpp", "AnnotateHighlightings.cpp", diff --git a/llvm/utils/gn/secondary/clang-tools-extra/clangd/tool/BUILD.gn b/llvm/utils/gn/secondary/clang-tools-extra/clangd/tool/BUILD.gn index 856e46e..b0d9f05 100644 --- a/llvm/utils/gn/secondary/clang-tools-extra/clangd/tool/BUILD.gn +++ b/llvm/utils/gn/secondary/clang-tools-extra/clangd/tool/BUILD.gn @@ -25,7 +25,12 @@ executable("clangd") { ] } - include_dirs = [ ".." ] + include_dirs = [ + "..", + + # For "clang-include-cleaner/..." includes. + "//clang-tools-extra/include-cleaner/include", + ] sources = [ "Check.cpp", "ClangdMain.cpp", diff --git a/llvm/utils/gn/secondary/clang-tools-extra/include-cleaner/lib/BUILD.gn b/llvm/utils/gn/secondary/clang-tools-extra/include-cleaner/lib/BUILD.gn new file mode 100644 index 0000000..8f613c9 --- /dev/null +++ b/llvm/utils/gn/secondary/clang-tools-extra/include-cleaner/lib/BUILD.gn @@ -0,0 +1,23 @@ +static_library("lib") { + output_name = "clangIncludeCleaner" + configs += [ "//llvm/utils/gn/build:clang_code" ] + deps = [ + "//clang/lib/AST", + "//clang/lib/Basic", + "//clang/lib/Format", + "//clang/lib/Tooling/Core", + "//clang/lib/Tooling/Inclusions", + "//clang/lib/Tooling/Inclusions/Stdlib", + "//llvm/lib/Support", + ] + include_dirs = [ "../include" ] + sources = [ + "Analysis.cpp", + "FindHeaders.cpp", + "HTMLReport.cpp", + "LocateSymbol.cpp", + "Record.cpp", + "Types.cpp", + "WalkAST.cpp", + ] +} -- 2.7.4