This revision was automatically updated to reflect the committed changes.
Closed by commit rL357476: gn build: Add build files for non-framework xpc 
clangd bits (authored by nico, committed by ).

Changed prior to commit:
  https://reviews.llvm.org/D60124?vs=193264&id=193290#toc

Repository:
  rL LLVM

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D60124/new/

https://reviews.llvm.org/D60124

Files:
  llvm/trunk/utils/gn/build/sync_source_lists_from_cmake.py
  llvm/trunk/utils/gn/secondary/clang-tools-extra/clangd/tool/BUILD.gn
  llvm/trunk/utils/gn/secondary/clang-tools-extra/clangd/xpc/BUILD.gn
  llvm/trunk/utils/gn/secondary/clang-tools-extra/clangd/xpc/enable.gni
  llvm/trunk/utils/gn/secondary/clang-tools-extra/unittests/BUILD.gn
  llvm/trunk/utils/gn/secondary/clang-tools-extra/unittests/clangd/xpc/BUILD.gn

Index: llvm/trunk/utils/gn/secondary/clang-tools-extra/clangd/tool/BUILD.gn
===================================================================
--- llvm/trunk/utils/gn/secondary/clang-tools-extra/clangd/tool/BUILD.gn
+++ llvm/trunk/utils/gn/secondary/clang-tools-extra/clangd/tool/BUILD.gn
@@ -1,10 +1,6 @@
+import("//clang-tools-extra/clangd/xpc/enable.gni")
 import("//llvm/utils/gn/build/write_cmake_config.gni")
 
-declare_args() {
-  # Whether to build clangd's XPC components.
-  clangd_build_xpc = false
-}
-
 write_cmake_config("features") {
   # FIXME: Try moving Features.inc.in to tools, seems like a better location.
   input = "../Features.inc.in"
@@ -33,6 +29,12 @@
     "//clang/lib/Tooling/Core",
     "//llvm/lib/Support",
   ]
+  if (clangd_build_xpc) {
+    deps += [
+      "//clang-tools-extra/clangd/xpc:conversions",
+      "//clang-tools-extra/clangd/xpc:transport",
+    ]
+  }
 
   include_dirs = [
     "..",
@@ -43,8 +45,4 @@
   sources = [
     "ClangdMain.cpp",
   ]
-
-  if (clangd_build_xpc) {
-    # FIXME: Depend on clangdXpcJsonConversions, clangdXpcTransport
-  }
 }
Index: llvm/trunk/utils/gn/secondary/clang-tools-extra/clangd/xpc/enable.gni
===================================================================
--- llvm/trunk/utils/gn/secondary/clang-tools-extra/clangd/xpc/enable.gni
+++ llvm/trunk/utils/gn/secondary/clang-tools-extra/clangd/xpc/enable.gni
@@ -0,0 +1,4 @@
+declare_args() {
+  # Whether to build clangd's XPC components.
+  clangd_build_xpc = current_os == "mac"
+}
Index: llvm/trunk/utils/gn/secondary/clang-tools-extra/clangd/xpc/BUILD.gn
===================================================================
--- llvm/trunk/utils/gn/secondary/clang-tools-extra/clangd/xpc/BUILD.gn
+++ llvm/trunk/utils/gn/secondary/clang-tools-extra/clangd/xpc/BUILD.gn
@@ -0,0 +1,26 @@
+static_library("conversions") {
+  output_name = "clangdXpcJsonConversions"
+  configs += [ "//llvm/utils/gn/build:clang_code" ]
+  deps = [
+    "//clang-tools-extra/clangd",
+    "//llvm/lib/Support",
+  ]
+  include_dirs = [ ".." ]
+  sources = [
+    "Conversion.cpp",
+  ]
+}
+
+static_library("transport") {
+  output_name = "clangdXpcTransport"
+  configs += [ "//llvm/utils/gn/build:clang_code" ]
+  deps = [
+    ":conversions",
+    "//clang-tools-extra/clangd",
+    "//llvm/lib/Support",
+  ]
+  include_dirs = [ ".." ]
+  sources = [
+    "XPCTransport.cpp",
+  ]
+}
Index: llvm/trunk/utils/gn/secondary/clang-tools-extra/unittests/clangd/xpc/BUILD.gn
===================================================================
--- llvm/trunk/utils/gn/secondary/clang-tools-extra/unittests/clangd/xpc/BUILD.gn
+++ llvm/trunk/utils/gn/secondary/clang-tools-extra/unittests/clangd/xpc/BUILD.gn
@@ -0,0 +1,15 @@
+import("//llvm/utils/unittest/unittest.gni")
+
+unittest("ClangdXpcTests") {
+  configs += [ "//llvm/utils/gn/build:clang_code" ]
+  deps = [
+    "//clang-tools-extra/clangd",
+    "//clang-tools-extra/clangd/xpc:conversions",
+    "//llvm/lib/Support",
+    "//llvm/lib/Testing/Support",
+  ]
+  include_dirs = [ "//clang-tools-extra/clangd" ]
+  sources = [
+    "ConversionTests.cpp",
+  ]
+}
Index: llvm/trunk/utils/gn/secondary/clang-tools-extra/unittests/BUILD.gn
===================================================================
--- llvm/trunk/utils/gn/secondary/clang-tools-extra/unittests/BUILD.gn
+++ llvm/trunk/utils/gn/secondary/clang-tools-extra/unittests/BUILD.gn
@@ -1,3 +1,5 @@
+import("//clang-tools-extra/clangd/xpc/enable.gni")
+
 group("unittests") {
   deps = [
     "clang-apply-replacements:ClangApplyReplacementsTests",
@@ -10,6 +12,8 @@
     "clang-tidy:ClangTidyTests",
     "clangd:ClangdTests",
   ]
-  # FIXME: dep on clangd/xpc:ClangdXpcTests once it exists
+  if (clangd_build_xpc) {
+    deps += [ "clangd/xpc:ClangdXpcTests" ]
+  }
   testonly = true
 }
Index: llvm/trunk/utils/gn/build/sync_source_lists_from_cmake.py
===================================================================
--- llvm/trunk/utils/gn/build/sync_source_lists_from_cmake.py
+++ llvm/trunk/utils/gn/build/sync_source_lists_from_cmake.py
@@ -61,8 +61,7 @@
     # Matches e.g. |add_llvm_unittest_with_input_files|.
     unittest_re = re.compile(r'^add_\S+_unittest', re.MULTILINE)
 
-    # FIXME: Add 'clang-tools-extra'.
-    checked = [ 'clang', 'lld', 'llvm' ]
+    checked = [ 'clang', 'clang-tools-extra', 'lld', 'llvm' ]
     for c in checked:
         for root, _, _ in os.walk(os.path.join(c, 'unittests')):
             cmake_file = os.path.join(root, 'CMakeLists.txt')
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to