• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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
15load(
16    "//pw_build:pigweed.bzl",
17    "pw_cc_library",
18    "pw_cc_test",
19)
20
21package(default_visibility = ["//visibility:public"])
22
23licenses(["notice"])  # Apache License 2.0
24
25pw_cc_library(
26    name = "config",
27    hdrs = ["public/pw_protobuf/config.h"],
28    includes = ["public"],
29)
30
31pw_cc_library(
32    name = "pw_protobuf",
33    srcs = [
34        "decoder.cc",
35        "encoder.cc",
36        "find.cc",
37    ],
38    hdrs = [
39        "public/pw_protobuf/codegen.h",
40        "public/pw_protobuf/decoder.h",
41        "public/pw_protobuf/encoder.h",
42        "public/pw_protobuf/find.h",
43        "public/pw_protobuf/serialized_size.h",
44        "public/pw_protobuf/wire_format.h",
45    ],
46    includes = ["public"],
47    deps = [
48        ":config",
49        "//pw_span",
50        "//pw_status",
51        "//pw_varint",
52    ],
53)
54
55pw_cc_test(
56    name = "decoder_test",
57    srcs = ["decoder_test.cc"],
58    deps = [
59        ":pw_protobuf",
60        "//pw_preprocessor",
61        "//pw_unit_test",
62    ],
63)
64
65pw_cc_test(
66    name = "encoder_test",
67    srcs = ["encoder_test.cc"],
68    deps = [
69        ":pw_protobuf",
70        "//pw_unit_test",
71    ],
72)
73
74pw_cc_test(
75    name = "find_test",
76    srcs = ["find_test.cc"],
77    deps = [
78        ":pw_protobuf",
79        "//pw_unit_test",
80    ],
81)
82
83# TODO(frolv): Figure out how to integrate pw_protobuf codegen into Bazel.
84filegroup(
85    name = "codegen_test",
86    srcs = [
87        "codegen_test.cc",
88    ],
89)
90
91# TODO(frolv): Figure out how to add facade tests to Bazel.
92filegroup(
93    name = "varint_size_test",
94    srcs = [
95        "varint_size_test.cc",
96    ],
97)
98
99# TODO(frolv): Figure out what to do about size reports in Bazel.
100filegroup(
101    name = "size_reports",
102    srcs = glob([
103        "size_report/*.cc",
104    ]),
105)
106