blob: 5c1d50a474c82221b4a9fb39304d6fe08f4a8f0c [file] [log] [blame]
# Copyright 2025 The Fuchsia Authors
#
# Use of this source code is governed by a MIT-style
# license that can be found in the LICENSE file or at
# https://opensource.org/licenses/MIT
import("//build/devicetree/devicetree.gni")
import("//build/zircon/embedded_blob.gni")
config("include") {
include_dirs = [ "include" ]
}
source_set("boot-shim-utils") {
sources = [
"devicetree-bootloader-files-item.cc",
"include/lib/boot-shim-utils/devicetree-bootloader-files-item.h",
]
public_deps = [
"//sdk/lib/fit",
"//zircon/kernel/phys/lib/boot-shim",
]
public_configs = [ ":include" ]
}
template("embedded_dtb") {
dtb_target = target_name + "_dtb"
dtb(dtb_target) {
sources = [ invoker.dts ]
}
embedded_blob(target_name) {
deps = [ ":${dtb_target}" ]
sources = get_target_outputs(deps[0])
}
}
embedded_dtb("chosen_bootloader_files_blob") {
dts = "chosen-bootloader-files.dts"
}
embedded_dtb("chosen_no_bootloader_files_blob") {
dts = "chosen-no-bootloader-files.dts"
}
if (!is_kernel) {
import("//build/components.gni")
import("//build/test.gni")
group("tests") {
testonly = true
deps = [
":boot-shim-utils-unittests",
":boot-shim-utils-unittests($host_toolchain)",
]
}
test("boot-shim-utils-unittests") {
sources = [ "devicetree-bootloader-files-item-tests.cc" ]
deps = [
":boot-shim-utils",
":chosen_bootloader_files_blob",
":chosen_no_bootloader_files_blob",
"//sdk/lib/fit",
"//src/lib/zbitl",
"//zircon/system/ulib/zxtest",
]
}
fuchsia_unittest_package("boot-shim-utils-tests") {
deps = [ ":boot-shim-utils-unittests" ]
}
}