Ewout van Bekkum | 32dc5c5 | 2021-03-16 11:35:37 -0700 | [diff] [blame] | 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 | |
| 15 | import("//build_overrides/pigweed.gni") |
| 16 | |
Ewout van Bekkum | ac6a6ac | 2021-03-18 08:29:45 -0700 | [diff] [blame] | 17 | import("$dir_pw_bloat/bloat.gni") |
Ewout van Bekkum | 32dc5c5 | 2021-03-16 11:35:37 -0700 | [diff] [blame] | 18 | import("$dir_pw_build/target_types.gni") |
| 19 | import("$dir_pw_docgen/docs.gni") |
| 20 | import("$dir_pw_unit_test/test.gni") |
| 21 | |
| 22 | config("public_include_path") { |
| 23 | include_dirs = [ "public" ] |
| 24 | visibility = [ ":*" ] |
| 25 | } |
| 26 | |
| 27 | pw_source_set("pw_persistent_ram") { |
| 28 | public_configs = [ ":public_include_path" ] |
Armando Montanez | b90d9b2 | 2021-03-18 16:26:52 -0700 | [diff] [blame] | 29 | public = [ |
| 30 | "public/pw_persistent_ram/persistent.h", |
| 31 | "public/pw_persistent_ram/persistent_buffer.h", |
| 32 | ] |
| 33 | sources = [ "persistent_buffer.cc" ] |
Ewout van Bekkum | 32dc5c5 | 2021-03-16 11:35:37 -0700 | [diff] [blame] | 34 | public_deps = [ |
| 35 | dir_pw_assert, |
Armando Montanez | b90d9b2 | 2021-03-18 16:26:52 -0700 | [diff] [blame] | 36 | dir_pw_bytes, |
Ewout van Bekkum | 32dc5c5 | 2021-03-16 11:35:37 -0700 | [diff] [blame] | 37 | dir_pw_checksum, |
Wyatt Hepler | 4298fd0 | 2021-03-19 15:08:10 -0700 | [diff] [blame] | 38 | dir_pw_preprocessor, |
Armando Montanez | b90d9b2 | 2021-03-18 16:26:52 -0700 | [diff] [blame] | 39 | dir_pw_stream, |
Ewout van Bekkum | 32dc5c5 | 2021-03-16 11:35:37 -0700 | [diff] [blame] | 40 | ] |
| 41 | } |
| 42 | |
| 43 | pw_test_group("tests") { |
Armando Montanez | b90d9b2 | 2021-03-18 16:26:52 -0700 | [diff] [blame] | 44 | tests = [ |
| 45 | ":persistent_test", |
| 46 | ":persistent_buffer_test", |
| 47 | ] |
Ewout van Bekkum | 32dc5c5 | 2021-03-16 11:35:37 -0700 | [diff] [blame] | 48 | } |
| 49 | |
| 50 | pw_test("persistent_test") { |
Armando Montanez | 58f22dc | 2021-04-16 09:52:26 -0700 | [diff] [blame] | 51 | deps = [ |
| 52 | ":pw_persistent_ram", |
| 53 | dir_pw_random, |
| 54 | ] |
Ewout van Bekkum | 32dc5c5 | 2021-03-16 11:35:37 -0700 | [diff] [blame] | 55 | sources = [ "persistent_test.cc" ] |
| 56 | } |
| 57 | |
Armando Montanez | b90d9b2 | 2021-03-18 16:26:52 -0700 | [diff] [blame] | 58 | pw_test("persistent_buffer_test") { |
| 59 | deps = [ |
| 60 | ":pw_persistent_ram", |
| 61 | dir_pw_random, |
| 62 | ] |
| 63 | sources = [ "persistent_buffer_test.cc" ] |
| 64 | } |
| 65 | |
Ewout van Bekkum | 32dc5c5 | 2021-03-16 11:35:37 -0700 | [diff] [blame] | 66 | pw_doc_group("docs") { |
| 67 | sources = [ "docs.rst" ] |
Ewout van Bekkum | ac6a6ac | 2021-03-18 08:29:45 -0700 | [diff] [blame] | 68 | report_deps = [ ":persistent_size" ] |
| 69 | } |
| 70 | |
| 71 | pw_size_report("persistent_size") { |
| 72 | title = "pw::persistent_ram::Persistent" |
| 73 | |
| 74 | # To see all the symbols, uncomment the following: |
| 75 | # Note: The size report RST table won't be generated when full_report = true. |
| 76 | # full_report = true |
| 77 | |
| 78 | binaries = [ |
| 79 | { |
| 80 | target = "size_report:persistent" |
| 81 | base = "size_report:persistent_base" |
| 82 | label = "Persistent including pw_checksum's CRC16" |
| 83 | }, |
| 84 | { |
| 85 | target = "size_report:persistent" |
| 86 | base = "size_report:persistent_base_with_crc16" |
| 87 | label = "Persistent without pw_checksum's CRC16" |
| 88 | }, |
| 89 | ] |
Ewout van Bekkum | 32dc5c5 | 2021-03-16 11:35:37 -0700 | [diff] [blame] | 90 | } |