From 48fa2473046007138a9a932e37db8c92132a15a5 Mon Sep 17 00:00:00 2001 From: Donna Dionne Date: Wed, 18 Mar 2020 09:49:26 -0700 Subject: [PATCH] Building C++ example with grpc++ instead of grpc++_unsecure The example should be build with grpc++, not grpc++_unsecure. For some reason in some branches like master, both versions are built in so problem not detected. This problem surfaced in 1.28x so needs to be fixed to link with the correct grpc++. --- examples/cpp/helloworld/CMakeLists.txt | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/examples/cpp/helloworld/CMakeLists.txt b/examples/cpp/helloworld/CMakeLists.txt index f158a75bd78..a5e2d9bb27c 100644 --- a/examples/cpp/helloworld/CMakeLists.txt +++ b/examples/cpp/helloworld/CMakeLists.txt @@ -60,7 +60,7 @@ if(GRPC_AS_SUBMODULE) else() set(_PROTOBUF_PROTOC $) endif() - set(_GRPC_GRPCPP_UNSECURE grpc++_unsecure) + set(_GRPC_GRPCPP grpc++) if(CMAKE_CROSSCOMPILING) find_program(_GRPC_CPP_PLUGIN_EXECUTABLE grpc_cpp_plugin) else() @@ -87,7 +87,7 @@ elseif(GRPC_FETCHCONTENT) set(_PROTOBUF_LIBPROTOBUF libprotobuf) set(_REFLECTION grpc++_reflection) set(_PROTOBUF_PROTOC $) - set(_GRPC_GRPCPP_UNSECURE grpc++_unsecure) + set(_GRPC_GRPCPP grpc++) if(CMAKE_CROSSCOMPILING) find_program(_GRPC_CPP_PLUGIN_EXECUTABLE grpc_cpp_plugin) else() @@ -116,7 +116,7 @@ else() find_package(gRPC CONFIG REQUIRED) message(STATUS "Using gRPC ${gRPC_VERSION}") - set(_GRPC_GRPCPP_UNSECURE gRPC::grpc++_unsecure) + set(_GRPC_GRPCPP gRPC::grpc++) if(CMAKE_CROSSCOMPILING) find_program(_GRPC_CPP_PLUGIN_EXECUTABLE grpc_cpp_plugin) else() @@ -155,6 +155,6 @@ foreach(_target ${hw_grpc_srcs}) target_link_libraries(${_target} ${_REFLECTION} - ${_GRPC_GRPCPP_UNSECURE} + ${_GRPC_GRPCPP} ${_PROTOBUF_LIBPROTOBUF}) endforeach()