Armando Montanez | 179aa8e | 2021-03-10 11:46:35 -0800 | [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 | |
| 17 | import("$dir_pw_docgen/docs.gni") |
| 18 | import("$dir_pw_protobuf_compiler/proto.gni") |
| 19 | import("$dir_pw_unit_test/test.gni") |
| 20 | |
| 21 | group("pw_snapshot") { |
| 22 | deps = [ |
| 23 | ":metadata_proto", |
| 24 | ":snapshot_proto", |
| 25 | ] |
| 26 | } |
| 27 | |
| 28 | # This proto library only contains the snapshot_metadata.proto. Typically this |
| 29 | # should be a dependency of snapshot-like protos. |
| 30 | pw_proto_library("metadata_proto") { |
| 31 | sources = [ "pw_snapshot_protos/snapshot_metadata.proto" ] |
| 32 | strip_prefix = "pw_snapshot_protos" |
| 33 | prefix = "pw_snapshot_metadata_proto" |
Armando Montanez | 3a8e729 | 2021-07-09 16:47:53 -0700 | [diff] [blame] | 34 | deps = [ "$dir_pw_tokenizer:proto" ] |
Armando Montanez | 179aa8e | 2021-03-10 11:46:35 -0800 | [diff] [blame] | 35 | } |
| 36 | |
| 37 | # This proto provides the complete "Snapshot" proto, which depends on various |
| 38 | # proto libraries throughout Pigweed. This is the proto library to use when |
| 39 | # building/reading snapshots. |
| 40 | pw_proto_library("snapshot_proto") { |
| 41 | sources = [ "pw_snapshot_protos/snapshot.proto" ] |
| 42 | deps = [ |
| 43 | ":metadata_proto", |
| 44 | "$dir_pw_cpu_exception_cortex_m:cpu_state_protos", |
| 45 | "$dir_pw_log:protos", |
| 46 | "$dir_pw_thread:protos", |
| 47 | ] |
| 48 | } |
| 49 | |
| 50 | pw_doc_group("docs") { |
| 51 | inputs = [ "images/generic_crash_flow.svg" ] |
| 52 | sources = [ |
| 53 | "design_discussion.rst", |
| 54 | "docs.rst", |
| 55 | "module_usage.rst", |
| 56 | "proto_format.rst", |
| 57 | "setup.rst", |
| 58 | ] |
| 59 | } |
| 60 | |
| 61 | pw_test_group("tests") { |
| 62 | tests = [ ":cpp_compile_test" ] |
| 63 | } |
| 64 | |
| 65 | # An empty test to ensure the proto libraries compile correctly. |
| 66 | pw_test("cpp_compile_test") { |
| 67 | sources = [ "cpp_compile_test.cc" ] |
| 68 | deps = [ |
| 69 | ":snapshot_proto.pwpb", |
| 70 | dir_pw_protobuf, |
| 71 | ] |
| 72 | } |