From 768ae4274aacdea2a42994250baad764841f9318 Mon Sep 17 00:00:00 2001 From: Nico Weber Date: Wed, 2 Jan 2019 12:34:57 +0000 Subject: [PATCH] [gn build] Add some llvm/tools: llvm-size, llvm-split, llvm-strings Needed for check-llvm. Differential Revision: https://reviews.llvm.org/D56164 llvm-svn: 350212 --- llvm/utils/gn/secondary/BUILD.gn | 13 +++++++++ .../gn/secondary/llvm/tools/llvm-size/BUILD.gn | 32 +++++++++++++++++++++ .../gn/secondary/llvm/tools/llvm-split/BUILD.gn | 12 ++++++++ .../gn/secondary/llvm/tools/llvm-strings/BUILD.gn | 33 ++++++++++++++++++++++ 4 files changed, 90 insertions(+) create mode 100644 llvm/utils/gn/secondary/llvm/tools/llvm-size/BUILD.gn create mode 100644 llvm/utils/gn/secondary/llvm/tools/llvm-split/BUILD.gn create mode 100644 llvm/utils/gn/secondary/llvm/tools/llvm-strings/BUILD.gn diff --git a/llvm/utils/gn/secondary/BUILD.gn b/llvm/utils/gn/secondary/BUILD.gn index e56fedd..6ad2a2a 100644 --- a/llvm/utils/gn/secondary/BUILD.gn +++ b/llvm/utils/gn/secondary/BUILD.gn @@ -10,6 +10,9 @@ group("default") { "//llvm/tools/llvm-link", "//llvm/tools/llvm-rc", "//llvm/tools/llvm-rtdyld", + "//llvm/tools/llvm-size", + "//llvm/tools/llvm-split", + "//llvm/tools/llvm-strings", "//llvm/tools/llvm-undname", "//llvm/tools/llvm-xray", "//llvm/tools/sancov", @@ -89,6 +92,16 @@ group("llvm-readobj") { "//llvm/tools/llvm-readobj:symlinks", ] } +group("llvm-size") { + deps = [ + "//llvm/tools/llvm-size:symlinks", + ] +} +group("llvm-strings") { + deps = [ + "//llvm/tools/llvm-strings:symlinks", + ] +} group("llvm-symbolizer") { deps = [ "//llvm/tools/llvm-symbolizer:symlinks", diff --git a/llvm/utils/gn/secondary/llvm/tools/llvm-size/BUILD.gn b/llvm/utils/gn/secondary/llvm/tools/llvm-size/BUILD.gn new file mode 100644 index 0000000..03bc544 --- /dev/null +++ b/llvm/utils/gn/secondary/llvm/tools/llvm-size/BUILD.gn @@ -0,0 +1,32 @@ +import("//llvm/tools/binutils_symlinks.gni") +import("//llvm/utils/gn/build/symlink_or_copy.gni") + +if (llvm_install_binutils_symlinks) { + symlink_or_copy("size") { + deps = [ + ":llvm-size", + ] + source = "llvm-size" + output = "$root_out_dir/bin/size" + } +} + +# //:llvm-size depends on this symlink target, see comment in //BUILD.gn. +group("symlinks") { + deps = [ + ":llvm-size", + ] + if (llvm_install_binutils_symlinks) { + deps += [ ":size" ] + } +} + +executable("llvm-size") { + deps = [ + "//llvm/lib/Object", + "//llvm/lib/Support", + ] + sources = [ + "llvm-size.cpp", + ] +} diff --git a/llvm/utils/gn/secondary/llvm/tools/llvm-split/BUILD.gn b/llvm/utils/gn/secondary/llvm/tools/llvm-split/BUILD.gn new file mode 100644 index 0000000..375dce3 --- /dev/null +++ b/llvm/utils/gn/secondary/llvm/tools/llvm-split/BUILD.gn @@ -0,0 +1,12 @@ +executable("llvm-split") { + deps = [ + "//llvm/lib/Bitcode/Writer", + "//llvm/lib/IR", + "//llvm/lib/IRReader", + "//llvm/lib/Support", + "//llvm/lib/Transforms/Utils", + ] + sources = [ + "llvm-split.cpp", + ] +} diff --git a/llvm/utils/gn/secondary/llvm/tools/llvm-strings/BUILD.gn b/llvm/utils/gn/secondary/llvm/tools/llvm-strings/BUILD.gn new file mode 100644 index 0000000..dddf3a2 --- /dev/null +++ b/llvm/utils/gn/secondary/llvm/tools/llvm-strings/BUILD.gn @@ -0,0 +1,33 @@ +import("//llvm/tools/binutils_symlinks.gni") +import("//llvm/utils/gn/build/symlink_or_copy.gni") + +if (llvm_install_binutils_symlinks) { + symlink_or_copy("strings") { + deps = [ + ":llvm-strings", + ] + source = "llvm-strings" + output = "$root_out_dir/bin/strings" + } +} + +# //:llvm-strings depends on this symlink target, see comment in //BUILD.gn. +group("symlinks") { + deps = [ + ":llvm-strings", + ] + if (llvm_install_binutils_symlinks) { + deps += [ ":strings" ] + } +} + +executable("llvm-strings") { + deps = [ + "//llvm/lib/IR", + "//llvm/lib/Object", + "//llvm/lib/Support", + ] + sources = [ + "llvm-strings.cpp", + ] +} -- 2.7.4