xref: /aosp_15_r20/external/pigweed/pw_blob_store/BUILD.bazel (revision 61c4878ac05f98d0ceed94b57d316916de578985)
1# Copyright 2020 The Pigweed Authors
2#
3# Licensed under the Apache License, Version 2.0 (the "License"); you may not
4# use this file except in compliance with the License. You may obtain a copy of
5# the License at
6#
7#     https://www.apache.org/licenses/LICENSE-2.0
8#
9# Unless required by applicable law or agreed to in writing, software
10# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
11# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
12# License for the specific language governing permissions and limitations under
13# the License.
14
15load("//pw_unit_test:pw_cc_test.bzl", "pw_cc_test")
16
17package(default_visibility = ["//visibility:public"])
18
19licenses(["notice"])
20
21cc_library(
22    name = "pw_blob_store",
23    srcs = ["blob_store.cc"],
24    hdrs = [
25        "public/pw_blob_store/blob_store.h",
26        "public/pw_blob_store/internal/metadata_format.h",
27    ],
28    strip_include_prefix = "public",
29    deps = [
30        "//pw_bytes",
31        "//pw_checksum",
32        "//pw_containers",
33        "//pw_kvs",
34        "//pw_log",
35        "//pw_preprocessor",
36        "//pw_span",
37        "//pw_status",
38        "//pw_stream",
39        "//pw_sync:borrow",
40    ],
41)
42
43cc_library(
44    name = "flat_file_system_entry",
45    srcs = ["flat_file_system_entry.cc"],
46    hdrs = ["public/pw_blob_store/flat_file_system_entry.h"],
47    strip_include_prefix = "public",
48    deps = [
49        ":pw_blob_store",
50        "//pw_bytes",
51        "//pw_file:flat_file_system",
52        "//pw_status",
53        "//pw_sync:mutex",
54    ],
55)
56
57pw_cc_test(
58    name = "blob_store_test",
59    srcs = [
60        "blob_store_test.cc",
61    ],
62    deps = [
63        ":pw_blob_store",
64        "//pw_kvs:crc16",
65        "//pw_kvs:fake_flash",
66        "//pw_kvs:fake_flash_test_key_value_store",
67        "//pw_log",
68        "//pw_random",
69        "//pw_sync:borrow",
70        "//pw_unit_test",
71    ],
72)
73
74pw_cc_test(
75    name = "blob_store_chunk_write_test",
76    srcs = [
77        "blob_store_chunk_write_test.cc",
78    ],
79    deps = [
80        ":pw_blob_store",
81        "//pw_kvs:crc16",
82        "//pw_kvs:fake_flash",
83        "//pw_kvs:fake_flash_test_key_value_store",
84        "//pw_log",
85        "//pw_random",
86        "//pw_unit_test",
87    ],
88)
89
90pw_cc_test(
91    name = "blob_store_deferred_write_test",
92    srcs = [
93        "blob_store_deferred_write_test.cc",
94    ],
95    deps = [
96        ":pw_blob_store",
97        "//pw_kvs:crc16",
98        "//pw_kvs:fake_flash",
99        "//pw_kvs:fake_flash_test_key_value_store",
100        "//pw_log",
101        "//pw_random",
102        "//pw_unit_test",
103    ],
104)
105
106pw_cc_test(
107    name = "flat_file_system_entry_test",
108    srcs = ["flat_file_system_entry_test.cc"],
109    deps = [
110        ":flat_file_system_entry",
111        ":pw_blob_store",
112        "//pw_kvs:crc16",
113        "//pw_kvs:fake_flash",
114        "//pw_kvs:fake_flash_test_key_value_store",
115        "//pw_random",
116        "//pw_sync:mutex",
117    ],
118)
119