Skip to content

Commit

Permalink
Fixes link grpc on mac m1 (#2597)
Browse files Browse the repository at this point in the history
The `libgrpc.dylib` should depend on `libgpr.dylib`, otherwise the linker would fail.
  • Loading branch information
siyuan0322 committed Apr 12, 2023
1 parent b8232ab commit 3979f49
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion interactive_engine/lgraph/cmake/FindgRPC.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -72,12 +72,18 @@ find_path(GRPC_INCLUDE_DIR grpc/grpc.h)
mark_as_advanced(GRPC_INCLUDE_DIR)

# Find gRPC library
find_library(GRPC_GPR_LIBRARY NAMES gpr)
mark_as_advanced(GRPC_GPR_LIBRARY)
add_library(gRPC::gpr UNKNOWN IMPORTED)
set_target_properties(gRPC::gpr PROPERTIES
IMPORTED_LOCATION ${GRPC_GPR_LIBRARY})

find_library(GRPC_LIBRARY NAMES grpc)
mark_as_advanced(GRPC_LIBRARY)
add_library(gRPC::grpc UNKNOWN IMPORTED)
set_target_properties(gRPC::grpc PROPERTIES
INTERFACE_INCLUDE_DIRECTORIES ${GRPC_INCLUDE_DIR}
INTERFACE_LINK_LIBRARIES "-lpthread;-ldl"
INTERFACE_LINK_LIBRARIES "-lpthread;-ldl;gRPC::gpr"
IMPORTED_LOCATION ${GRPC_LIBRARY})

# Find gRPC C++ library
Expand Down

0 comments on commit 3979f49

Please sign in to comment.