| # 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") { |
| host = true |
| kernel = true |
| static = true |
| |
| # 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 = [] |
| sdk_migrated = true |
| |
| sources = [ |
| "item.cc", |
| "mem_config.cc", |
| "view.cc", |
| ] |
| deps = [ |
| ":internal.decompress-zstd", |
| "//src/zircon/lib/zircon", |
| "//zircon/kernel/lib/efi", |
| "//zircon/system/ulib/fbl", |
| "//zircon/system/ulib/zxc", |
| "//zircon/third_party/ulib/cksum", |
| ] |
| public_deps = [ |
| "//sdk/lib/stdcompat", |
| |
| # <lib/zbitl/view.h> has #include <lib/cksum.h>. |
| "//zircon/third_party/ulib/cksum:headers", |
| |
| # <lib/zbitl/items/mem_config.h> has #include <fbl/span.h>. |
| "//zircon/system/ulib/fbl:headers", |
| |
| # <lib/zbitl/view.h> has #include <lib/fitx/result.h>. |
| "//zircon/system/ulib/zxc: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", |
| |
| # <lib/zbitl/decompress.h> has #include <lib/fitx/result.h>. |
| "//zircon/system/ulib/zxc", |
| |
| # <lib/zbitl/decompress.h> has #include <fbl/span.h>. |
| "//zircon/system/ulib/fbl", |
| ] |
| 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 = [ |
| "test:tests", |
| "testing", |
| ] |
| } |