1# Copyright 2021 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("@rules_cc//cc:cc_library.bzl", "cc_library") 16load("@rules_python//sphinxdocs:sphinx_docs_library.bzl", "sphinx_docs_library") 17load("//pw_build:compatibility.bzl", "incompatible_with_mcu") 18load("//pw_unit_test:pw_cc_test.bzl", "pw_cc_test") 19 20package( 21 default_visibility = ["//visibility:public"], 22 features = ["-layering_check"], 23) 24 25licenses(["notice"]) 26 27cc_library( 28 name = "pw_persistent_ram", 29 srcs = ["persistent_buffer.cc"], 30 hdrs = [ 31 "public/pw_persistent_ram/persistent.h", 32 "public/pw_persistent_ram/persistent_buffer.h", 33 ], 34 strip_include_prefix = "public", 35 deps = [ 36 "//pw_assert:assert", 37 "//pw_bytes", 38 "//pw_checksum", 39 "//pw_stream", 40 ], 41) 42 43cc_library( 44 name = "flat_file_system_entry", 45 hdrs = [ 46 "public/pw_persistent_ram/flat_file_system_entry.h", 47 ], 48 strip_include_prefix = "public", 49 deps = [ 50 "//pw_file:flat_file_system", 51 "//pw_persistent_ram", 52 ], 53) 54 55pw_cc_test( 56 name = "persistent_test", 57 srcs = [ 58 "persistent_test.cc", 59 ], 60 # The test contains intentional uninitialized memory access. 61 tags = ["nomsan"], 62 deps = [ 63 ":pw_persistent_ram", 64 "//pw_random", 65 ], 66) 67 68pw_cc_test( 69 name = "persistent_buffer_test", 70 srcs = [ 71 "persistent_buffer_test.cc", 72 ], 73 # The test contains intentional uninitialized memory access. 74 tags = ["nomsan"], 75 deps = [ 76 ":pw_persistent_ram", 77 "//pw_random", 78 ], 79) 80 81pw_cc_test( 82 name = "flat_file_system_entry_test", 83 srcs = [ 84 "flat_file_system_entry_test.cc", 85 ], 86 deps = [ 87 ":flat_file_system_entry", 88 ], 89) 90 91sphinx_docs_library( 92 name = "docs", 93 srcs = [ 94 "docs.rst", 95 ], 96 prefix = "pw_persistent_ram/", 97 target_compatible_with = incompatible_with_mcu(), 98) 99