When building on windows with CONFIG_ZMK_STUDIO enabled, zephyr/modules/nanopb/nanopb.cmake will cause a fatal error on line 11 saying "'protoc' not found" unless protoc is installed and in the PATH, even though we are going to use the one provided by nanopb anyways. This is because it separately tries to find_program() protoc, and it does not search in nanopb.
The latest version of this file in Zephyr corrects this issue. It uses this instead, which loads the nanopb package and then checks if it found protoc:
find_package(Nanopb REQUIRED)
if(NOT PROTOBUF_PROTOC_EXECUTABLE)
message(FATAL_ERROR "'protoc' not found, please ensure protoc is installed\
and in path. See https://docs.zephyrproject.org/latest/samples/modules/nanopb/README.html")
else()
message(STATUS "Found protoc: ${PROTOBUF_PROTOC_EXECUTABLE}")
endif()
When building on windows with
CONFIG_ZMK_STUDIO
enabled, zephyr/modules/nanopb/nanopb.cmake will cause a fatal error on line 11 saying "'protoc' not found" unless protoc is installed and in the PATH, even though we are going to use the one provided by nanopb anyways. This is because it separately tries tofind_program()
protoc, and it does not search in nanopb.The latest version of this file in Zephyr corrects this issue. It uses this instead, which loads the nanopb package and then checks if it found protoc: