Skip to content

Commit 090b91b

Browse files
committed
copy the .proto files into one location before running concatenate
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
1 parent e7d1045 commit 090b91b

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

patch_board_config.cmake

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,20 @@ function (patch_board_config)
88
set(VENV_BIN_DIR ${VENV}/bin)
99
endif()
1010

11+
set(PROTO_OUTPUT_DIR ${CMAKE_CURRENT_BINARY_DIR}/proto)
12+
1113
add_custom_target(
1214
PatchBoardConfig ALL
1315
DEPENDS ${PROJECT_NAME}
1416
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
17+
# something in the protobuf compiler doesn't like the multiple paths,
18+
# so we'll copy all the .proto files into one location
19+
COMMAND ${CMAKE_COMMAND} -E make_directory ${PROTO_OUTPUT_DIR}
20+
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_SOURCE_DIR}/lib/nanopb/generator/proto/nanopb.proto ${PROTO_OUTPUT_DIR}
21+
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_SOURCE_DIR}/proto/enums.proto ${PROTO_OUTPUT_DIR}
22+
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_SOURCE_DIR}/proto/config.proto ${PROTO_OUTPUT_DIR}
1523
COMMAND ${VENV_BIN_DIR}/concatenate
16-
-P ./proto
17-
-P ./lib/nanopb/generator/proto
24+
-P ${PROTO_OUTPUT_DIR}
1825
./build/${PROJECT_NAME}_${CMAKE_PROJECT_VERSION}_${GP2040_BOARDCONFIG}.bin
1926
--json-board-config-filename ./configs/${GP2040_BOARDCONFIG}/board-config.json
2027
--backup

0 commit comments

Comments
 (0)