1 import("//clang/lib/ARCMigrate/enable.gni")
2 import("//clang/lib/StaticAnalyzer/Frontend/enable.gni")
3 import("//llvm/utils/gn/build/toolchain/compiler.gni")
7 "//clang-tools-extra/clangd/test",
8 "//clang-tools-extra/pseudo/test",
9 "//clang-tools-extra/test",
11 "//clang/tools/scan-build",
13 "//compiler-rt/include",
14 "//compiler-rt/lib/scudo",
19 if (current_os == "linux") {
25 if (current_os == "linux" || current_os == "win") {
26 deps += [ "//compiler-rt/test/asan" ]
28 if (current_os == "linux" || current_os == "android") {
29 deps += [ "//compiler-rt/test/hwasan" ]
31 if (current_os == "linux" || current_os == "mac") {
32 deps += [ "//libunwind" ]
35 # FIXME: Add this on win after testing that it builds.
36 if (current_os != "win") {
37 deps += [ "//bolt/test" ]
44 # On POSIX, symlinks to the target can be created before the target exist,
45 # and the target can depend on the symlink targets, so that building the
46 # target ensures the symlinks exist.
47 # However, symlinks didn't exist on Windows until recently, so there the
48 # binary needs to be copied -- which requires it to exist. So the symlink step
49 # needs to run after the target that creates the binary.
50 # In the cmake build, this is done via a "postbuild" on the target, which just
51 # tacks on "&& copy out.exe out2.exe" to the link command.
52 # GN doesn't have a way to express postbuild commands. It could probably be
53 # emulated by having the link command in the toolchain be a wrapper script that
54 # reads a ".symlinks" file next to the target, and have an action write that
55 # and make the target depend on that, but then every single link has to use the
56 # wrapper (unless we do further acrobatics to use a different toolchain for
57 # targets that need symlinks) even though most links don't need symlinks.
58 # Instead, have a top-level target for each target that needs symlinks, and
59 # make that depend on the symlinks. Then the symlinks can depend on the
60 # executable. This has the effect that `ninja lld` builds lld and then creates
61 # symlinks (via this target), while `ninja bin/lld` only builds lld and doesn't
62 # update symlinks (in particular, on Windows it doesn't copy the new lld to its
64 # That seems simpler, more explicit, and good enough.
66 deps = [ "//clang/tools/driver:symlinks" ]
69 deps = [ "//lld/tools/lld:symlinks" ]
72 deps = [ "//llvm/tools/llvm-ar:symlinks" ]
74 if (current_os == "mac") {
76 deps = [ "//bolt/tools/driver:symlinks" ]
80 deps = [ "//llvm/tools/llvm-dwp:symlinks" ]
83 deps = [ "//llvm/tools/llvm-nm:symlinks" ]
85 group("llvm-cxxfilt") {
86 deps = [ "//llvm/tools/llvm-cxxfilt:symlinks" ]
88 group("llvm-debuginfod") {
89 deps = [ "//llvm/tools/llvm-debuginfod:symlinks" ]
91 group("llvm-debuginfod-find") {
92 deps = [ "//llvm/tools/llvm-debuginfod-find:symlinks" ]
94 group("llvm-libtool-darwin") {
95 deps = [ "//llvm/tools/llvm-libtool-darwin:symlinks" ]
98 deps = [ "//llvm/tools/llvm-lipo:symlinks" ]
100 group("llvm-objcopy") {
101 deps = [ "//llvm/tools/llvm-objcopy:symlinks" ]
103 group("llvm-objdump") {
104 deps = [ "//llvm/tools/llvm-objdump:symlinks" ]
107 deps = [ "//llvm/tools/llvm-rc:symlinks" ]
109 group("llvm-readobj") {
110 deps = [ "//llvm/tools/llvm-readobj:symlinks" ]
113 deps = [ "//llvm/tools/llvm-size:symlinks" ]
115 group("llvm-strings") {
116 deps = [ "//llvm/tools/llvm-strings:symlinks" ]
118 group("llvm-symbolizer") {
119 deps = [ "//llvm/tools/llvm-symbolizer:symlinks" ]
122 # A pool called "console" in the root BUILD.gn is magic and represents ninja's
123 # built-in console pool. (Requires a GN with `gn --version` >= 552353.)