llvm/llvm/utils/gn/secondary/llvm/tools/llvm-debuginfod/BUILD.gn

import("//llvm/tools/binutils_symlinks.gni")
import("//llvm/utils/TableGen/tablegen.gni")
import("//llvm/utils/gn/build/driver_executable.gni")
import("//llvm/utils/gn/build/symlink_or_copy.gni")

tablegen("Opts") {
  visibility = [ ":llvm-debuginfod" ]
  args = [ "-gen-opt-parser-defs" ]
}

if (llvm_install_binutils_symlinks) {
  symlink_or_copy("debuginfod") {
    deps = [ ":llvm-debuginfod" ]
    source = "llvm-debuginfod"
    output = "$root_out_dir/bin/debuginfod"
  }
}

# //:llvm-debuginfod depends on this symlink target, see comment in //BUILD.gn.
group("symlinks") {
  deps = [ ":llvm-debuginfod" ]
  if (llvm_install_binutils_symlinks) {
    deps += [ ":debuginfod" ]
  }
}

driver_executable("llvm-debuginfod") {
  deps = [
    ":Opts",
    "//llvm/lib/Debuginfod",
    "//llvm/lib/Option",
    "//llvm/lib/Support",
  ]
  sources = [ "llvm-debuginfod.cpp" ]
}