forked from llvm-mirror/llvm
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[gn build] Add build file for llvm-objcopy
Needed by check-lld. This should've been part of r349486 but I messed up. Differential Revision: https://reviews.llvm.org/D55831 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@349598 91177308-0d34-0410-b5e6-96231b3b80d8
- Loading branch information
Showing
2 changed files
with
63 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
import("//llvm/tools/binutils_symlinks.gni") | ||
import("//llvm/utils/TableGen/tablegen.gni") | ||
import("//llvm/utils/gn/build/symlink_or_copy.gni") | ||
|
||
tablegen("ObjcopyOpts") { | ||
visibility = [ ":llvm-objcopy" ] | ||
args = [ "-gen-opt-parser-defs" ] | ||
} | ||
|
||
tablegen("StripOpts") { | ||
visibility = [ ":llvm-objcopy" ] | ||
args = [ "-gen-opt-parser-defs" ] | ||
} | ||
|
||
symlinks = [ "llvm-strip" ] | ||
if (llvm_install_binutils_symlinks) { | ||
symlinks += [ | ||
"objcopy", | ||
"strip", | ||
] | ||
} | ||
foreach(target, symlinks) { | ||
symlink_or_copy(target) { | ||
deps = [ | ||
":llvm-objcopy", | ||
] | ||
source = "llvm-objcopy" | ||
output = "$root_out_dir/bin/$target" | ||
} | ||
} | ||
|
||
# //:llvm-objcopy depends on this symlink target, see comment in //BUILD.gn. | ||
group("symlinks") { | ||
deps = [] | ||
foreach(target, symlinks) { | ||
deps += [ ":$target" ] | ||
} | ||
} | ||
|
||
executable("llvm-objcopy") { | ||
deps = [ | ||
":ObjcopyOpts", | ||
":StripOpts", | ||
"//llvm/lib/MC", | ||
"//llvm/lib/Object", | ||
"//llvm/lib/Option", | ||
"//llvm/lib/Support", | ||
] | ||
include_dirs = [ "." ] | ||
sources = [ | ||
"Buffer.cpp", | ||
"CopyConfig.cpp", | ||
"ELF/ELFObjcopy.cpp", | ||
"ELF/Object.cpp", | ||
"llvm-objcopy.cpp", | ||
] | ||
} |