Skip to content

Commit

Permalink
copy the .proto files into one location before running concatenate
Browse files Browse the repository at this point in the history
something about the protoc compiler (maybe just on Python 3.12?) doesn't
like multiple -P path arguments, and until that's fixed, it's easier to
just copy the files into one spot, which works fine
  • Loading branch information
bsstephan committed Jun 11, 2024
1 parent 086d48a commit a205bae
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions patch_board_config.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,20 @@ function (patch_board_config)
set(VENV_BIN_DIR ${VENV}/bin)
endif()

set(PROTO_OUTPUT_DIR ${CMAKE_CURRENT_BINARY_DIR}/proto)

add_custom_target(
PatchBoardConfig ALL
DEPENDS ${PROJECT_NAME}
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
# something in the protobuf compiler doesn't like the multiple paths,
# so we'll copy all the .proto files into one location
COMMAND ${CMAKE_COMMAND} -E make_directory ${PROTO_OUTPUT_DIR}
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_SOURCE_DIR}/lib/nanopb/generator/proto/nanopb.proto ${PROTO_OUTPUT_DIR}
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_SOURCE_DIR}/proto/enums.proto ${PROTO_OUTPUT_DIR}
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_SOURCE_DIR}/proto/config.proto ${PROTO_OUTPUT_DIR}
COMMAND ${VENV_BIN_DIR}/concatenate
-P ./proto
-P ./lib/nanopb/generator/proto
-P ${PROTO_OUTPUT_DIR}
./build/${PROJECT_NAME}_${CMAKE_PROJECT_VERSION}_${GP2040_BOARDCONFIG}.bin
--json-board-config-filename ./configs/${GP2040_BOARDCONFIG}/board-config.json
--backup
Expand Down

0 comments on commit a205bae

Please sign in to comment.