From 8ac598b3a91f3cef3f514f00aa14f4fc3a5605c3 Mon Sep 17 00:00:00 2001 From: Lucio Franco Date: Fri, 22 Aug 2025 11:13:37 -0400 Subject: [PATCH] chore(build): fix protoc binary name --- protoc-gen-rust-grpc/CMakeLists.txt | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/protoc-gen-rust-grpc/CMakeLists.txt b/protoc-gen-rust-grpc/CMakeLists.txt index 481020f8b..66039e8cb 100644 --- a/protoc-gen-rust-grpc/CMakeLists.txt +++ b/protoc-gen-rust-grpc/CMakeLists.txt @@ -77,10 +77,17 @@ set_target_properties(protoc-gen-rust-grpc ) # Add protoc executable as a custom target that copies the built protoc +# We explicitly name it "protoc" without version suffix +if(WIN32) + set(PROTOC_OUTPUT_NAME "protoc.exe") +else() + set(PROTOC_OUTPUT_NAME "protoc") +endif() + add_custom_target(copy-protoc ALL COMMAND ${CMAKE_COMMAND} -E copy_if_different $ - ${CMAKE_BINARY_DIR}/bin/$ + ${CMAKE_BINARY_DIR}/bin/${PROTOC_OUTPUT_NAME} DEPENDS protoc COMMENT "Copying protoc to output directory" ) @@ -89,7 +96,7 @@ add_custom_target(copy-protoc ALL install(TARGETS protoc-gen-rust-grpc RUNTIME DESTINATION bin ) -install(PROGRAMS ${CMAKE_BINARY_DIR}/bin/$ +install(PROGRAMS ${CMAKE_BINARY_DIR}/bin/${PROTOC_OUTPUT_NAME} DESTINATION bin )