blob: 54b4d3ac665169cc29f5c0e81828ede1d97c05f8 [file] [log] [blame]
Alexei Frolovbbbedff2020-03-11 14:21:38 -07001# Copyright 2020 The Pigweed Authors
Alexei Frolovbbf164c2019-12-16 12:51:59 -08002#
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 = "pw_protobuf",
27 srcs = [
Alexei Frolovdea46f72020-01-07 13:28:24 -080028 "decoder.cc",
Alexei Frolovbbf164c2019-12-16 12:51:59 -080029 "encoder.cc",
Alexei Frolovbbbedff2020-03-11 14:21:38 -070030 "find.cc",
Alexei Frolovbbf164c2019-12-16 12:51:59 -080031 ],
32 hdrs = [
33 "public/pw_protobuf/codegen.h",
Alexei Frolovdea46f72020-01-07 13:28:24 -080034 "public/pw_protobuf/decoder.h",
Alexei Frolovbbf164c2019-12-16 12:51:59 -080035 "public/pw_protobuf/encoder.h",
Alexei Frolovbbbedff2020-03-11 14:21:38 -070036 "public/pw_protobuf/find.h",
Ewout van Bekkumc76aa402020-09-23 10:58:27 -070037 "public/pw_protobuf/serialized_size.h",
Alexei Frolovdea46f72020-01-07 13:28:24 -080038 "public/pw_protobuf/wire_format.h",
Alexei Frolovbbf164c2019-12-16 12:51:59 -080039 ],
Wyatt Hepler61def0a2020-01-06 10:30:14 -080040 includes = ["public"],
Alexei Frolovbbf164c2019-12-16 12:51:59 -080041 deps = [
Rob Mohree8ce082019-12-20 10:32:16 -080042 "//pw_span",
Alexei Frolovbbf164c2019-12-16 12:51:59 -080043 "//pw_status",
44 "//pw_varint",
45 ],
46)
47
48pw_cc_test(
Alexei Frolovdea46f72020-01-07 13:28:24 -080049 name = "decoder_test",
50 srcs = ["decoder_test.cc"],
Rob Mohr06819482020-04-06 13:25:43 -070051 deps = [
52 ":pw_protobuf",
53 "//pw_preprocessor",
54 "//pw_unit_test",
55 ],
Alexei Frolovdea46f72020-01-07 13:28:24 -080056)
57
58pw_cc_test(
Alexei Frolovbbf164c2019-12-16 12:51:59 -080059 name = "encoder_test",
60 srcs = ["encoder_test.cc"],
Rob Mohr06819482020-04-06 13:25:43 -070061 deps = [
62 ":pw_protobuf",
63 "//pw_unit_test",
64 ],
Alexei Frolovbbf164c2019-12-16 12:51:59 -080065)
66
Alexei Frolovbbbedff2020-03-11 14:21:38 -070067pw_cc_test(
68 name = "find_test",
69 srcs = ["find_test.cc"],
Rob Mohr06819482020-04-06 13:25:43 -070070 deps = [
71 ":pw_protobuf",
72 "//pw_unit_test",
73 ],
Alexei Frolovbbbedff2020-03-11 14:21:38 -070074)
75
Alexei Frolovbbf164c2019-12-16 12:51:59 -080076# TODO(frolv): Figure out how to integrate pw_protobuf codegen into Bazel.
77filegroup(
78 name = "codegen_test",
79 srcs = [
80 "codegen_test.cc",
81 ],
82)
Alexei Frolov9c2ed462020-01-13 15:35:42 -080083
84# TODO(frolv): Figure out what to do about size reports in Bazel.
85filegroup(
86 name = "size_reports",
87 srcs = glob([
88 "size_report/*.cc",
89 ]),
90)