Alexei Frolov | bbbedff | 2020-03-11 14:21:38 -0700 | [diff] [blame] | 1 | # Copyright 2020 The Pigweed Authors |
Alexei Frolov | bbf164c | 2019-12-16 12:51:59 -0800 | [diff] [blame] | 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 | |
| 15 | load( |
| 16 | "//pw_build:pigweed.bzl", |
| 17 | "pw_cc_library", |
| 18 | "pw_cc_test", |
| 19 | ) |
| 20 | |
| 21 | package(default_visibility = ["//visibility:public"]) |
| 22 | |
| 23 | licenses(["notice"]) # Apache License 2.0 |
| 24 | |
| 25 | pw_cc_library( |
| 26 | name = "pw_protobuf", |
| 27 | srcs = [ |
Alexei Frolov | dea46f7 | 2020-01-07 13:28:24 -0800 | [diff] [blame] | 28 | "decoder.cc", |
Alexei Frolov | bbf164c | 2019-12-16 12:51:59 -0800 | [diff] [blame] | 29 | "encoder.cc", |
Alexei Frolov | bbbedff | 2020-03-11 14:21:38 -0700 | [diff] [blame] | 30 | "find.cc", |
Alexei Frolov | bbf164c | 2019-12-16 12:51:59 -0800 | [diff] [blame] | 31 | ], |
| 32 | hdrs = [ |
| 33 | "public/pw_protobuf/codegen.h", |
Alexei Frolov | dea46f7 | 2020-01-07 13:28:24 -0800 | [diff] [blame] | 34 | "public/pw_protobuf/decoder.h", |
Alexei Frolov | bbf164c | 2019-12-16 12:51:59 -0800 | [diff] [blame] | 35 | "public/pw_protobuf/encoder.h", |
Alexei Frolov | bbbedff | 2020-03-11 14:21:38 -0700 | [diff] [blame] | 36 | "public/pw_protobuf/find.h", |
Ewout van Bekkum | c76aa40 | 2020-09-23 10:58:27 -0700 | [diff] [blame] | 37 | "public/pw_protobuf/serialized_size.h", |
Alexei Frolov | dea46f7 | 2020-01-07 13:28:24 -0800 | [diff] [blame] | 38 | "public/pw_protobuf/wire_format.h", |
Alexei Frolov | bbf164c | 2019-12-16 12:51:59 -0800 | [diff] [blame] | 39 | ], |
Wyatt Hepler | 61def0a | 2020-01-06 10:30:14 -0800 | [diff] [blame] | 40 | includes = ["public"], |
Alexei Frolov | bbf164c | 2019-12-16 12:51:59 -0800 | [diff] [blame] | 41 | deps = [ |
Rob Mohr | ee8ce08 | 2019-12-20 10:32:16 -0800 | [diff] [blame] | 42 | "//pw_span", |
Alexei Frolov | bbf164c | 2019-12-16 12:51:59 -0800 | [diff] [blame] | 43 | "//pw_status", |
| 44 | "//pw_varint", |
| 45 | ], |
| 46 | ) |
| 47 | |
| 48 | pw_cc_test( |
Alexei Frolov | dea46f7 | 2020-01-07 13:28:24 -0800 | [diff] [blame] | 49 | name = "decoder_test", |
| 50 | srcs = ["decoder_test.cc"], |
Rob Mohr | 0681948 | 2020-04-06 13:25:43 -0700 | [diff] [blame] | 51 | deps = [ |
| 52 | ":pw_protobuf", |
| 53 | "//pw_preprocessor", |
| 54 | "//pw_unit_test", |
| 55 | ], |
Alexei Frolov | dea46f7 | 2020-01-07 13:28:24 -0800 | [diff] [blame] | 56 | ) |
| 57 | |
| 58 | pw_cc_test( |
Alexei Frolov | bbf164c | 2019-12-16 12:51:59 -0800 | [diff] [blame] | 59 | name = "encoder_test", |
| 60 | srcs = ["encoder_test.cc"], |
Rob Mohr | 0681948 | 2020-04-06 13:25:43 -0700 | [diff] [blame] | 61 | deps = [ |
| 62 | ":pw_protobuf", |
| 63 | "//pw_unit_test", |
| 64 | ], |
Alexei Frolov | bbf164c | 2019-12-16 12:51:59 -0800 | [diff] [blame] | 65 | ) |
| 66 | |
Alexei Frolov | bbbedff | 2020-03-11 14:21:38 -0700 | [diff] [blame] | 67 | pw_cc_test( |
| 68 | name = "find_test", |
| 69 | srcs = ["find_test.cc"], |
Rob Mohr | 0681948 | 2020-04-06 13:25:43 -0700 | [diff] [blame] | 70 | deps = [ |
| 71 | ":pw_protobuf", |
| 72 | "//pw_unit_test", |
| 73 | ], |
Alexei Frolov | bbbedff | 2020-03-11 14:21:38 -0700 | [diff] [blame] | 74 | ) |
| 75 | |
Alexei Frolov | bbf164c | 2019-12-16 12:51:59 -0800 | [diff] [blame] | 76 | # TODO(frolv): Figure out how to integrate pw_protobuf codegen into Bazel. |
| 77 | filegroup( |
| 78 | name = "codegen_test", |
| 79 | srcs = [ |
| 80 | "codegen_test.cc", |
| 81 | ], |
| 82 | ) |
Alexei Frolov | 9c2ed46 | 2020-01-13 15:35:42 -0800 | [diff] [blame] | 83 | |
| 84 | # TODO(frolv): Figure out what to do about size reports in Bazel. |
| 85 | filegroup( |
| 86 | name = "size_reports", |
| 87 | srcs = glob([ |
| 88 | "size_report/*.cc", |
| 89 | ]), |
| 90 | ) |