blob: a78838f2599fd577b5e839d38b715d7c656439cd [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: same as go_build, along with
#
# gopackage (optional)
# The go package containing the main function.
#
# library (optional)
# The GN label for the go_library containing the main function. Alternative
# to gopackage.
#
template("go_binary") {
go_build(target_name) {
# TODO(https://fxbug.dev/42136747): Deprecate `gopackage` in favor of `library`.
if (defined(invoker.gopackage)) {
gopackages = [ invoker.gopackage ]
}
forward_variables_from(invoker, "*")
}
}