cmake: fix cross-compilation with gRPC_BUILD_GRPC_CPP_PLUGIN=OFF (#30378)

commit 99752b173c reintroduced the cross-compilation issue which was fixed by da10b795e1
pull/30837/head
Michael Nosthoff 2 years ago committed by GitHub
parent ca8b437613
commit 3353d61c5a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      CMakeLists.txt
  2. 2
      templates/CMakeLists.txt.template

2
CMakeLists.txt generated

@ -514,7 +514,7 @@ function(protobuf_generate_grpc_cpp_with_import_path_correction FILE_LOCATION IM
--plugin=protoc-gen-grpc=${_gRPC_CPP_PLUGIN}
${_protobuf_include_path}
${REL_FIL}
DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${FILE_LOCATION} ${ABS_FIL} ${_gRPC_PROTOBUF_PROTOC} grpc_cpp_plugin
DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${FILE_LOCATION} ${ABS_FIL} ${_gRPC_PROTOBUF_PROTOC} ${_gRPC_CPP_PLUGIN}
WORKING_DIRECTORY ${_gRPC_PROTO_SRCS_DIR}
COMMENT "Running gRPC C++ protocol buffer compiler for ${IMPORT_PATH}"
VERBATIM)

@ -498,7 +498,7 @@
--plugin=protoc-gen-grpc=<%text>${_gRPC_CPP_PLUGIN}</%text>
<%text>${_protobuf_include_path}</%text>
<%text>${REL_FIL}</%text>
DEPENDS <%text>${CMAKE_CURRENT_SOURCE_DIR}/${FILE_LOCATION}</%text> <%text>${ABS_FIL}</%text> <%text>${_gRPC_PROTOBUF_PROTOC}</%text> grpc_cpp_plugin
DEPENDS <%text>${CMAKE_CURRENT_SOURCE_DIR}/${FILE_LOCATION}</%text> <%text>${ABS_FIL}</%text> <%text>${_gRPC_PROTOBUF_PROTOC}</%text> <%text>${_gRPC_CPP_PLUGIN}</%text>
WORKING_DIRECTORY <%text>${_gRPC_PROTO_SRCS_DIR}</%text>
COMMENT "Running gRPC C++ protocol buffer compiler for <%text>${IMPORT_PATH}</%text>"
VERBATIM)

Loading…
Cancel
Save