Skip to content

Commit

Permalink
MINOR: [C++] Cleanup FindgRPCAlt (#36584)
Browse files Browse the repository at this point in the history
This removes some redundant code by moving the adding of threads to grpc link libs outside of the if()

Lead-authored-by: Jacob Wujciak-Jens <[email protected]>
Co-authored-by: Sutou Kouhei <[email protected]>
Signed-off-by: Sutou Kouhei <[email protected]>
  • Loading branch information
assignUser and kou authored Jul 10, 2023
1 parent dc5e23e commit 3d00668
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions cpp/cmake_modules/FindgRPCAlt.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand All @@ -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
Expand Down

0 comments on commit 3d00668

Please sign in to comment.