blob: 27885665253c5785cfd1e65ef56edc545e476ada [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.
#
# use_prebuilt_go (optional)
# If true, use a prebuilt go toolchain, rather than building the toolchain.
# If not set, defaults to false when targetting Fuchsia and true otherwise.
#
# 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.
#
# check_sources (optional)
# Boolean indicating whether or not the source list should be verified against
# the generated dep file.
template("go_binary") {
go_build(target_name) {
hermetic_deps = false
assert(defined(invoker.gopackage),
"gopackage must be defined for $target_name")
gopackages = [ invoker.gopackage ]
forward_variables_from(invoker, "*")
}
}