Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion source/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,13 @@ find_package(nlohmann_json REQUIRED)
find_package(fmt REQUIRED)
find_package(spdlog REQUIRED)
find_package(PkgConfig REQUIRED)
pkg_check_modules(gRPC REQUIRED IMPORTED_TARGET protobuf grpc++)
find_package(gRPC)
if (gRPC_FOUND)
set(GRPC_TARGET gRPC::grpc++)
else ()
pkg_check_modules(gRPC REQUIRED IMPORTED_TARGET protobuf grpc++)
set(GRPC_TARGET PkgConfig::gRPC)
endif()

if (UNIX AND NOT APPLE)
set(SUPPORT_PRELOAD 1)
Expand Down
2 changes: 1 addition & 1 deletion source/intercept/proto/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -62,4 +62,4 @@ target_sources(rpc_a
INTERFACE
$<TARGET_OBJECTS:rpc_a>
)
target_link_libraries(rpc_a PUBLIC PkgConfig::gRPC)
target_link_libraries(rpc_a PUBLIC ${GRPC_TARGET})