Skip to content

Commit c1b2396

Browse files
authored
chore(build): fix protoc binary name (#2400)
1 parent 407c0d1 commit c1b2396

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

protoc-gen-rust-grpc/CMakeLists.txt

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,10 +77,17 @@ set_target_properties(protoc-gen-rust-grpc
7777
)
7878

7979
# Add protoc executable as a custom target that copies the built protoc
80+
# We explicitly name it "protoc" without version suffix
81+
if(WIN32)
82+
set(PROTOC_OUTPUT_NAME "protoc.exe")
83+
else()
84+
set(PROTOC_OUTPUT_NAME "protoc")
85+
endif()
86+
8087
add_custom_target(copy-protoc ALL
8188
COMMAND ${CMAKE_COMMAND} -E copy_if_different
8289
$<TARGET_FILE:protoc>
83-
${CMAKE_BINARY_DIR}/bin/$<TARGET_FILE_NAME:protoc>
90+
${CMAKE_BINARY_DIR}/bin/${PROTOC_OUTPUT_NAME}
8491
DEPENDS protoc
8592
COMMENT "Copying protoc to output directory"
8693
)
@@ -89,7 +96,7 @@ add_custom_target(copy-protoc ALL
8996
install(TARGETS protoc-gen-rust-grpc
9097
RUNTIME DESTINATION bin
9198
)
92-
install(PROGRAMS ${CMAKE_BINARY_DIR}/bin/$<TARGET_FILE_NAME:protoc>
99+
install(PROGRAMS ${CMAKE_BINARY_DIR}/bin/${PROTOC_OUTPUT_NAME}
93100
DESTINATION bin
94101
)
95102

0 commit comments

Comments
 (0)