blob: 00a4736efb9f5fab492c223b76a7cb9b09944521 [file] [edit]
# Copyright 2020 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/zircon/zx_library.gni")
# Common variables for our SDK and in-tree targets.
common_vars = {
sdk = "source"
sdk_headers = [
"lib/zircon_boot/android_boot_image.h",
"lib/zircon_boot/zbi_utils.h",
"lib/zircon_boot/zircon_boot.h",
]
sources = [
"android_boot_image.c",
"utils.h",
"zbi_utils.c",
"zircon_boot.c",
"zircon_ramboot.c",
"zircon_ramboot.h",
"zircon_vboot.c",
"zircon_vboot.h",
]
public_deps = [ "//sdk/lib/zbi-format" ]
deps = [ "//sdk/lib/zbi-format:internal" ]
}
# SDK library.
zx_library("zircon_boot") {
forward_variables_from(common_vars, "*")
# TODO(https://fxbug.dev/331991540): Determine an appropriate solution for building firmware SDK.
sdk_publishable = "firmware_sdk"
public_deps += [
"//src/firmware/lib/abr",
"//src/firmware/lib/zbi",
"//third_party/android/platform/external/avb",
]
}
# Common variables for in-tree targets.
# This is necessary because in-tree targets use //zircon/system/public
# as the sysroot dependency, which is not available to sdk_publishable
# targets.
in_tree_vars = {
forward_variables_from(common_vars, "*")
public_deps += [
"//src/firmware/lib/abr:in_tree",
"//src/firmware/lib/zbi:in_tree",
]
# For in-tree build, use the library target without sysdeps. Final
# executable target or toolchain need to provide the implementation
# accordingly.
public_deps += [ "//third_party/android/platform/external/avb:lib" ]
deps += [ "//zircon/system/public" ]
}
# Default in-tree library.
zx_library("in_tree") {
forward_variables_from(in_tree_vars, "*")
}
# Config to enable the internal bootfs APIs.
config("internal_bootfs") {
defines = [ "ZIRCON_BOOT_USE_INTERNAL_BOOTFS" ]
}
# In-tree library with internal bootfs APIs enabled.
zx_library("in_tree_with_internal_bootfs") {
forward_variables_from(in_tree_vars, "*")
public_configs = [ ":internal_bootfs" ]
# These APIs should not be used by any new devices, only for legacy support
# of existing devices, so nothing in-tree should need them except us and our
# tests.
visibility = [ "./*" ]
}
source_set("gpt_boot_demo_lib") {
sources = [
"gpt_boot_demo.cc",
"gpt_boot_reference.c",
]
deps = [
":in_tree",
"//src/firmware/lib/storage",
"//third_party/android/platform/external/avb:sysdeps-posix",
]
}
executable("gpt_boot_demo_exe") {
output_name = "gpt_boot_demo"
deps = [ ":gpt_boot_demo_lib" ]
}
group("gpt_boot_demo") {
deps = [ ":gpt_boot_demo_exe($host_toolchain)" ]
}