diff --git a/cpp/cmake_modules/FindgRPCAlt.cmake b/cpp/cmake_modules/FindgRPCAlt.cmake index c5d8c8a8126cf..81d8cf7ca68ee 100644 --- a/cpp/cmake_modules/FindgRPCAlt.cmake +++ b/cpp/cmake_modules/FindgRPCAlt.cmake @@ -36,7 +36,7 @@ if(GRPCPP_PC_FOUND) # gRPC's pkg-config file neglects to specify pthreads. find_package(Threads REQUIRED) if(ARROW_GRPC_USE_SHARED) - set(GRPCPP_LINK_LIBRARIES ${GRPCPP_PC_LINK_LIBRARIES} Threads::Threads) + set(GRPCPP_LINK_LIBRARIES ${GRPCPP_PC_LINK_LIBRARIES}) set(GRPCPP_LINK_OPTIONS ${GRPCPP_PC_LDFLAGS_OTHER}) set(GRPCPP_COMPILE_OPTIONS ${GRPCPP_PC_CFLAGS_OTHER}) else() @@ -47,10 +47,10 @@ if(GRPCPP_PC_FOUND) HINTS ${GRPCPP_PC_STATIC_LIBRARY_DIRS}) list(APPEND GRPCPP_LINK_LIBRARIES "${GRPCPP_LIBRARY_${GRPCPP_LIBRARY_NAME}}") endforeach() - list(APPEND GRPCPP_LINK_LIBRARIES Threads::Threads) set(GRPCPP_LINK_OPTIONS ${GRPCPP_PC_STATIC_LDFLAGS_OTHER}) set(GRPCPP_COMPILE_OPTIONS ${GRPCPP_PC_STATIC_CFLAGS_OTHER}) endif() + list(APPEND GRPCPP_LINK_LIBRARIES Threads::Threads) list(GET GRPCPP_LINK_LIBRARIES 0 GRPCPP_IMPORTED_LOCATION) list(REMOVE_AT GRPCPP_LINK_LIBRARIES 0) find_program(GRPC_CPP_PLUGIN grpc_cpp_plugin