• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright 2021 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
15include($ENV{PW_ROOT}/pw_build/pigweed.cmake)
16include($ENV{PW_ROOT}/pw_protobuf_compiler/proto.cmake)
17
18pw_proto_library(pw_protobuf_compiler.pwpb_test_protos
19  SOURCES
20    pw_protobuf_compiler_pwpb_protos/pwpb_test.proto
21  INPUTS
22    pw_protobuf_compiler_pwpb_protos/pwpb_test.options
23)
24
25pw_add_test(pw_protobuf_compiler.pwpb_test
26  SOURCES
27    pwpb_test.cc
28  PRIVATE_DEPS
29    pw_protobuf_compiler.pwpb_test_protos.pwpb
30  GROUPS
31    pw_protobuf_compiler
32)
33
34if(NOT "${dir_pw_third_party_nanopb}" STREQUAL "")
35  pw_proto_library(pw_protobuf_compiler.nanopb_test_protos
36    SOURCES
37      pw_protobuf_compiler_nanopb_protos/nanopb_test.proto
38    DEPS
39      pw_third_party.nanopb.proto
40  )
41
42  pw_add_test(pw_protobuf_compiler.nanopb_test
43    SOURCES
44      nanopb_test.cc
45    PRIVATE_DEPS
46      pw_protobuf_compiler.nanopb_test_protos.nanopb
47    GROUPS
48      pw_protobuf_compiler
49  )
50endif()
51