forked from OSchip/llvm-project
gn build: Add check-clangd target after r3359424
r359527 already merged some of that to the GN build, but it was missing some bits as well. The check-clangd target works (at least for now) differently than all the other check-foo targets, see https://reviews.llvm.org/D61187 For that reason, there's no gni file and the generated lit configs are not (yet?) added to llvm-lit/BUILD.gn. llvm-svn: 359570
This commit is contained in:
parent
9b3acea16c
commit
2e78c5a883
|
@ -19,7 +19,7 @@ template("unix_toolchain") {
|
|||
depsformat = "gcc"
|
||||
description = "CC {{output}}"
|
||||
outputs = [
|
||||
"{{source_out_dir}}/{{label_name}}.{{source_name_part}}.o"
|
||||
"{{source_out_dir}}/{{label_name}}.{{source_name_part}}.o",
|
||||
]
|
||||
}
|
||||
|
||||
|
@ -29,7 +29,7 @@ template("unix_toolchain") {
|
|||
depsformat = "gcc"
|
||||
description = "CXX {{output}}"
|
||||
outputs = [
|
||||
"{{source_out_dir}}/{{label_name}}.{{source_name_part}}.o"
|
||||
"{{source_out_dir}}/{{label_name}}.{{source_name_part}}.o",
|
||||
]
|
||||
}
|
||||
|
||||
|
@ -39,7 +39,7 @@ template("unix_toolchain") {
|
|||
depsformat = "gcc"
|
||||
description = "ASM {{output}}"
|
||||
outputs = [
|
||||
"{{source_out_dir}}/{{label_name}}.{{source_name_part}}.o"
|
||||
"{{source_out_dir}}/{{label_name}}.{{source_name_part}}.o",
|
||||
]
|
||||
}
|
||||
|
||||
|
|
|
@ -4,6 +4,7 @@ import("//llvm/utils/gn/build/toolchain/compiler.gni")
|
|||
|
||||
group("default") {
|
||||
deps = [
|
||||
"//clang-tools-extra/clangd/test",
|
||||
"//clang-tools-extra/test",
|
||||
"//clang/test",
|
||||
"//lld/test",
|
||||
|
|
|
@ -0,0 +1,112 @@
|
|||
import("//clang-tools-extra/clangd/xpc/enable.gni")
|
||||
import("//llvm/triples.gni")
|
||||
import("//llvm/utils/gn/build/write_cmake_config.gni")
|
||||
|
||||
clangd_lit_site_cfg_file = "$root_gen_dir/clang-tools-extra/clangd/test/lit.cfg"
|
||||
clangd_lit_unit_site_cfg_file =
|
||||
"$root_gen_dir/clang-tools-extra/clangd/unittests/lit.cfg"
|
||||
|
||||
template("write_lit_config") {
|
||||
write_cmake_config(target_name) {
|
||||
input = invoker.input
|
||||
output = invoker.output
|
||||
values = [
|
||||
"LIT_SITE_CFG_IN_HEADER=## Autogenerated from $input, do not edit",
|
||||
"LLVM_LIBS_DIR=", # needed only for shared builds
|
||||
]
|
||||
values += invoker.extra_values
|
||||
}
|
||||
}
|
||||
|
||||
write_lit_config("lit_site_cfg") {
|
||||
# Fully-qualified instead of relative for LIT_SITE_CFG_IN_HEADER.
|
||||
input = "//clang-tools-extra/clangd/test/lit.cfg.in"
|
||||
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_SOURCE_DIR=" +
|
||||
rebase_path("//clang-tools-extra/clangd/test"),
|
||||
|
||||
"CLANG_LIBS_DIR=", # needed only for shared builds
|
||||
"CLANG_TOOLS_DIR=",
|
||||
"LLVM_HOST_TRIPLE=$llvm_current_triple",
|
||||
"LLVM_LIT_TOOLS_DIR=", # Intentionally empty, matches cmake build.
|
||||
"LLVM_TOOLS_DIR=" + rebase_path("$root_out_dir/bin"),
|
||||
"TARGET_TRIPLE=$llvm_target_triple",
|
||||
]
|
||||
|
||||
if (clangd_build_xpc) {
|
||||
extra_values += [ "CLANGD_BUILD_XPC=1" ]
|
||||
} else {
|
||||
extra_values += [ "CLANGD_BUILD_XPC=0" ]
|
||||
}
|
||||
}
|
||||
|
||||
write_lit_config("lit_unit_site_cfg") {
|
||||
# Fully-qualified instead of relative for LIT_SITE_CFG_IN_HEADER.
|
||||
input = "//clang-tools-extra/clangd/unittests/lit.cfg.in"
|
||||
output = clangd_lit_unit_site_cfg_file
|
||||
extra_values =
|
||||
[ "CMAKE_CURRENT_BINARY_DIR=" +
|
||||
rebase_path(get_label_info("//clang-tools-extra/clangd/unittests",
|
||||
"target_out_dir")) ]
|
||||
if (host_os == "win") {
|
||||
# See comment for Windows solink in llvm/utils/gn/build/toolchain/BUILD.gn
|
||||
extra_values += [ "SHLIBDIR=" + rebase_path("$root_out_dir/bin") ]
|
||||
} else {
|
||||
extra_values += [ "SHLIBDIR=" + rebase_path("$root_out_dir/lib") ]
|
||||
}
|
||||
}
|
||||
|
||||
# This target should contain all dependencies of check-clangd.
|
||||
# //:default depends on it, so that ninja's default target builds all
|
||||
# prerequisites for check-clang but doesn't run check-clang itself.
|
||||
group("test") {
|
||||
deps = [
|
||||
":lit_site_cfg",
|
||||
":lit_unit_site_cfg",
|
||||
"//clang-tools-extra/clangd/index/dex/dexp",
|
||||
"//clang-tools-extra/clangd/indexer:clangd-indexer",
|
||||
"//clang-tools-extra/clangd/tool:clangd",
|
||||
"//clang-tools-extra/clangd/unittests:ClangdTests",
|
||||
"//llvm/utils/FileCheck",
|
||||
"//llvm/utils/llvm-lit",
|
||||
"//llvm/utils/not",
|
||||
]
|
||||
if (clangd_build_xpc) {
|
||||
deps += [
|
||||
"//clang-tools-extra/clangd/unittests/xpc:ClangdXpcUnitTests",
|
||||
"//clang-tools-extra/clangd/xpc/test-client:clangd-xpc-test-client",
|
||||
]
|
||||
}
|
||||
testonly = true
|
||||
}
|
||||
|
||||
action("check-clangd") {
|
||||
script = "$root_out_dir/bin/llvm-lit"
|
||||
if (host_os == "win") {
|
||||
script += ".py"
|
||||
}
|
||||
args = [
|
||||
"-sv",
|
||||
rebase_path(get_path_info(clangd_lit_site_cfg_file, "dir"), root_out_dir),
|
||||
rebase_path(get_path_info(clangd_lit_unit_site_cfg_file, "dir"),
|
||||
root_out_dir),
|
||||
]
|
||||
outputs = [
|
||||
"$target_gen_dir/run-lit", # Non-existing, so that ninja runs it each time.
|
||||
]
|
||||
|
||||
# Since check-clangd is always dirty, //:default doesn't depend on it so
|
||||
# that it's not part of the default ninja target. Hence, check-clangd
|
||||
# shouldn't have any deps except :test. so that the default target is sure to
|
||||
# build all the deps.
|
||||
deps = [
|
||||
":test",
|
||||
]
|
||||
testonly = true
|
||||
|
||||
pool = "//:console"
|
||||
}
|
|
@ -1,4 +1,3 @@
|
|||
import("//clang-tools-extra/clangd/xpc/enable.gni")
|
||||
import("//clang/lib/StaticAnalyzer/Frontend/enable.gni")
|
||||
import("//llvm/triples.gni")
|
||||
import("//llvm/utils/gn/build/write_cmake_config.gni")
|
||||
|
@ -68,9 +67,6 @@ group("test") {
|
|||
"//clang-tools-extra/clang-query/tool:clang-query",
|
||||
"//clang-tools-extra/clang-reorder-fields/tool:clang-reorder-fields",
|
||||
"//clang-tools-extra/clang-tidy/tool:clang-tidy",
|
||||
"//clang-tools-extra/clangd/index/dex/dexp",
|
||||
"//clang-tools-extra/clangd/indexer:clangd-indexer",
|
||||
"//clang-tools-extra/clangd/tool:clangd",
|
||||
"//clang-tools-extra/modularize",
|
||||
"//clang-tools-extra/pp-trace",
|
||||
"//clang-tools-extra/unittests",
|
||||
|
@ -84,10 +80,6 @@ group("test") {
|
|||
"//llvm/utils/llvm-lit",
|
||||
"//llvm/utils/not",
|
||||
]
|
||||
if (clangd_build_xpc) {
|
||||
deps +=
|
||||
[ "//clang-tools-extra/clangd/xpc/test-client:clangd-xpc-test-client" ]
|
||||
}
|
||||
testonly = true
|
||||
}
|
||||
|
||||
|
@ -111,7 +103,7 @@ action("check-clang-tools") {
|
|||
]
|
||||
|
||||
# Since check-clang-tools is always dirty, //:default doesn't depend on it so
|
||||
# that it's not part of the default ninja target. Hence, check-clang
|
||||
# that it's not part of the default ninja target. Hence, check-clang-tools
|
||||
# shouldn't have any deps except :test. so that the default target is sure to
|
||||
# build all the deps.
|
||||
deps = [
|
||||
|
|
|
@ -10,10 +10,6 @@ group("unittests") {
|
|||
"clang-move:ClangMoveTests",
|
||||
"clang-query:ClangQueryTests",
|
||||
"clang-tidy:ClangTidyTests",
|
||||
"//clang-tools-extra/clangd/unittests:ClangdTests",
|
||||
]
|
||||
if (clangd_build_xpc) {
|
||||
deps += [ "clangd/xpc:ClangdXpcTests" ]
|
||||
}
|
||||
testonly = true
|
||||
}
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import("//llvm/lib/Target/targets.gni")
|
||||
import("//llvm/lib/DebugInfo/PDB/enable_dia.gni")
|
||||
import("//llvm/lib/Target/targets.gni")
|
||||
import("//llvm/triples.gni")
|
||||
import("//llvm/utils/gn/build/buildflags.gni")
|
||||
import("//llvm/utils/gn/build/libs/edit/enable.gni")
|
||||
|
|
|
@ -113,6 +113,6 @@ static_library("PDB") {
|
|||
"DIA/DIASourceFile.cpp",
|
||||
"DIA/DIATable.cpp",
|
||||
]
|
||||
libs = [ "diaguids.lib" ]
|
||||
libs = [ "diaguids.lib" ]
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue