reference, declarationdefinition
definition → references, declarations, derived classes, virtual overrides
reference to multiple definitions → definitions
unreferenced
    1
    2
    3
    4
    5
    6
    7
    8
    9
   10
   11
   12
   13
   14
   15
   16
   17
   18
   19
   20
   21
   22
   23
   24
   25
   26
   27
   28
   29
   30
   31
   32
   33
   34
   35
   36
   37
   38
   39
   40
   41
   42
   43
   44
   45
   46
   47
   48
   49
   50
   51
   52
   53
   54
   55
   56
   57
   58
   59
   60
   61
   62
   63
   64
   65
   66
   67
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",
    "COFF/COFFObjcopy.cpp",
    "COFF/Object.cpp",
    "COFF/Reader.cpp",
    "COFF/Writer.cpp",
    "CopyConfig.cpp",
    "ELF/ELFConfig.cpp",
    "ELF/ELFObjcopy.cpp",
    "ELF/Object.cpp",
    "MachO/MachOLayoutBuilder.cpp",
    "MachO/MachOObjcopy.cpp",
    "MachO/MachOReader.cpp",
    "MachO/MachOWriter.cpp",
    "MachO/Object.cpp",
    "llvm-objcopy.cpp",
  ]
}