1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-25 04:02:41 +01:00

gn build: Add build files for non-framework xpc clangd bits

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

llvm-svn: 357476
This commit is contained in:
Nico Weber 2019-04-02 14:39:34 +00:00
parent 7f20d02d8a
commit f710c62d2a
6 changed files with 58 additions and 12 deletions

View File

@ -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')

View File

@ -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
}
}

View File

@ -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",
]
}

View File

@ -0,0 +1,4 @@
declare_args() {
# Whether to build clangd's XPC components.
clangd_build_xpc = current_os == "mac"
}

View File

@ -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
}

View File

@ -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",
]
}