kou commented on a change in pull request #9096:
URL: https://github.com/apache/arrow/pull/9096#discussion_r556914854



##########
File path: cpp/cmake_modules/ThirdpartyToolchain.cmake
##########
@@ -2466,7 +2470,7 @@ macro(build_grpc)
       -DgRPC_GFLAGS_PROVIDER=package
       -DgRPC_MSVC_STATIC_RUNTIME=${ARROW_USE_STATIC_CRT}
       -DgRPC_PROTOBUF_PROVIDER=package
-      -DgRPC_PROTOBUF_PACKAGE_TYPE=CONFIG
+      -DgRPC_PROTOBUF_PACKAGE_TYPE=${gRPC_PROTOBUF_PACKAGE_TYPE}

Review comment:
       How about the following?
   
   ```diff
   diff --git a/cpp/cmake_modules/ThirdpartyToolchain.cmake 
b/cpp/cmake_modules/ThirdpartyToolchain.cmake
   index e5c72be89..1ebf836a3 100644
   --- a/cpp/cmake_modules/ThirdpartyToolchain.cmake
   +++ b/cpp/cmake_modules/ThirdpartyToolchain.cmake
   @@ -1326,6 +1326,7 @@ endif()
    
    macro(build_protobuf)
      message("Building Protocol Buffers from source")
   +  set(PROTOBUF_VENDORED TRUE)
      set(PROTOBUF_PREFIX "${CMAKE_CURRENT_BINARY_DIR}/protobuf_ep-install")
      set(PROTOBUF_INCLUDE_DIR "${PROTOBUF_PREFIX}/include")
      # Newer protobuf releases always have a lib prefix independent from 
CMAKE_STATIC_LIBRARY_PREFIX
   @@ -2466,13 +2467,15 @@ macro(build_grpc)
          -DgRPC_GFLAGS_PROVIDER=package
          -DgRPC_MSVC_STATIC_RUNTIME=${ARROW_USE_STATIC_CRT}
          -DgRPC_PROTOBUF_PROVIDER=package
   -      -DgRPC_PROTOBUF_PACKAGE_TYPE=CONFIG
          -DgRPC_RE2_PROVIDER=package
          -DgRPC_SSL_PROVIDER=package
          -DgRPC_ZLIB_PROVIDER=package
          -DCMAKE_INSTALL_PREFIX=${GRPC_PREFIX}
          -DCMAKE_INSTALL_LIBDIR=lib
          -DBUILD_SHARED_LIBS=OFF)
   +  if(PROTOBUF_VENDORED)
   +    list(APPEND GRPC_CMAKE_ARGS -DgRPC_PROTOBUF_PACKAGE_TYPE=CONFIG)
   +  endif()
      if(OPENSSL_ROOT_DIR)
        list(APPEND GRPC_CMAKE_ARGS -DOPENSSL_ROOT_DIR=${OPENSSL_ROOT_DIR})
      endif()
   ```




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to