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/test",
10 "//clang/tools/scan-build",
12 "//compiler-rt/include",
13 "//compiler-rt/lib/scudo",
18 # FIXME: Reenable once libc hand-in-hand is figured out.
19 if (false && current_os == "linux") {
25 if (current_os == "linux" || current_os == "win" || current_os == "mac") {
26 deps += [ "//compiler-rt/test/asan" ]
29 if (current_os == "linux" || current_os == "mac") {
30 deps += [ "//compiler-rt/test/lsan" ]
33 if (current_os == "linux" || current_os == "android") {
34 deps += [ "//compiler-rt/test/hwasan" ]
36 if (current_os == "linux" || current_os == "mac") {
37 deps += [ "//libunwind" ]
40 # FIXME: Add this on win after testing that it builds.
41 if (current_os != "win") {
42 deps += [ "//bolt/test" ]
49 # On POSIX, symlinks to the target can be created before the target exist,
50 # and the target can depend on the symlink targets, so that building the
51 # target ensures the symlinks exist.
52 # However, symlinks didn't exist on Windows until recently, so there the
53 # binary needs to be copied -- which requires it to exist. So the symlink step
54 # needs to run after the target that creates the binary.
55 # In the cmake build, this is done via a "postbuild" on the target, which just
56 # tacks on "&& copy out.exe out2.exe" to the link command.
57 # GN doesn't have a way to express postbuild commands. It could probably be
58 # emulated by having the link command in the toolchain be a wrapper script that
59 # reads a ".symlinks" file next to the target, and have an action write that
60 # and make the target depend on that, but then every single link has to use the
61 # wrapper (unless we do further acrobatics to use a different toolchain for
62 # targets that need symlinks) even though most links don't need symlinks.
63 # Instead, have a top-level target for each target that needs symlinks, and
64 # make that depend on the symlinks. Then the symlinks can depend on the
65 # executable. This has the effect that `ninja lld` builds lld and then creates
66 # symlinks (via this target), while `ninja bin/lld` only builds lld and doesn't
67 # update symlinks (in particular, on Windows it doesn't copy the new lld to its
69 # That seems simpler, more explicit, and good enough.
71 deps = [ "//clang/tools/driver:symlinks" ]
74 deps = [ "//lld/tools/lld:symlinks" ]
77 deps = [ "//llvm/tools/llvm-ar:symlinks" ]
79 if (current_os == "mac") {
81 deps = [ "//bolt/tools/driver:symlinks" ]
85 deps = [ "//llvm/tools/llvm-dwp:symlinks" ]
88 deps = [ "//llvm/tools/llvm-nm:symlinks" ]
90 group("llvm-cxxfilt") {
91 deps = [ "//llvm/tools/llvm-cxxfilt:symlinks" ]
93 group("llvm-debuginfod") {
94 deps = [ "//llvm/tools/llvm-debuginfod:symlinks" ]
96 group("llvm-debuginfod-find") {
97 deps = [ "//llvm/tools/llvm-debuginfod-find:symlinks" ]
99 group("llvm-libtool-darwin") {
100 deps = [ "//llvm/tools/llvm-libtool-darwin:symlinks" ]
103 deps = [ "//llvm/tools/llvm-lipo:symlinks" ]
105 group("llvm-objcopy") {
106 deps = [ "//llvm/tools/llvm-objcopy:symlinks" ]
108 group("llvm-objdump") {
109 deps = [ "//llvm/tools/llvm-objdump:symlinks" ]
112 deps = [ "//llvm/tools/llvm-rc:symlinks" ]
114 group("llvm-readobj") {
115 deps = [ "//llvm/tools/llvm-readobj:symlinks" ]
118 deps = [ "//llvm/tools/llvm-size:symlinks" ]
120 group("llvm-strings") {
121 deps = [ "//llvm/tools/llvm-strings:symlinks" ]
123 group("llvm-symbolizer") {
124 deps = [ "//llvm/tools/llvm-symbolizer:symlinks" ]
127 # A pool called "console" in the root BUILD.gn is magic and represents ninja's
128 # built-in console pool. (Requires a GN with `gn --version` >= 552353.)