No need for a loop to get a fixed number of arguments.
Change-Id: I902eeafa535ffe9d99f1062e186d26fa132c7a40
diff --git a/build/image/image.gni b/build/image/image.gni
index 02489f0..9866a24 100644
--- a/build/image/image.gni
+++ b/build/image/image.gni
@@ -146,25 +146,16 @@
# 2. Number of cores.
# 3. File name for the VM image.
# 4. Build target for the VM.
- #
- # TODO: is there a less hacky way to do this?
if (defined(invoker.secondary_vms)) {
foreach(vm, invoker.secondary_vms) {
- args += [ "--secondary_vm" ]
-
- # This is a hack to find the field which names the build target for the
- # VM so it can be added to the dependencies and the image path be
- # passed to the script. The target will be a path or have a semicolon
- # so getting the label name will yield a diferent value. The other
- # fields are simple text so won't change.
- foreach(field, vm) {
- if (get_label_info(field, "name") != field) {
- deps += [ field ]
- args += [ vm_dir + get_label_info(field, "name") + ".bin" ]
- } else {
- args += [ field ]
- }
- }
+ deps += [ vm[3] ]
+ args += [
+ "--secondary_vm",
+ vm[0],
+ vm[1],
+ vm[2],
+ vm_dir + get_label_info(vm[3], "name") + ".bin",
+ ]
}
}