blob: 6249ecf29be43667914757b9ab3b88e998f7168a [file] [log] [blame]
# Copyright 2019 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/public/gn/fuzzer.gni")
import("$zx/public/gn/resource.gni")
import("$zx/public/gn/zbi.gni")
zx_library("zbi-bootfs") {
sdk_headers = [ "zbi-bootfs/zbi-bootfs.h" ]
sdk = "shared"
shared = true
sources = [
"zbi-bootfs.cc",
]
public_deps = [
"$zx/system/fidl/fuchsia-hardware-skipblock:c",
"$zx/system/ulib/zx",
]
deps = [
"$zx/system/fidl/fuchsia-io:c",
"$zx/system/ulib/bootfs",
"$zx/system/ulib/fdio",
"$zx/system/ulib/fzl",
"$zx/system/ulib/hermetic-decompressor:headers",
"$zx/third_party/ulib/lz4",
"$zx/third_party/ulib/zstd",
]
}
group("test") {
testonly = true
deps = [
":zbi-bootfs-fuzzer",
":zbi-bootfs-test",
]
}
zx_test("zbi-bootfs-test") {
sources = [
"zbi-bootfs-test.cc",
]
deps = [
"$zx/system/ulib/fzl",
"$zx/system/ulib/zbi-bootfs",
"$zx/system/ulib/zxtest",
]
data_deps = [
":generated-lz4f-zbi",
":generated-zstd-zbi",
]
}
resource("generated-lz4f-zbi") {
sources = [
"$target_out_dir/generated-lz4f.zbi",
]
outputs = [
"testdata/zbi-bootfs/generated-lz4f.zbi",
]
deps = [
":generated-lz4f",
]
testonly = true
}
resource("generated-zstd-zbi") {
sources = [
"$target_out_dir/generated-zstd.zbi",
]
outputs = [
"testdata/zbi-bootfs/generated-zstd.zbi",
]
deps = [
":generated-zstd",
]
testonly = true
}
# Generate zbi images for tests.
zbi("generated-zstd") {
compress = "zstd"
testonly = true
cpu = ""
deps = [
":create-zbi-image",
]
}
zbi("generated-lz4f") {
compress = "lz4f"
testonly = true
cpu = ""
deps = [
":create-zbi-image",
]
}
zbi_input("create-zbi-image") {
testonly = true
sources = [
"$zx/system/ulib/zbi-bootfs/test/payload/",
]
}
fuzzer("zbi-bootfs-fuzzer") {
sources = [
"zbi-bootfs-fuzzer.cc",
]
deps = [
"$zx/system/ulib/zbi-bootfs",
]
}