1# Copyright 2020 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 15include($ENV{PW_ROOT}/pw_build/pigweed.cmake) 16include($ENV{PW_ROOT}/pw_protobuf_compiler/proto.cmake) 17 18pw_add_module_config(pw_protobuf_CONFIG) 19 20pw_add_module_library(pw_protobuf.config 21 HEADERS 22 public/pw_protobuf/config.h 23 PUBLIC_INCLUDES 24 public 25 PUBLIC_DEPS 26 ${pw_protobuf_CONFIG} 27) 28 29pw_add_module_library(pw_protobuf 30 HEADERS 31 public/pw_protobuf/decoder.h 32 public/pw_protobuf/encoder.h 33 public/pw_protobuf/find.h 34 public/pw_protobuf/internal/proto_integer_base.h 35 public/pw_protobuf/map_utils.h 36 public/pw_protobuf/message.h 37 public/pw_protobuf/serialized_size.h 38 public/pw_protobuf/stream_decoder.h 39 public/pw_protobuf/wire_format.h 40 PUBLIC_INCLUDES 41 public 42 PUBLIC_DEPS 43 pw_assert 44 pw_bytes 45 pw_containers.vector 46 pw_protobuf.config 47 pw_polyfill.span 48 pw_polyfill.cstddef 49 pw_result 50 pw_status 51 pw_stream 52 pw_stream.interval_reader 53 pw_varint 54 pw_varint.stream 55 SOURCES 56 decoder.cc 57 encoder.cc 58 find.cc 59 map_utils.cc 60 message.cc 61 stream_decoder.cc 62) 63 64pw_add_module_library(pw_protobuf.bytes_utils 65 HEADERS 66 public/pw_protobuf/bytes_utils.h 67 PUBLIC_INCLUDES 68 public 69 PUBLIC_DEPS 70 pw_protobuf 71 pw_bytes 72 pw_result 73 pw_status 74) 75 76pw_add_test(pw_protobuf.decoder_test 77 SOURCES 78 decoder_test.cc 79 DEPS 80 pw_protobuf 81 GROUPS 82 modules 83 pw_protobuf 84) 85 86pw_add_test(pw_protobuf.encoder_test 87 SOURCES 88 encoder_test.cc 89 DEPS 90 pw_protobuf 91 GROUPS 92 modules 93 pw_protobuf 94) 95 96pw_add_test(pw_protobuf.find_test 97 SOURCES 98 find_test.cc 99 DEPS 100 pw_protobuf 101 GROUPS 102 modules 103 pw_protobuf 104) 105 106pw_add_test(pw_protobuf.codegen_decoder_test 107 SOURCES 108 codegen_decoder_test.cc 109 DEPS 110 pw_protobuf 111 pw_protobuf.codegen_test_protos.pwpb 112 GROUPS 113 modules 114 pw_protobuf 115) 116 117pw_add_test(pw_protobuf.codegen_encoder_test 118 SOURCES 119 codegen_encoder_test.cc 120 DEPS 121 pw_protobuf 122 pw_protobuf.codegen_test_protos.pwpb 123 GROUPS 124 modules 125 pw_protobuf 126) 127 128pw_add_test(pw_protobuf.serialized_size_test 129 SOURCES 130 serialized_size_test.cc 131 DEPS 132 pw_protobuf 133 GROUPS 134 modules 135 pw_protobuf 136) 137 138pw_add_test(pw_protobuf.stream_decoder_test 139 SOURCES 140 stream_decoder_test.cc 141 DEPS 142 pw_protobuf 143 GROUPS 144 modules 145 pw_protobuf 146) 147 148pw_add_test(pw_protobuf.map_utils_test 149 SOURCES 150 map_utils_test.cc 151 DEPS 152 pw_protobuf 153 GROUPS 154 modules 155 pw_protobuf 156) 157 158pw_add_test(pw_protobuf.message_test 159 SOURCES 160 message_test.cc 161 DEPS 162 pw_protobuf 163 GROUPS 164 modules 165 pw_protobuf 166) 167 168pw_proto_library(pw_protobuf.common_protos 169 SOURCES 170 pw_protobuf_protos/common.proto 171) 172 173pw_proto_library(pw_protobuf.codegen_test_protos 174 SOURCES 175 pw_protobuf_test_protos/full_test.proto 176 pw_protobuf_test_protos/imported.proto 177 pw_protobuf_test_protos/importer.proto 178 pw_protobuf_test_protos/non_pw_package.proto 179 pw_protobuf_test_protos/proto2.proto 180 pw_protobuf_test_protos/repeated.proto 181 DEPS 182 pw_protobuf.common_protos 183) 184