diff --git a/examples/grpc/CMakeLists.txt b/examples/grpc/CMakeLists.txt index 1ea1c9bee5..50e33beed6 100644 --- a/examples/grpc/CMakeLists.txt +++ b/examples/grpc/CMakeLists.txt @@ -33,10 +33,14 @@ include_directories( include_directories(${CMAKE_CURRENT_BINARY_DIR}) if(TARGET protobuf::libprotobuf) - target_link_libraries(example_grpc_proto gRPC::grpc++ protobuf::libprotobuf) + target_link_libraries(example_grpc_proto PUBLIC gRPC::grpc++ + protobuf::libprotobuf) else() - target_include_directories(example_grpc_proto ${Protobuf_INCLUDE_DIRS}) - target_link_libraries(example_grpc_proto ${Protobuf_LIBRARIES}) + target_include_directories(example_grpc_proto PUBLIC ${Protobuf_INCLUDE_DIRS}) + target_link_libraries(example_grpc_proto PUBLIC ${Protobuf_LIBRARIES}) +endif() +if(WITH_ABSEIL) + target_link_libraries(example_grpc_proto PUBLIC absl::bad_variant_access) endif() foreach(_target client server)