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



##########
File path: cpp/cmake_modules/FindgRPCAlt.cmake
##########
@@ -56,6 +56,20 @@ if(GRPCPP_PC_FOUND)
     list(APPEND gRPCAlt_FIND_PACKAGE_ARGS VERSION_VAR gRPCAlt_VERSION)
   endif()
   find_package_handle_standard_args(${gRPCAlt_FIND_PACKAGE_ARGS})
+
+  # gRPC does not expose the reflection library via pkg-config, but it should 
be alongside the main library
+  get_filename_component(GRPCPP_IMPORTED_DIRECTORY ${GRPCPP_IMPORTED_LOCATION} 
DIRECTORY)
+  if(ARROW_GRPC_USE_SHARED)
+    set(GRPCPP_REFLECTION_LIB_NAME
+        
"${CMAKE_SHARED_LIBRARY_PREFIX}grpc++_reflection${CMAKE_SHARED_LIBRARY_SUFFIX}")
+  else()
+    set(GRPCPP_REFLECTION_LIB_NAME
+        
"${CMAKE_STATIC_LIBRARY_PREFIX}grpc++_reflection${CMAKE_STATIC_LIBRARY_SUFFIX}")
+  endif()
+  find_library(GRPCPP_REFLECTION_IMPORTED_LOCATION
+               NAMES grpc++_reflection ${GRPCPP_REFLECTION_LIB_NAME}
+               HINTS ${GRPCPP_IMPORTED_DIRECTORY}
+               PATH_SUFFIXES ${ARROW_LIBRARY_PATH_SUFFIXES})

Review comment:
       How about finding only from the same directory for `libgrpc++.so`?
   
   ```suggestion
                  PATHS ${GRPCPP_IMPORTED_DIRECTORY}
                  NO_DEFAULT_PATH)
   ```




-- 
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.

To unsubscribe, e-mail: [email protected]

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


Reply via email to