mirror of
https://github.com/zephyrproject-rtos/zephyr
synced 2025-09-09 17:51:57 +00:00
Add the nanopb library and generator tools as a module. Nanopb is a small code-size Protocol Buffers implementation in ansi C. It is especially suitable for use in microcontrollers, but fits any memory restricted system. Nanopb home: https://jpa.kapsi.fi/nanopb/ Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
16 lines
449 B
CMake
16 lines
449 B
CMake
# SPDX-License-Identifier: Apache-2.0
|
|
|
|
cmake_minimum_required(VERSION 3.13.1)
|
|
|
|
find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE})
|
|
project(nanopb_sample)
|
|
|
|
nanopb_generate_cpp(proto_sources proto_headers RELPATH .
|
|
src/simple.proto
|
|
)
|
|
# we need to be able to include generated header files
|
|
zephyr_library_include_directories(${CMAKE_CURRENT_BINARY_DIR})
|
|
|
|
FILE(GLOB app_sources src/*.c)
|
|
target_sources(app PRIVATE ${proto_sources} ${app_sources})
|