[gn build] (manually) port ad97ccf6b26a
authorNico Weber <thakis@chromium.org>
Wed, 29 Apr 2020 15:51:10 +0000 (11:51 -0400)
committerNico Weber <thakis@chromium.org>
Wed, 29 Apr 2020 15:51:22 +0000 (11:51 -0400)
llvm/utils/gn/secondary/clang-tools-extra/clangd/BUILD.gn
llvm/utils/gn/secondary/clang-tools-extra/clangd/index/remote/BUILD.gn
llvm/utils/gn/secondary/clang-tools-extra/clangd/index/remote/unimplemented/BUILD.gn
llvm/utils/gn/secondary/clang-tools-extra/clangd/refactor/tweaks/BUILD.gn
llvm/utils/gn/secondary/clang-tools-extra/clangd/support/BUILD.gn [new file with mode: 0644]
llvm/utils/gn/secondary/clang-tools-extra/clangd/test/BUILD.gn
llvm/utils/gn/secondary/clang-tools-extra/clangd/unittests/BUILD.gn
llvm/utils/gn/secondary/clang-tools-extra/clangd/xpc/BUILD.gn
llvm/utils/gn/secondary/clang/tools/scan-build/BUILD.gn

index b0f6d7f..7d8b869 100644 (file)
@@ -28,6 +28,7 @@ static_library("clangd") {
     ":features",
     "//clang-tools-extra/clang-tidy",
     "//clang-tools-extra/clang-tidy:all-checks",
+    "//clang-tools-extra/clangd/support",
     "//clang/lib/AST",
     "//clang/lib/ASTMatchers",
     "//clang/lib/Basic",
@@ -45,7 +46,6 @@ static_library("clangd") {
     "//clang/lib/Tooling/Syntax",
     "//llvm/lib/Support",
     "//llvm/lib/Target:AllTargetsInfos",
-    "//llvm/utils/gn/build/libs/atomic",
     "//llvm/utils/gn/build/libs/pthread",
   ]
   include_dirs = [
@@ -56,7 +56,6 @@ static_library("clangd") {
   ]
   sources = [
     "AST.cpp",
-    "Cancellation.cpp",
     "ClangdLSPServer.cpp",
     "ClangdServer.cpp",
     "CodeComplete.cpp",
@@ -64,12 +63,10 @@ static_library("clangd") {
     "CollectMacros.cpp",
     "CompileCommands.cpp",
     "Compiler.cpp",
-    "Context.cpp",
     "Diagnostics.cpp",
     "DraftStore.cpp",
     "ExpectedTypes.cpp",
     "FS.cpp",
-    "FSProvider.cpp",
     "FileDistance.cpp",
     "FindSymbols.cpp",
     "FindTarget.cpp",
@@ -82,7 +79,6 @@ static_library("clangd") {
     "Hover.cpp",
     "IncludeFixer.cpp",
     "JSONTransport.cpp",
-    "Logger.cpp",
     "ParsedAST.cpp",
     "PathMapping.cpp",
     "Preamble.cpp",
@@ -93,11 +89,8 @@ static_library("clangd") {
     "Selection.cpp",
     "SemanticHighlighting.cpp",
     "SemanticSelection.cpp",
-    "Shutdown.cpp",
     "SourceCode.cpp",
     "TUScheduler.cpp",
-    "Threading.cpp",
-    "Trace.cpp",
     "URI.cpp",
     "XRefs.cpp",
     "index/Background.cpp",
index c5e646b..de3c8f8 100644 (file)
@@ -2,6 +2,7 @@ source_set("remote") {
   configs += [ "//llvm/utils/gn/build:clang_code" ]
   deps = [
     "//clang-tools-extra/clangd",
+    "//clang-tools-extra/clangd/support",
     "//llvm/lib/Support",
   ]
   include_dirs = [ "../.." ]
index 2d75d37..3343fc9 100644 (file)
@@ -2,6 +2,7 @@ source_set("unimplemented") {
   configs += [ "//llvm/utils/gn/build:clang_code" ]
   deps = [
     "//clang-tools-extra/clangd",
+    "//clang-tools-extra/clangd/support",
     "//llvm/lib/Support",
   ]
   include_dirs = [ "../../.." ]
index 687b872..aa0a63f 100644 (file)
@@ -6,6 +6,7 @@ source_set("tweaks") {
   configs += [ "//llvm/utils/gn/build:clang_code" ]
   deps = [
     "//clang-tools-extra/clangd",
+    "//clang-tools-extra/clangd/support",
     "//clang/lib/AST",
     "//clang/lib/Tooling/Core",
     "//llvm/lib/Support",
diff --git a/llvm/utils/gn/secondary/clang-tools-extra/clangd/support/BUILD.gn b/llvm/utils/gn/secondary/clang-tools-extra/clangd/support/BUILD.gn
new file mode 100644 (file)
index 0000000..e527c6d
--- /dev/null
@@ -0,0 +1,20 @@
+# clangd/support contains low-level support libraries that do not depend
+# on clang either programmatically or conceptually.
+static_library("support") {
+  output_name = "clangdSupport"
+  configs += [ "//llvm/utils/gn/build:clang_code" ]
+  deps = [
+    "//llvm/lib/Support",
+    "//llvm/utils/gn/build/libs/atomic",
+  ]
+  include_dirs = [ ".." ]
+  sources = [
+    "Cancellation.cpp",
+    "Context.cpp",
+    "FSProvider.cpp",
+    "Logger.cpp",
+    "Shutdown.cpp",
+    "Threading.cpp",
+    "Trace.cpp",
+  ]
+}
index 4dc4c27..540a8a3 100644 (file)
@@ -21,9 +21,8 @@ write_lit_config("lit_site_cfg") {
   output = clangd_lit_site_cfg_file
 
   extra_values = [
-    "CMAKE_CURRENT_BINARY_DIR=" +
-        rebase_path(get_label_info("//clang-tools-extra/clangd/test",
-                                   "target_out_dir")),
+    "CMAKE_CURRENT_BINARY_DIR=" + rebase_path(
+            get_label_info("//clang-tools-extra/clangd/test", "target_out_dir")),
     "CMAKE_CURRENT_SOURCE_DIR=" +
         rebase_path("//clang-tools-extra/clangd/test"),
 
index e334a43..6b9e4f7 100644 (file)
@@ -32,7 +32,6 @@ unittest("ClangdTests") {
     "ASTTests.cpp",
     "Annotations.cpp",
     "BackgroundIndexTests.cpp",
-    "CancellationTests.cpp",
     "CanonicalIncludesTests.cpp",
     "ClangdLSPServerTests.cpp",
     "ClangdTests.cpp",
@@ -40,7 +39,6 @@ unittest("ClangdTests") {
     "CodeCompletionStringsTests.cpp",
     "CollectMacrosTests.cpp",
     "CompileCommandsTests.cpp",
-    "ContextTests.cpp",
     "DexTests.cpp",
     "DiagnosticsTests.cpp",
     "DraftStoreTests.cpp",
@@ -52,7 +50,6 @@ unittest("ClangdTests") {
     "FindTargetTests.cpp",
     "FormatTests.cpp",
     "FormattedStringTests.cpp",
-    "FunctionTests.cpp",
     "FuzzyMatchTests.cpp",
     "GlobalCompilationDatabaseTests.cpp",
     "HeaderSourceSwitchTests.cpp",
@@ -81,12 +78,15 @@ unittest("ClangdTests") {
     "TestFS.cpp",
     "TestIndex.cpp",
     "TestTU.cpp",
-    "ThreadingTests.cpp",
-    "TraceTests.cpp",
     "TweakTesting.cpp",
     "TweakTests.cpp",
     "TypeHierarchyTests.cpp",
     "URITests.cpp",
     "XRefsTests.cpp",
+    "support/CancellationTests.cpp",
+    "support/ContextTests.cpp",
+    "support/FunctionTests.cpp",
+    "support/ThreadingTests.cpp",
+    "support/TraceTests.cpp",
   ]
 }
index 79b9c23..e15340e 100644 (file)
@@ -3,6 +3,7 @@ static_library("conversions") {
   configs += [ "//llvm/utils/gn/build:clang_code" ]
   deps = [
     "//clang-tools-extra/clangd",
+    "//clang-tools-extra/clangd/support",
     "//llvm/lib/Support",
   ]
   include_dirs = [ ".." ]
@@ -18,6 +19,7 @@ static_library("transport") {
   deps = [
     ":conversions",
     "//clang-tools-extra/clangd",
+    "//clang-tools-extra/clangd/support",
     "//llvm/lib/Support",
   ]
   include_dirs = [ ".." ]
index df65d46..a4c5208 100644 (file)
@@ -19,13 +19,13 @@ copy("bin") {
 
 copy("libexec") {
   sources = [
-    "libexec/ccc-analyzer",
     "libexec/c++-analyzer",
+    "libexec/ccc-analyzer",
   ]
   if (host_os == "win") {
     sources += [
-      "libexec/ccc-analyzer.bat",
       "libexec/c++-analyzer.bat",
+      "libexec/ccc-analyzer.bat",
     ]
   }
   outputs = [ "$root_build_dir/libexec/{{source_file_part}}" ]
@@ -38,8 +38,8 @@ copy("man") {
 
 copy("share") {
   sources = [
-    "share/scan-build/sorttable.js",
     "share/scan-build/scanview.css",
+    "share/scan-build/sorttable.js",
   ]
   outputs = [ "$root_build_dir/share/scan-build/{{source_file_part}}" ]
 }