Add helper build target template 'incbin_target'
This is intended for incbin-ing the output of another target. It is
a convenience wrapper around the 'incbin' target template.
Change-Id: I495f3ce1a62ae09bd234c8baf75a3a7cecbfd9ff
diff --git a/build/image/image.gni b/build/image/image.gni
index 85cc3eb..016546c 100644
--- a/build/image/image.gni
+++ b/build/image/image.gni
@@ -230,6 +230,25 @@
}
}
+template("incbin_target") {
+ incbin(target_name) {
+ forward_variables_from(invoker,
+ [
+ "testonly",
+ "deps",
+ "section",
+ ])
+ target_outputs = get_target_outputs(invoker.target)
+ target_file = target_outputs[0]
+ sources = [
+ target_file,
+ ]
+ deps = [
+ invoker.target,
+ ]
+ }
+}
+
# Build the initial RAM disk for the hypervisor.
template("initrd") {
base_out_dir = "${target_out_dir}/${target_name}"