blob: 62f2819cc3997bc772ca0774d777dc1807ca5203 [file] [log] [blame]
Alexei Frolov942adf02019-12-11 17:07:28 -08001# 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 Montanezfb3d3fb2020-06-09 18:12:12 -070015import("//build_overrides/pigweed.gni")
16
Wyatt Hepler32edf122020-12-11 17:21:34 -080017import("$dir_pw_build/python.gni")
Alexei Frolov942adf02019-12-11 17:07:28 -080018import("$dir_pw_docgen/docs.gni")
Alexei Frolovf39cd8b2020-04-13 17:59:20 -070019import("$dir_pw_protobuf_compiler/proto.gni")
Wyatt Heplerd517afc2021-02-03 19:40:08 -080020import("$dir_pw_third_party/nanopb/nanopb.gni")
Alexei Frolovf39cd8b2020-04-13 17:59:20 -070021import("$dir_pw_unit_test/test.gni")
Wyatt Heplerd49f8fe2020-10-15 10:13:47 -070022
Alexei Frolov942adf02019-12-11 17:07:28 -080023pw_doc_group("docs") {
Rob Mohra0ba54f2020-02-27 11:43:49 -080024 sources = [ "docs.rst" ]
Alexei Frolov942adf02019-12-11 17:07:28 -080025}
Alexei Frolovf39cd8b2020-04-13 17:59:20 -070026
Alexei Frolovf39cd8b2020-04-13 17:59:20 -070027pw_test_group("tests") {
Alexei Frolovb499d3f2020-10-28 13:00:08 -070028 tests = [ ":nanopb_test" ]
Alexei Frolovf39cd8b2020-04-13 17:59:20 -070029}
30
Alexei Frolovb499d3f2020-10-28 13:00:08 -070031pw_test("nanopb_test") {
32 deps = [ ":nanopb_test_protos.nanopb" ]
33 sources = [ "nanopb_test.cc" ]
34 enable_if = dir_pw_third_party_nanopb != ""
35}
Alexei Frolovf39cd8b2020-04-13 17:59:20 -070036
Alexei Frolovb499d3f2020-10-28 13:00:08 -070037pw_proto_library("nanopb_test_protos") {
Wyatt Hepler32edf122020-12-11 17:21:34 -080038 sources = [ "pw_protobuf_compiler_nanopb_protos/nanopb_test.proto" ]
Wyatt Heplerd517afc2021-02-03 19:40:08 -080039
40 if (dir_pw_third_party_nanopb != "") {
41 deps = [ "$dir_pw_third_party/nanopb:proto" ]
42 }
Wyatt Hepler32edf122020-12-11 17:21:34 -080043}
44
45pw_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.
53pw_python_requirements("protobuf_requirements") {
Anthony DiGirolamo75e038f2021-08-20 11:14:26 -070054 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 Frolovf39cd8b2020-04-13 17:59:20 -070060}