chromium/chrome/updater/tools/BUILD.gn

# Copyright 2019 The Chromium Authors
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.

import("//chrome/updater/branding.gni")
import("//testing/test.gni")

group("tools") {
  deps = [ ":${updater_product_full_name}Util" ]
  if (is_win) {
    deps += [ ":tag" ]
  }
}

executable("tag_exe") {
  sources = [ "tag_main.cc" ]
  deps = [
    "//base",
    "//chrome/updater:tagging",
  ]
}

copy("tag") {
  # For arm64 builds, we need to create an x86_64 tag executable.
  if (current_cpu != "x64" && is_win) {
    tag_tool = ":tag_exe(//build/toolchain/win:win_clang_x64)"
  } else {
    tag_tool = ":tag_exe"
  }
  if (is_win) {
    suffix = ".exe"
  } else {
    suffix = ""
  }
  sources = [ get_label_info(tag_tool, "root_out_dir") + "/tag_exe" + suffix ]
  outputs = [ "$root_build_dir/tag.exe" ]
  deps = [ tag_tool ]
}

if (is_mac) {
  executable("keystone_ticketstore_tool") {
    sources = [ "keystone_ticketstore_tool.mm" ]
    deps = [
      "//base",
      "//chrome/updater:ks_ticket",
    ]

    frameworks = [ "Foundation.framework" ]
  }
}

executable("${updater_product_full_name}Util") {
  sources = [ "updater_util.cc" ]
  deps = [
    "//base",
    "//chrome/enterprise_companion/device_management_storage",
    "//chrome/updater:base",
    "//chrome/updater:constants_prod",
    "//chrome/updater:external_constants",
    "//chrome/updater/protos:omaha_proto",
    "//components/policy/proto",
  ]
}