Alexei Frolov | 942adf0 | 2019-12-11 17:07:28 -0800 | [diff] [blame] | 1 | # Copyright 2019 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 | |
Armando Montanez | fb3d3fb | 2020-06-09 18:12:12 -0700 | [diff] [blame] | 15 | import("//build_overrides/pigweed.gni") |
| 16 | |
Wyatt Hepler | 32edf12 | 2020-12-11 17:21:34 -0800 | [diff] [blame] | 17 | import("$dir_pw_build/python.gni") |
Alexei Frolov | 942adf0 | 2019-12-11 17:07:28 -0800 | [diff] [blame] | 18 | import("$dir_pw_docgen/docs.gni") |
Alexei Frolov | f39cd8b | 2020-04-13 17:59:20 -0700 | [diff] [blame] | 19 | import("$dir_pw_protobuf_compiler/proto.gni") |
Wyatt Hepler | d517afc | 2021-02-03 19:40:08 -0800 | [diff] [blame] | 20 | import("$dir_pw_third_party/nanopb/nanopb.gni") |
Alexei Frolov | f39cd8b | 2020-04-13 17:59:20 -0700 | [diff] [blame] | 21 | import("$dir_pw_unit_test/test.gni") |
Wyatt Hepler | d49f8fe | 2020-10-15 10:13:47 -0700 | [diff] [blame] | 22 | |
Alexei Frolov | 942adf0 | 2019-12-11 17:07:28 -0800 | [diff] [blame] | 23 | pw_doc_group("docs") { |
Rob Mohr | a0ba54f | 2020-02-27 11:43:49 -0800 | [diff] [blame] | 24 | sources = [ "docs.rst" ] |
Alexei Frolov | 942adf0 | 2019-12-11 17:07:28 -0800 | [diff] [blame] | 25 | } |
Alexei Frolov | f39cd8b | 2020-04-13 17:59:20 -0700 | [diff] [blame] | 26 | |
Alexei Frolov | f39cd8b | 2020-04-13 17:59:20 -0700 | [diff] [blame] | 27 | pw_test_group("tests") { |
Alexei Frolov | b499d3f | 2020-10-28 13:00:08 -0700 | [diff] [blame] | 28 | tests = [ ":nanopb_test" ] |
Alexei Frolov | f39cd8b | 2020-04-13 17:59:20 -0700 | [diff] [blame] | 29 | } |
| 30 | |
Alexei Frolov | b499d3f | 2020-10-28 13:00:08 -0700 | [diff] [blame] | 31 | pw_test("nanopb_test") { |
| 32 | deps = [ ":nanopb_test_protos.nanopb" ] |
| 33 | sources = [ "nanopb_test.cc" ] |
| 34 | enable_if = dir_pw_third_party_nanopb != "" |
| 35 | } |
Alexei Frolov | f39cd8b | 2020-04-13 17:59:20 -0700 | [diff] [blame] | 36 | |
Alexei Frolov | b499d3f | 2020-10-28 13:00:08 -0700 | [diff] [blame] | 37 | pw_proto_library("nanopb_test_protos") { |
Wyatt Hepler | 32edf12 | 2020-12-11 17:21:34 -0800 | [diff] [blame] | 38 | sources = [ "pw_protobuf_compiler_nanopb_protos/nanopb_test.proto" ] |
Wyatt Hepler | d517afc | 2021-02-03 19:40:08 -0800 | [diff] [blame] | 39 | |
| 40 | if (dir_pw_third_party_nanopb != "") { |
| 41 | deps = [ "$dir_pw_third_party/nanopb:proto" ] |
| 42 | } |
Wyatt Hepler | 32edf12 | 2020-12-11 17:21:34 -0800 | [diff] [blame] | 43 | } |
| 44 | |
| 45 | pw_proto_library("test_protos") { |
| 46 | sources = [ |
| 47 | "pw_protobuf_compiler_protos/nested/more_nesting/test.proto", |
| 48 | "pw_protobuf_compiler_protos/test.proto", |
| 49 | ] |
| 50 | } |
| 51 | |
| 52 | # PyPI Requirements needed to install Python protobuf packages. |
| 53 | pw_python_requirements("protobuf_requirements") { |
Anthony DiGirolamo | 75e038f | 2021-08-20 11:14:26 -0700 | [diff] [blame] | 54 | requirements = [ |
| 55 | # NOTE: mypy needs to stay in sync with mypy-protobuf |
| 56 | # Currently using mypy 0.910 and mypy-protobuf 2.9 |
| 57 | # This must also be specified in //pw_protobuf_compiler/py/setup.cfg |
| 58 | "mypy-protobuf==2.9", |
| 59 | ] |
Alexei Frolov | f39cd8b | 2020-04-13 17:59:20 -0700 | [diff] [blame] | 60 | } |