blob: 959bb30551ce7b1255757ebf6c68f4e4d30cf551 [file] [log] [blame]
# Copyright 2018 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/package.gni")
# A package() that just contains a single binary created as an executable()
# under the name of the rule. We currently prefer packages with single binaries,
# because only such binaries can be executed directly from the package name in
# appmgr.
template("executable_package") {
binary_rule = "${target_name}_bin"
binary_name = target_name
executable(binary_rule) {
output_name = "${binary_name}"
forward_variables_from(invoker,
[
"sources",
"deps",
"public_deps",
"testonly",
])
}
package(target_name) {
forward_variables_from(invoker,
[
"testonly",
"meta",
"tests",
"resources",
])
deps = [
":${binary_rule}",
]
binary = binary_name
}
}