[llvm] r357476 - gn build: Add build files for non-framework xpc clangd bits
Nico Weber via llvm-commits
llvm-commits at lists.llvm.org
Tue Apr 2 07:39:35 PDT 2019
Author: nico
Date: Tue Apr 2 07:39:34 2019
New Revision: 357476
URL: http://llvm.org/viewvc/llvm-project?rev=357476&view=rev
Log:
gn build: Add build files for non-framework xpc clangd bits
Differential Revision: https://reviews.llvm.org/D60124
Added:
llvm/trunk/utils/gn/secondary/clang-tools-extra/clangd/xpc/
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/clangd/xpc/
llvm/trunk/utils/gn/secondary/clang-tools-extra/unittests/clangd/xpc/BUILD.gn
Modified:
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/unittests/BUILD.gn
Modified: llvm/trunk/utils/gn/build/sync_source_lists_from_cmake.py
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/gn/build/sync_source_lists_from_cmake.py?rev=357476&r1=357475&r2=357476&view=diff
==============================================================================
--- llvm/trunk/utils/gn/build/sync_source_lists_from_cmake.py (original)
+++ llvm/trunk/utils/gn/build/sync_source_lists_from_cmake.py Tue Apr 2 07:39:34 2019
@@ -61,8 +61,7 @@ def sync_unittests():
# 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')
Modified: llvm/trunk/utils/gn/secondary/clang-tools-extra/clangd/tool/BUILD.gn
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/gn/secondary/clang-tools-extra/clangd/tool/BUILD.gn?rev=357476&r1=357475&r2=357476&view=diff
==============================================================================
--- llvm/trunk/utils/gn/secondary/clang-tools-extra/clangd/tool/BUILD.gn (original)
+++ llvm/trunk/utils/gn/secondary/clang-tools-extra/clangd/tool/BUILD.gn Tue Apr 2 07:39:34 2019
@@ -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 @@ executable("clangd") {
"//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 @@ executable("clangd") {
sources = [
"ClangdMain.cpp",
]
-
- if (clangd_build_xpc) {
- # FIXME: Depend on clangdXpcJsonConversions, clangdXpcTransport
- }
}
Added: llvm/trunk/utils/gn/secondary/clang-tools-extra/clangd/xpc/BUILD.gn
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/gn/secondary/clang-tools-extra/clangd/xpc/BUILD.gn?rev=357476&view=auto
==============================================================================
--- llvm/trunk/utils/gn/secondary/clang-tools-extra/clangd/xpc/BUILD.gn (added)
+++ llvm/trunk/utils/gn/secondary/clang-tools-extra/clangd/xpc/BUILD.gn Tue Apr 2 07:39:34 2019
@@ -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",
+ ]
+}
Added: llvm/trunk/utils/gn/secondary/clang-tools-extra/clangd/xpc/enable.gni
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/gn/secondary/clang-tools-extra/clangd/xpc/enable.gni?rev=357476&view=auto
==============================================================================
--- llvm/trunk/utils/gn/secondary/clang-tools-extra/clangd/xpc/enable.gni (added)
+++ llvm/trunk/utils/gn/secondary/clang-tools-extra/clangd/xpc/enable.gni Tue Apr 2 07:39:34 2019
@@ -0,0 +1,4 @@
+declare_args() {
+ # Whether to build clangd's XPC components.
+ clangd_build_xpc = current_os == "mac"
+}
Modified: llvm/trunk/utils/gn/secondary/clang-tools-extra/unittests/BUILD.gn
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/gn/secondary/clang-tools-extra/unittests/BUILD.gn?rev=357476&r1=357475&r2=357476&view=diff
==============================================================================
--- llvm/trunk/utils/gn/secondary/clang-tools-extra/unittests/BUILD.gn (original)
+++ llvm/trunk/utils/gn/secondary/clang-tools-extra/unittests/BUILD.gn Tue Apr 2 07:39:34 2019
@@ -1,3 +1,5 @@
+import("//clang-tools-extra/clangd/xpc/enable.gni")
+
group("unittests") {
deps = [
"clang-apply-replacements:ClangApplyReplacementsTests",
@@ -10,6 +12,8 @@ group("unittests") {
"clang-tidy:ClangTidyTests",
"clangd:ClangdTests",
]
- # FIXME: dep on clangd/xpc:ClangdXpcTests once it exists
+ if (clangd_build_xpc) {
+ deps += [ "clangd/xpc:ClangdXpcTests" ]
+ }
testonly = true
}
Added: llvm/trunk/utils/gn/secondary/clang-tools-extra/unittests/clangd/xpc/BUILD.gn
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/gn/secondary/clang-tools-extra/unittests/clangd/xpc/BUILD.gn?rev=357476&view=auto
==============================================================================
--- llvm/trunk/utils/gn/secondary/clang-tools-extra/unittests/clangd/xpc/BUILD.gn (added)
+++ llvm/trunk/utils/gn/secondary/clang-tools-extra/unittests/clangd/xpc/BUILD.gn Tue Apr 2 07:39:34 2019
@@ -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",
+ ]
+}
More information about the llvm-commits
mailing list