File tree Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Original file line number Diff line number Diff 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+
8087add_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
8996install (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
You can’t perform that action at this time.
0 commit comments