| # Copyright 2019 The Fuchsia Authors. All rights reserved. |
| # Use of this source code is governed by a BSD-style license that can be |
| # found in the LICENSE file. |
| |
| import("//build/config/fuchsia/zircon.gni") |
| import("//build/sdk/sdk_atom.gni") |
| |
| template("zircon_host_tool") { |
| assert(current_toolchain == host_toolchain, |
| "The $target_name tool is host-only.") |
| |
| tool_name = target_name |
| |
| copy(tool_name) { |
| sources = [ |
| "$zircon_root_build_dir/${invoker.path}", |
| ] |
| outputs = [ |
| "$root_out_dir/$tool_name", |
| ] |
| } |
| |
| sdk_atom("${tool_name}_sdk") { |
| id = "sdk://tools/$tool_name" |
| category = "partner" |
| |
| meta = { |
| dest = "tools/$tool_name-meta.json" |
| schema = "host_tool" |
| value = { |
| type = "host_tool" |
| name = tool_name |
| root = "tools" |
| files = [ "tools/$tool_name" ] |
| } |
| } |
| |
| files = [ |
| { |
| source = "$zircon_root_build_dir/${invoker.path}" |
| dest = "tools/$tool_name" |
| }, |
| ] |
| } |
| } |