diff --git a/cpp/cmake_modules/DefineOptions.cmake b/cpp/cmake_modules/DefineOptions.cmake index d823444cf790f..a7bf9e59f8aa2 100644 --- a/cpp/cmake_modules/DefineOptions.cmake +++ b/cpp/cmake_modules/DefineOptions.cmake @@ -640,6 +640,11 @@ Always OFF if building binaries" OFF) "Compiler flags to append when pre-compiling Gandiva operations" "") + #---------------------------------------------------------------------- + set_option_category("Cross compiling") + + define_option_string(ARROW_GRPC_CPP_PLUGIN "grpc_cpp_plugin path to be used" "") + #---------------------------------------------------------------------- set_option_category("Advanced developer") diff --git a/cpp/cmake_modules/ThirdpartyToolchain.cmake b/cpp/cmake_modules/ThirdpartyToolchain.cmake index db151b4e0f44b..0b215b5b25c62 100644 --- a/cpp/cmake_modules/ThirdpartyToolchain.cmake +++ b/cpp/cmake_modules/ThirdpartyToolchain.cmake @@ -4223,6 +4223,14 @@ if(ARROW_WITH_GRPC) target_link_libraries(gRPC::grpc++ INTERFACE gRPC::grpc_asan_suppressed) endif() endif() + + if(ARROW_GRPC_CPP_PLUGIN) + if(NOT TARGET gRPC::grpc_cpp_plugin) + add_executable(gRPC::grpc_cpp_plugin IMPORTED) + endif() + set_target_properties(gRPC::grpc_cpp_plugin PROPERTIES IMPORTED_LOCATION + ${ARROW_GRPC_CPP_PLUGIN}) + endif() endif() # ----------------------------------------------------------------------