aboutsummaryrefslogtreecommitdiff
path: root/pw_snapshot/CMakeLists.txt
blob: 1ba335551af92520d4415c75591522204afda88a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
# Copyright 2020 The Pigweed Authors
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may not
# use this file except in compliance with the License. You may obtain a copy of
# the License at
#
#     https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations under
# the License.

include($ENV{PW_ROOT}/pw_build/pigweed.cmake)
include($ENV{PW_ROOT}/pw_protobuf_compiler/proto.cmake)

pw_add_module_library(pw_snapshot.uuid
  HEADERS
    public/pw_snapshot/uuid.h
  PUBLIC_INCLUDES
    public
  PUBLIC_DEPS
    pw_polyfill.span
    pw_polyfill.cstddef
    pw_result
    pw_bytes
  SOURCES
    uuid.cc
  PRIVATE_DEPS
    pw_protobuf
    pw_snapshot.metadata_proto.pwpb
)

pw_add_module_library(pw_snapshot
  PUBLIC_DEPS
    pw_snapshot.metadata_proto
    pw_snapshot.snapshot_proto
)

# This proto library only contains the snapshot_metadata.proto. Typically this
# should be a dependency of snapshot-like protos.
pw_proto_library(pw_snapshot.metadata_proto
  SOURCES
    pw_snapshot_protos/snapshot_metadata.proto
  STRIP_PREFIX
    pw_snapshot_protos
  PREFIX
    pw_snapshot_metadata_proto
  DEPS
    pw_tokenizer.proto
)

# This proto provides the complete "Snapshot" proto, which depends on various
# proto libraries throughout Pigweed. This is the proto library to use when
# building/reading snapshots.
pw_proto_library(pw_snapshot.snapshot_proto
  SOURCES
    pw_snapshot_protos/snapshot.proto
  DEPS
    pw_snapshot.metadata_proto
    pw_cpu_exception_cortex_m.cpu_state_protos
    pw_log.protos
    pw_thread.protos
)

pw_add_test(pw_snapshot.cpp_compile_test
  SOURCES
    cpp_compile_test.cc
  DEPS
    pw_protobuf
    pw_snapshot.snapshot_proto.pwpb
  GROUPS
    modules
    pw_snapshot
)

pw_add_test(pw_snapshot.uuid_test
  SOURCES
    uuid_test.cc
  DEPS
    pw_bytes
    pw_polyfill.cstddef
    pw_polyfill.span
    pw_protobuf
    pw_result
    pw_snapshot.metadata_proto.pwpb
    pw_snapshot.uuid
    pw_status
  GROUPS
    modules
    pw_snapshot
)