blob: af40420846bf4de3f97d58d851eae04835ad6861 [file] [log] [blame]
# 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/migrated_targets.gni")
zx_library("zbitl") {
# TODO: revist the following two specifications after the zircon-to-fuchsia
# build migration. They seem currently required in order to export the host
# compilation of this library to the fuchsia build.
sdk = "source"
sdk_headers = []
sources = [
"checking.cc",
"cpu-topology.cc",
"debugdata.cc",
"efi.cc",
"item.cc",
]
deps = [
":internal.decompress-zstd",
"//src/zircon/lib/zircon",
"//zircon/system/ulib/fbl",
"//zircon/system/ulib/zx",
"//zircon/third_party/ulib/cksum",
]
public_deps = [
"//sdk/lib/stdcompat",
# Many files have #include <lib/zbi-format/zbi.h>.
"//sdk/lib/zbi-format",
# <lib/zbitl/view.h> has #include <lib/cksum.h>.
"//zircon/third_party/ulib/cksum:headers",
# <lib/zbitl/items/bootfs.h> has #include <fbl/alloc_checker.h>.
"//zircon/system/ulib/fbl:headers",
# <lib/zbitl/view.h> has #include <lib/fit/result.h>.
"//zircon/system/ulib/zx:headers",
# <lib/zbitl/efi.h> has #include <efi/protocol/file.h>.
"//zircon/kernel/lib/efi:headers",
]
if (is_kernel) {
# The zbitl headers use various ktl-approved standard C++ headers.
deps += [
"//zircon/kernel/lib/ktl",
"//zircon/kernel/lib/libc",
]
public_deps += [ "//zircon/kernel/lib/ktl:headers" ]
} else {
sources += [
"fd.cc",
"stdio.cc",
]
if (is_fuchsia) {
sources += [
"mapvmo.cc",
"vmo-read.cc",
"vmo.cc",
]
deps += [
"//zircon/system/ulib/zircon-internal",
"//zircon/system/ulib/zx",
]
public_deps += [
# <lib/zbitl/vmo.h> has #include <lib/zx/vmo.h>.
"//zircon/system/ulib/zx:headers",
]
}
}
}
source_set("internal.decompress-zstd") {
sources = [
"zstd-streaming.cc",
"zstd.cc",
]
defines = [ "ZSTD_STATIC_LINKING_ONLY" ]
deps = [ "//third_party/zstd:zstd-decompress-standalone" ]
public_deps = [
"//sdk/lib/stdcompat",
# Many files have #include <lib/zbi-format/zbi.h>.
"//sdk/lib/zbi-format",
# <lib/zbitl/decompress.h> has #include <lib/fit/result.h>.
"//zircon/system/ulib/zx",
]
include_dirs = [ "include" ]
if (is_kernel) {
deps += [
"//zircon/kernel/lib/ktl",
"//zircon/kernel/lib/libc",
]
} else {
sources += [ "default-allocator.cc" ]
}
}
group("tests") {
testonly = true
deps = [ "tests" ]
}