blob: f2be8a7dc42ff7b6a2d4653ba531bbc210649f9c [file] [log] [blame]
Armando Montanez179aa8e2021-03-10 11:46:35 -08001# 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
15import("//build_overrides/pigweed.gni")
16
17import("$dir_pw_docgen/docs.gni")
18import("$dir_pw_protobuf_compiler/proto.gni")
19import("$dir_pw_unit_test/test.gni")
20
21group("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.
30pw_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 Montanez3a8e7292021-07-09 16:47:53 -070034 deps = [ "$dir_pw_tokenizer:proto" ]
Armando Montanez179aa8e2021-03-10 11:46:35 -080035}
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.
40pw_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
50pw_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
61pw_test_group("tests") {
62 tests = [ ":cpp_compile_test" ]
63}
64
65# An empty test to ensure the proto libraries compile correctly.
66pw_test("cpp_compile_test") {
67 sources = [ "cpp_compile_test.cc" ]
68 deps = [
69 ":snapshot_proto.pwpb",
70 dir_pw_protobuf,
71 ]
72}