1# Copyright 2022 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( 16 "//pw_build:pigweed.bzl", 17 "pw_cc_binary", 18) 19 20package(default_visibility = ["//visibility:public"]) 21 22licenses(["notice"]) 23 24pw_cc_binary( 25 name = "decoder_partial", 26 srcs = [ 27 "decoder_partial.cc", 28 ], 29 deps = [ 30 "//pw_bloat:bloat_this_binary", 31 "//pw_preprocessor", 32 "//pw_protobuf", 33 ], 34) 35 36pw_cc_binary( 37 name = "decoder_incremental", 38 srcs = [ 39 "decoder_incremental.cc", 40 ], 41 deps = [ 42 "//pw_bloat:bloat_this_binary", 43 "//pw_preprocessor", 44 "//pw_protobuf", 45 ], 46) 47 48cc_library( 49 name = "proto_bloat", 50 srcs = [ 51 "proto_bloat.cc", 52 ], 53 hdrs = ["proto_bloat.h"], 54 deps = [ 55 "//pw_containers", 56 "//pw_preprocessor", 57 "//pw_protobuf", 58 "//pw_status", 59 "//pw_stream", 60 ], 61) 62 63pw_cc_binary( 64 name = "proto_base", 65 srcs = [ 66 "proto_base.cc", 67 ], 68 deps = [ 69 ":proto_bloat", 70 "//pw_bloat:bloat_this_binary", 71 ], 72) 73 74pw_cc_binary( 75 name = "encode_decode_core", 76 srcs = [ 77 "encode_decode_core.cc", 78 ], 79 deps = [ 80 ":proto_bloat", 81 "//pw_bloat:bloat_this_binary", 82 ], 83) 84 85pw_cc_binary( 86 name = "message_core", 87 srcs = [ 88 "message_core.cc", 89 ], 90 deps = [ 91 ":proto_bloat", 92 "//pw_bloat:bloat_this_binary", 93 ], 94) 95 96pw_cc_binary( 97 name = "messages_no_codegen", 98 srcs = ["simple_codegen_comparison.cc"], 99 defines = ["_PW_PROTOBUF_SIZE_REPORT_NO_CODEGEN=1"], 100 deps = [ 101 ":proto_bloat", 102 "//pw_bloat:bloat_this_binary", 103 "//pw_protobuf:codegen_test_proto_cc.pwpb", 104 ], 105) 106 107pw_cc_binary( 108 name = "messages_wire_format", 109 srcs = ["simple_codegen_comparison.cc"], 110 defines = ["_PW_PROTOBUF_SIZE_REPORT_WIRE_FORMAT=1"], 111 deps = [ 112 ":proto_bloat", 113 "//pw_bloat:bloat_this_binary", 114 "//pw_protobuf:codegen_test_proto_cc.pwpb", 115 ], 116) 117 118pw_cc_binary( 119 name = "messages_message", 120 srcs = ["simple_codegen_comparison.cc"], 121 defines = ["_PW_PROTOBUF_SIZE_REPORT_MESSAGE=1"], 122 deps = [ 123 ":proto_bloat", 124 "//pw_bloat:bloat_this_binary", 125 "//pw_protobuf:codegen_test_proto_cc.pwpb", 126 ], 127) 128 129pw_cc_binary( 130 name = "oneof_no_codegen", 131 srcs = ["oneof_codegen_comparison.cc"], 132 defines = ["_PW_PROTOBUF_SIZE_REPORT_NO_CODEGEN=1"], 133 deps = [ 134 ":proto_bloat", 135 "//pw_bloat:bloat_this_binary", 136 "//pw_protobuf:codegen_test_proto_cc.pwpb", 137 ], 138) 139 140pw_cc_binary( 141 name = "oneof_wire_format", 142 srcs = ["oneof_codegen_comparison.cc"], 143 defines = ["_PW_PROTOBUF_SIZE_REPORT_WIRE_FORMAT=1"], 144 deps = [ 145 ":proto_bloat", 146 "//pw_bloat:bloat_this_binary", 147 "//pw_protobuf:codegen_test_proto_cc.pwpb", 148 ], 149) 150 151pw_cc_binary( 152 name = "oneof_message", 153 srcs = ["oneof_codegen_comparison.cc"], 154 defines = ["_PW_PROTOBUF_SIZE_REPORT_MESSAGE=1"], 155 deps = [ 156 ":proto_bloat", 157 "//pw_bloat:bloat_this_binary", 158 "//pw_protobuf:codegen_test_proto_cc.pwpb", 159 ], 160) 161