1 # Copyright 2020 The Pigweed Authors
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
7 # https://www.apache.org/licenses/LICENSE-2.0
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
15 import("//build_overrides/pigweed.gni")
17 import("$dir_pw_build/input_group.gni")
18 import("$dir_pw_build/target_types.gni")
19 import("$dir_pw_docgen/docs.gni")
20 import("$dir_pw_fuzzer/fuzzer.gni")
21 import("$dir_pw_protobuf_compiler/proto.gni")
22 import("$dir_pw_unit_test/test.gni")
24 config("default_config") {
25 include_dirs = [ "public" ]
28 pw_source_set("pw_protobuf") {
29 public_configs = [ ":default_config" ]
37 "public/pw_protobuf/codegen.h",
38 "public/pw_protobuf/decoder.h",
39 "public/pw_protobuf/encoder.h",
40 "public/pw_protobuf/find.h",
41 "public/pw_protobuf/serialized_size.h",
42 "public/pw_protobuf/wire_format.h",
51 pw_doc_group("docs") {
57 "size_report:decoder_full",
58 "size_report:decoder_incremental",
62 pw_test_group("tests") {
72 pw_test("decoder_test") {
73 deps = [ ":pw_protobuf" ]
74 sources = [ "decoder_test.cc" ]
77 pw_test("encoder_test") {
78 deps = [ ":pw_protobuf" ]
79 sources = [ "encoder_test.cc" ]
82 pw_test("find_test") {
83 deps = [ ":pw_protobuf" ]
84 sources = [ "find_test.cc" ]
87 pw_test("codegen_test") {
88 deps = [ ":codegen_test_protos.pwpb" ]
89 sources = [ "codegen_test.cc" ]
92 pw_proto_library("common_protos") {
93 sources = [ "pw_protobuf_protos/common.proto" ]
96 pw_proto_library("codegen_test_protos") {
98 "pw_protobuf_test_protos/full_test.proto",
99 "pw_protobuf_test_protos/imported.proto",
100 "pw_protobuf_test_protos/importer.proto",
101 "pw_protobuf_test_protos/non_pw_package.proto",
102 "pw_protobuf_test_protos/proto2.proto",
103 "pw_protobuf_test_protos/repeated.proto",
105 deps = [ ":common_protos" ]
108 pw_fuzzer("encoder_fuzzer") {
109 sources = [ "encoder_fuzzer.cc" ]
110 deps = [ ":pw_protobuf" ]