| # Copyright 2026 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. | |
| load("//build/bazel/rules/cc:fx_cc_library.bzl", "fx_cc_library") | |
| package(default_applicable_licenses = ["//:license"]) | |
| fx_cc_library( | |
| name = "journal", | |
| srcs = [ | |
| "header_view.cc", | |
| "initializer.cc", | |
| ] + select({ | |
| "@platforms//os:fuchsia": [ | |
| "background_executor.cc", | |
| "data_streamer.cc", | |
| "entry_view.cc", | |
| "entry_view.h", | |
| "format_assertions.h", | |
| "journal.cc", | |
| "journal_writer.cc", | |
| "replay.cc", | |
| "replay_tree.h", | |
| "superblock.cc", | |
| ], | |
| "//conditions:default": [], | |
| }), | |
| hdrs = [ | |
| "background_executor.h", | |
| "data_streamer.h", | |
| "format.h", | |
| "header_view.h", | |
| "initializer.h", | |
| "journal.h", | |
| "journal_writer.h", | |
| "replay.h", | |
| "superblock.h", | |
| ], | |
| build_flags = ["//build/config:all_source"], | |
| friend = [":*"], | |
| implementation_deps = [ | |
| "//zircon/third_party/ulib/cksum", | |
| ] + select({ | |
| "@platforms//os:fuchsia": [ | |
| "//sdk/lib/syslog/cpp", | |
| "//zircon/system/ulib/sync", | |
| "//zircon/third_party/ulib/safemath", | |
| ], | |
| "//conditions:default": [], | |
| }), | |
| visibility = [ | |
| "//build/fuzzing:__pkg__", | |
| "//src/storage/blobfs:__pkg__", | |
| "//src/storage/f2fs:__pkg__", | |
| "//src/storage/minfs:__subpackages__", | |
| ], | |
| deps = [ | |
| "//sdk/lib/fit", | |
| "//sdk/lib/fit-promise", | |
| "//src/storage/lib/block_protocol:block_fifo", | |
| "//src/storage/lib/buffer", | |
| "//src/storage/lib/operation", | |
| "//src/storage/lib/range", | |
| "//src/storage/lib/vfs/cpp/transaction", | |
| "//zircon/system/ulib/zx", | |
| ], | |
| ) | |
| # TODO(https://fxbug.dev/570694755): Verify whether fuzz-utils should use target_compatible_with (was not gated by if (is_fuchsia) in GN). | |
| fx_cc_library( | |
| name = "fuzz-utils", | |
| srcs = ["fuzzer_utils.cc"], | |
| hdrs = ["fuzzer_utils.h"], | |
| # fuzzer_utils.h unguardedly includes <lib/zx/vmo.h>. | |
| target_compatible_with = ["@platforms//os:fuchsia"], | |
| deps = [ | |
| ":journal", | |
| "//src/storage/lib/block_protocol:block_fifo", | |
| "//src/storage/lib/buffer", | |
| "//src/storage/lib/operation", | |
| "//src/storage/lib/vfs/cpp/transaction", | |
| "//zircon/system/ulib/zx", | |
| ], | |
| alwayslink = True, | |
| ) |