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 15import("//build_overrides/pigweed.gni") 16 17import("$dir_pw_build/python.gni") 18import("$dir_pw_docgen/docs.gni") 19import("$dir_pw_protobuf_compiler/proto.gni") 20import("$dir_pw_third_party/nanopb/nanopb.gni") 21import("$dir_pw_unit_test/test.gni") 22 23pw_doc_group("docs") { 24 sources = [ "docs.rst" ] 25} 26 27pw_test_group("tests") { 28 tests = [ ":nanopb_test" ] 29} 30 31pw_test("nanopb_test") { 32 deps = [ ":nanopb_test_protos.nanopb" ] 33 sources = [ "nanopb_test.cc" ] 34 enable_if = dir_pw_third_party_nanopb != "" 35} 36 37pw_proto_library("nanopb_test_protos") { 38 sources = [ "pw_protobuf_compiler_nanopb_protos/nanopb_test.proto" ] 39 40 if (dir_pw_third_party_nanopb != "") { 41 deps = [ "$dir_pw_third_party/nanopb:proto" ] 42 } 43} 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") { 54 # mypy-protobuf 1.24 is required to support optional fields in proto3. 55 requirements = [ "mypy-protobuf>=2.2" ] 56} 57