blob: 09e6b47187d540e0c77439c52874d1654f227a44 [file] [log] [blame]
# Copyright 2017 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/go/go_build.gni")
# A template for an action that creates a Fuchsia Go binary.
#
# Parameters
#
# gopackage (required)
# The go package containing the main function.
#
# sdk_category (optional)
# Publication level of the library in SDKs.
# See //build/sdk/sdk_atom.gni.
#
# sdk_deps (optional)
# List of labels representing elements that should be added to SDKs
# alongside the present binary.
# Labels in the list must represent SDK-ready targets.
template("go_binary") {
go_build(target_name) {
assert(defined(invoker.gopackage),
"gopackage must be defined for $target_name")
gopackages = [ invoker.gopackage ]
forward_variables_from(invoker, "*")
}
}