llvm/llvm/utils/gn/secondary/llvm/tools/llvm-debuginfod-find/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-find" ]
  args = [ "-gen-opt-parser-defs" ]
}

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

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

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