| # 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("$zx_build/public/gn/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 = [ |
| "checking.cc", |
| "item.cc", |
| "mem_config.cc", |
| ] |
| deps = [ |
| ":internal.decompress-zstd", |
| "$zx/kernel/lib/efi", |
| "$zx/system/ulib/fbl", |
| "$zx/system/ulib/zircon", |
| "$zx/system/ulib/zxc", |
| "$zx/third_party/ulib/cksum", |
| ] |
| public_deps = [ |
| # <lib/zbitl/view.h> has #include <lib/cksum.h>. |
| "$zx/third_party/ulib/cksum:headers", |
| |
| # <lib/zbitl/items/mem_config.h> has #include <fbl/span.h>. |
| "$zx/system/ulib/fbl:headers", |
| |
| # <lib/zbitl/view.h> has #include <lib/fitx/result.h>. |
| "$zx/system/ulib/zxc:headers", |
| ] |
| |
| if (is_kernel) { |
| # The zbitl headers use various ktl-approved standard C++ headers. |
| deps += [ |
| "$zx/kernel/lib/ktl", |
| "$zx/kernel/lib/libc", |
| ] |
| public_deps += [ "$zx/kernel/lib/ktl:headers" ] |
| } else { |
| sources += [ |
| "fd.cc", |
| "stdio.cc", |
| ] |
| |
| if (is_fuchsia) { |
| sources += [ |
| "mapvmo.cc", |
| "vmo-read.cc", |
| "vmo.cc", |
| ] |
| deps += [ |
| "$zx/system/ulib/zircon-internal", |
| "$zx/system/ulib/zx", |
| ] |
| public_deps += [ |
| # <lib/zbitl/vmo.h> has #include <lib/zx/vmo.h>. |
| "$zx/system/ulib/zx:headers", |
| ] |
| } |
| } |
| } |
| |
| source_set("internal.decompress-zstd") { |
| sources = [ |
| "zstd-streaming.cc", |
| "zstd.cc", |
| ] |
| defines = [ "ZSTD_STATIC_LINKING_ONLY" ] |
| deps = [ "$zx/third_party/ulib/zstd:zstd-decompress-standalone" ] |
| public_deps = [ |
| # <lib/zbitl/decompress.h> has #include <lib/fitx/result.h>. |
| "$zx/system/ulib/zxc", |
| |
| # <lib/zbitl/decompress.h> has #include <fbl/span.h>. |
| "$zx/system/ulib/fbl", |
| ] |
| include_dirs = [ "include" ] |
| |
| if (is_kernel) { |
| deps += [ |
| "$zx/kernel/lib/ktl", |
| "$zx/kernel/lib/libc", |
| ] |
| } else { |
| sources += [ "default-allocator.cc" ] |
| } |
| } |
| |
| group("tests") { |
| testonly = true |
| deps = [ |
| "test:tests", |
| "testing", |
| ] |
| } |