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