blob: 16b4c986d74757fd61f2f88e885a31b33d0cca82 [file] [log] [blame]
Inna Palantff3f07a2019-07-11 16:15:26 -07001import("//clang/lib/ARCMigrate/enable.gni")
2import("//clang/lib/StaticAnalyzer/Frontend/enable.gni")
3import("//llvm/utils/gn/build/toolchain/compiler.gni")
4
5group("default") {
6 deps = [
Chih-Hung Hsieh08600532019-12-19 15:55:38 -08007 "//clang-tools-extra/clangd/test",
8 "//clang-tools-extra/test",
Inna Palantff3f07a2019-07-11 16:15:26 -07009 "//clang/test",
Thiébaud Weksteene40e7362020-10-28 15:03:00 +010010 "//clang/tools/scan-build",
Chris Wailesbcf972c2021-10-21 11:03:28 -070011 "//compiler-rt",
Thiébaud Weksteene40e7362020-10-28 15:03:00 +010012 "//compiler-rt/include",
Jeff Vander Stoep247d86b2020-08-11 14:27:44 +020013 "//compiler-rt/lib/scudo",
Inna Palantff3f07a2019-07-11 16:15:26 -070014 "//lld/test",
15 "//llvm/test",
16 ]
Chih-Hung Hsieh08600532019-12-19 15:55:38 -080017 if (current_os == "linux") {
18 deps += [
Chih-Hung Hsieh08600532019-12-19 15:55:38 -080019 "//libcxx",
20 "//libcxxabi",
Chih-Hung Hsieh08600532019-12-19 15:55:38 -080021 ]
22 }
23 if (current_os == "linux" || current_os == "android") {
24 deps += [ "//compiler-rt/test/hwasan" ]
25 }
Chris Wailesbcf972c2021-10-21 11:03:28 -070026 if (current_os == "linux" || current_os == "mac") {
27 deps += [ "//libunwind" ]
28 }
Inna Palantff3f07a2019-07-11 16:15:26 -070029
30 testonly = true
31}
32
33# Symlink handling.
34# On POSIX, symlinks to the target can be created before the target exist,
35# and the target can depend on the symlink targets, so that building the
36# target ensures the symlinks exist.
37# However, symlinks didn't exist on Windows until recently, so there the
38# binary needs to be copied -- which requires it to exist. So the symlink step
39# needs to run after the target that creates the binary.
40# In the cmake build, this is done via a "postbuild" on the target, which just
41# tacks on "&& copy out.exe out2.exe" to the link command.
42# GN doesn't have a way to express postbuild commands. It could probably be
43# emulated by having the link command in the toolchain be a wrapper script that
44# reads a ".symlinks" file next to the target, and have an action write that
45# and make the target depend on that, but then every single link has to use the
46# wrapper (unless we do further acrobatics to use a different toolchain for
47# targets that need symlinks) even though most links don't need symlinks.
48# Instead, have a top-level target for each target that needs symlinks, and
49# make that depend on the symlinks. Then the symlinks can depend on the
50# executable. This has the effect that `ninja lld` builds lld and then creates
51# symlinks (via this target), while `ninja bin/lld` only builds lld and doesn't
52# update symlinks (in particular, on Windows it doesn't copy the new lld to its
53# new locations).
54# That seems simpler, more explicit, and good enough.
55group("clang") {
Thiébaud Weksteene40e7362020-10-28 15:03:00 +010056 deps = [ "//clang/tools/driver:symlinks" ]
Inna Palantff3f07a2019-07-11 16:15:26 -070057}
58group("lld") {
Thiébaud Weksteene40e7362020-10-28 15:03:00 +010059 deps = [ "//lld/tools/lld:symlinks" ]
Inna Palantff3f07a2019-07-11 16:15:26 -070060}
61group("llvm-ar") {
Thiébaud Weksteene40e7362020-10-28 15:03:00 +010062 deps = [ "//llvm/tools/llvm-ar:symlinks" ]
Inna Palantff3f07a2019-07-11 16:15:26 -070063}
64group("llvm-dwp") {
Thiébaud Weksteene40e7362020-10-28 15:03:00 +010065 deps = [ "//llvm/tools/llvm-dwp:symlinks" ]
Inna Palantff3f07a2019-07-11 16:15:26 -070066}
67group("llvm-nm") {
Thiébaud Weksteene40e7362020-10-28 15:03:00 +010068 deps = [ "//llvm/tools/llvm-nm:symlinks" ]
Inna Palantff3f07a2019-07-11 16:15:26 -070069}
70group("llvm-cxxfilt") {
Thiébaud Weksteene40e7362020-10-28 15:03:00 +010071 deps = [ "//llvm/tools/llvm-cxxfilt:symlinks" ]
Inna Palantff3f07a2019-07-11 16:15:26 -070072}
73group("llvm-objcopy") {
Thiébaud Weksteene40e7362020-10-28 15:03:00 +010074 deps = [ "//llvm/tools/llvm-objcopy:symlinks" ]
Inna Palantff3f07a2019-07-11 16:15:26 -070075}
76group("llvm-objdump") {
Thiébaud Weksteene40e7362020-10-28 15:03:00 +010077 deps = [ "//llvm/tools/llvm-objdump:symlinks" ]
Inna Palantff3f07a2019-07-11 16:15:26 -070078}
Chris Wailesbcf972c2021-10-21 11:03:28 -070079group("llvm-rc") {
80 deps = [ "//llvm/tools/llvm-rc:symlinks" ]
81}
Inna Palantff3f07a2019-07-11 16:15:26 -070082group("llvm-readobj") {
Thiébaud Weksteene40e7362020-10-28 15:03:00 +010083 deps = [ "//llvm/tools/llvm-readobj:symlinks" ]
Inna Palantff3f07a2019-07-11 16:15:26 -070084}
85group("llvm-size") {
Thiébaud Weksteene40e7362020-10-28 15:03:00 +010086 deps = [ "//llvm/tools/llvm-size:symlinks" ]
Inna Palantff3f07a2019-07-11 16:15:26 -070087}
88group("llvm-strings") {
Thiébaud Weksteene40e7362020-10-28 15:03:00 +010089 deps = [ "//llvm/tools/llvm-strings:symlinks" ]
Inna Palantff3f07a2019-07-11 16:15:26 -070090}
91group("llvm-symbolizer") {
Thiébaud Weksteene40e7362020-10-28 15:03:00 +010092 deps = [ "//llvm/tools/llvm-symbolizer:symlinks" ]
Inna Palantff3f07a2019-07-11 16:15:26 -070093}
94
95# A pool called "console" in the root BUILD.gn is magic and represents ninja's
96# built-in console pool. (Requires a GN with `gn --version` >= 552353.)
97pool("console") {
98 depth = 1
99}