third_party.pigweed.src/pw_protobuf_compiler/CMakeLists.txt
Wyatt Hepler bcaf883773 pw_protobuf_compiler: Handle deps on nanopb.proto
- Add a pw_proto_library for nanopb.proto to the CMake build.
- Skip recompiling nanopb.proto when running protoc for Nanopb.
- Add the pw_protobuf_compiler Nanopb test to CMake.

Change-Id: I3469f35524b18efd3d484b17609e9de0f160e73a
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/46961
Pigweed-Auto-Submit: Wyatt Hepler <hepler@google.com>
Reviewed-by: Alexei Frolov <frolv@google.com>
Commit-Queue: Wyatt Hepler <hepler@google.com>
2021-05-26 16:08:42 +00:00

35 lines
1.1 KiB
CMake

# Copyright 2021 The Pigweed Authors
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may not
# use this file except in compliance with the License. You may obtain a copy of
# the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations under
# the License.
include($ENV{PW_ROOT}/pw_build/pigweed.cmake)
include($ENV{PW_ROOT}/pw_protobuf_compiler/proto.cmake)
if(NOT "${dir_pw_third_party_nanopb}" STREQUAL "")
pw_proto_library(pw_protobuf_compiler.nanopb_test_protos
SOURCES
pw_protobuf_compiler_nanopb_protos/nanopb_test.proto
DEPS
pw_third_party.nanopb.proto
)
pw_add_test(pw_protobuf_compiler.nanopb_test
SOURCES
nanopb_test.cc
DEPS
pw_protobuf_compiler.nanopb_test_protos.nanopb
GROUPS
pw_protobuf_compiler
)
endif()