llvm.org GIT mirror llvm / b0114c7
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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@359570 91177308-0d34-0410-b5e6-96231b3b80d8 Nico Weber 5 months ago
7 changed file(s) with 119 addition(s) and 18 deletion(s). Raw diff Collapse all Expand all
1818 depsformat = "gcc"
1919 description = "CC {{output}}"
2020 outputs = [
21 "{{source_out_dir}}/{{label_name}}.{{source_name_part}}.o"
21 "{{source_out_dir}}/{{label_name}}.{{source_name_part}}.o",
2222 ]
2323 }
2424
2828 depsformat = "gcc"
2929 description = "CXX {{output}}"
3030 outputs = [
31 "{{source_out_dir}}/{{label_name}}.{{source_name_part}}.o"
31 "{{source_out_dir}}/{{label_name}}.{{source_name_part}}.o",
3232 ]
3333 }
3434
3838 depsformat = "gcc"
3939 description = "ASM {{output}}"
4040 outputs = [
41 "{{source_out_dir}}/{{label_name}}.{{source_name_part}}.o"
41 "{{source_out_dir}}/{{label_name}}.{{source_name_part}}.o",
4242 ]
4343 }
4444
33
44 group("default") {
55 deps = [
6 "//clang-tools-extra/clangd/test",
67 "//clang-tools-extra/test",
78 "//clang/test",
89 "//lld/test",
0 import("//clang-tools-extra/clangd/xpc/enable.gni")
1 import("//llvm/triples.gni")
2 import("//llvm/utils/gn/build/write_cmake_config.gni")
3
4 clangd_lit_site_cfg_file = "$root_gen_dir/clang-tools-extra/clangd/test/lit.cfg"
5 clangd_lit_unit_site_cfg_file =
6 "$root_gen_dir/clang-tools-extra/clangd/unittests/lit.cfg"
7
8 template("write_lit_config") {
9 write_cmake_config(target_name) {
10 input = invoker.input
11 output = invoker.output
12 values = [
13 "LIT_SITE_CFG_IN_HEADER=## Autogenerated from $input, do not edit",
14 "LLVM_LIBS_DIR=", # needed only for shared builds
15 ]
16 values += invoker.extra_values
17 }
18 }
19
20 write_lit_config("lit_site_cfg") {
21 # Fully-qualified instead of relative for LIT_SITE_CFG_IN_HEADER.
22 input = "//clang-tools-extra/clangd/test/lit.cfg.in"
23 output = clangd_lit_site_cfg_file
24
25 extra_values = [
26 "CMAKE_CURRENT_BINARY_DIR=" + rebase_path(
27 get_label_info("//clang-tools-extra/clangd/test", "target_out_dir")),
28 "CMAKE_CURRENT_SOURCE_DIR=" +
29 rebase_path("//clang-tools-extra/clangd/test"),
30
31 "CLANG_LIBS_DIR=", # needed only for shared builds
32 "CLANG_TOOLS_DIR=",
33 "LLVM_HOST_TRIPLE=$llvm_current_triple",
34 "LLVM_LIT_TOOLS_DIR=", # Intentionally empty, matches cmake build.
35 "LLVM_TOOLS_DIR=" + rebase_path("$root_out_dir/bin"),
36 "TARGET_TRIPLE=$llvm_target_triple",
37 ]
38
39 if (clangd_build_xpc) {
40 extra_values += [ "CLANGD_BUILD_XPC=1" ]
41 } else {
42 extra_values += [ "CLANGD_BUILD_XPC=0" ]
43 }
44 }
45
46 write_lit_config("lit_unit_site_cfg") {
47 # Fully-qualified instead of relative for LIT_SITE_CFG_IN_HEADER.
48 input = "//clang-tools-extra/clangd/unittests/lit.cfg.in"
49 output = clangd_lit_unit_site_cfg_file
50 extra_values =
51 [ "CMAKE_CURRENT_BINARY_DIR=" +
52 rebase_path(get_label_info("//clang-tools-extra/clangd/unittests",
53 "target_out_dir")) ]
54 if (host_os == "win") {
55 # See comment for Windows solink in llvm/utils/gn/build/toolchain/BUILD.gn
56 extra_values += [ "SHLIBDIR=" + rebase_path("$root_out_dir/bin") ]
57 } else {
58 extra_values += [ "SHLIBDIR=" + rebase_path("$root_out_dir/lib") ]
59 }
60 }
61
62 # This target should contain all dependencies of check-clangd.
63 # //:default depends on it, so that ninja's default target builds all
64 # prerequisites for check-clang but doesn't run check-clang itself.
65 group("test") {
66 deps = [
67 ":lit_site_cfg",
68 ":lit_unit_site_cfg",
69 "//clang-tools-extra/clangd/index/dex/dexp",
70 "//clang-tools-extra/clangd/indexer:clangd-indexer",
71 "//clang-tools-extra/clangd/tool:clangd",
72 "//clang-tools-extra/clangd/unittests:ClangdTests",
73 "//llvm/utils/FileCheck",
74 "//llvm/utils/llvm-lit",
75 "//llvm/utils/not",
76 ]
77 if (clangd_build_xpc) {
78 deps += [
79 "//clang-tools-extra/clangd/unittests/xpc:ClangdXpcUnitTests",
80 "//clang-tools-extra/clangd/xpc/test-client:clangd-xpc-test-client",
81 ]
82 }
83 testonly = true
84 }
85
86 action("check-clangd") {
87 script = "$root_out_dir/bin/llvm-lit"
88 if (host_os == "win") {
89 script += ".py"
90 }
91 args = [
92 "-sv",
93 rebase_path(get_path_info(clangd_lit_site_cfg_file, "dir"), root_out_dir),
94 rebase_path(get_path_info(clangd_lit_unit_site_cfg_file, "dir"),
95 root_out_dir),
96 ]
97 outputs = [
98 "$target_gen_dir/run-lit", # Non-existing, so that ninja runs it each time.
99 ]
100
101 # Since check-clangd is always dirty, //:default doesn't depend on it so
102 # that it's not part of the default ninja target. Hence, check-clangd
103 # shouldn't have any deps except :test. so that the default target is sure to
104 # build all the deps.
105 deps = [
106 ":test",
107 ]
108 testonly = true
109
110 pool = "//:console"
111 }
None import("//clang-tools-extra/clangd/xpc/enable.gni")
1 import("//clang/lib/StaticAnalyzer/Frontend/enable.gni")
21 import("//llvm/triples.gni")
32 import("//llvm/utils/gn/build/write_cmake_config.gni")
6766 "//clang-tools-extra/clang-query/tool:clang-query",
6867 "//clang-tools-extra/clang-reorder-fields/tool:clang-reorder-fields",
6968 "//clang-tools-extra/clang-tidy/tool:clang-tidy",
70 "//clang-tools-extra/clangd/index/dex/dexp",
71 "//clang-tools-extra/clangd/indexer:clangd-indexer",
72 "//clang-tools-extra/clangd/tool:clangd",
7369 "//clang-tools-extra/modularize",
7470 "//clang-tools-extra/pp-trace",
7571 "//clang-tools-extra/unittests",
8379 "//llvm/utils/llvm-lit",
8480 "//llvm/utils/not",
8581 ]
86 if (clangd_build_xpc) {
87 deps +=
88 [ "//clang-tools-extra/clangd/xpc/test-client:clangd-xpc-test-client" ]
89 }
9082 testonly = true
9183 }
9284
110102 ]
111103
112104 # Since check-clang-tools is always dirty, //:default doesn't depend on it so
113 # that it's not part of the default ninja target. Hence, check-clang
105 # that it's not part of the default ninja target. Hence, check-clang-tools
114106 # shouldn't have any deps except :test. so that the default target is sure to
115107 # build all the deps.
116108 deps = [
99 "clang-move:ClangMoveTests",
1010 "clang-query:ClangQueryTests",
1111 "clang-tidy:ClangTidyTests",
12 "//clang-tools-extra/clangd/unittests:ClangdTests",
1312 ]
14 if (clangd_build_xpc) {
15 deps += [ "clangd/xpc:ClangdXpcTests" ]
16 }
1713 testonly = true
1814 }
0 import("//llvm/lib/DebugInfo/PDB/enable_dia.gni")
1 import("//llvm/lib/Target/targets.gni")
1 import("//llvm/lib/DebugInfo/PDB/enable_dia.gni")
22 import("//llvm/triples.gni")
33 import("//llvm/utils/gn/build/buildflags.gni")
44 import("//llvm/utils/gn/build/libs/edit/enable.gni")
112112 "DIA/DIASourceFile.cpp",
113113 "DIA/DIATable.cpp",
114114 ]
115 libs = [ "diaguids.lib" ]
115 libs = [ "diaguids.lib" ]
116116 }
117117 }