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_python//python:proto.bzl", "py_proto_library") 16load( 17 "//pw_build:pigweed.bzl", 18 "pw_cc_test", 19) 20load("//pw_protobuf_compiler:pw_proto_library.bzl", "pw_proto_library") 21 22package(default_visibility = ["//visibility:public"]) 23 24licenses(["notice"]) 25 26cc_library( 27 name = "uuid", 28 srcs = [ 29 "uuid.cc", 30 ], 31 hdrs = [ 32 "public/pw_snapshot/uuid.h", 33 ], 34 includes = ["public"], 35 deps = [ 36 ":metadata_proto_cc.pwpb", 37 "//pw_bytes", 38 "//pw_protobuf", 39 "//pw_status", 40 ], 41) 42 43proto_library( 44 name = "metadata_proto", 45 srcs = [ 46 "pw_snapshot_protos/snapshot_metadata.proto", 47 ], 48 import_prefix = "pw_snapshot_metadata_proto", 49 strip_import_prefix = "/pw_snapshot/pw_snapshot_protos", 50 deps = [ 51 "//pw_tokenizer:tokenizer_proto", 52 ], 53) 54 55py_proto_library( 56 name = "metadata_proto_py_pb2", 57 deps = [":metadata_proto"], 58) 59 60proto_library( 61 name = "snapshot_proto", 62 srcs = [ 63 "pw_snapshot_protos/snapshot.proto", 64 ], 65 import_prefix = "pw_snapshot_protos", 66 strip_import_prefix = "/pw_snapshot/pw_snapshot_protos", 67 deps = [ 68 ":metadata_proto", 69 "//pw_chrono:chrono_proto", 70 "//pw_cpu_exception_cortex_m:cpu_state_protos", 71 "//pw_cpu_exception_risc_v:cpu_state_protos", 72 "//pw_log:log_proto", 73 "//pw_thread:thread_proto", 74 ], 75) 76 77py_proto_library( 78 name = "snapshot_proto_py_pb2", 79 deps = [":snapshot_proto"], 80) 81 82pw_proto_library( 83 name = "metadata_proto_cc", 84 deps = [":snapshot_proto"], 85) 86 87pw_proto_library( 88 name = "snapshot_proto_cc", 89 deps = [":snapshot_proto"], 90) 91 92pw_cc_test( 93 name = "cpp_compile_test", 94 srcs = [ 95 "cpp_compile_test.cc", 96 ], 97 deps = [ 98 ":snapshot_proto_cc.pwpb", 99 "//pw_unit_test", 100 ], 101) 102 103pw_cc_test( 104 name = "uuid_test", 105 srcs = [ 106 "uuid_test.cc", 107 ], 108 deps = [ 109 ":metadata_proto_cc.pwpb", 110 ":uuid", 111 "//pw_bytes", 112 "//pw_protobuf", 113 "//pw_result", 114 "//pw_status", 115 ], 116) 117