-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' of https://github.com/grpc/grpc into interop_se…
…rver_split
- Loading branch information
Showing
122 changed files
with
3,127 additions
and
1,605 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
# Minimum CMake required | ||
cmake_minimum_required(VERSION 2.8) | ||
|
||
# Project | ||
project(HelloWorld CXX) | ||
|
||
# Protobuf | ||
set(protobuf_MODULE_COMPATIBLE TRUE) | ||
find_package(protobuf CONFIG REQUIRED) | ||
message(STATUS "Using protobuf ${protobuf_VERSION}") | ||
|
||
# gRPC | ||
find_package(gRPC CONFIG REQUIRED) | ||
message(STATUS "Using gRPC ${gRPC_VERSION}") | ||
|
||
# gRPC C++ plugin | ||
get_target_property(gRPC_CPP_PLUGIN_EXECUTABLE gRPC::grpc_cpp_plugin | ||
IMPORTED_LOCATION_RELEASE) | ||
|
||
# Proto file | ||
get_filename_component(hw_proto "../../protos/helloworld.proto" ABSOLUTE) | ||
get_filename_component(hw_proto_path "${hw_proto}" PATH) | ||
|
||
# Generated sources | ||
protobuf_generate_cpp(hw_proto_srcs hw_proto_hdrs "${hw_proto}") | ||
set(hw_grpc_srcs "${CMAKE_CURRENT_BINARY_DIR}/helloworld.grpc.pb.cc") | ||
set(hw_grpc_hdrs "${CMAKE_CURRENT_BINARY_DIR}/helloworld.grpc.pb.h") | ||
add_custom_command( | ||
OUTPUT "${hw_grpc_srcs}" "${hw_grpc_hdrs}" | ||
COMMAND protobuf::protoc | ||
ARGS --grpc_out "${CMAKE_CURRENT_BINARY_DIR}" -I "${hw_proto_path}" | ||
--plugin=protoc-gen-grpc="${gRPC_CPP_PLUGIN_EXECUTABLE}" | ||
"${hw_proto}" | ||
DEPENDS "${hw_proto}") | ||
|
||
# Generated include directory | ||
include_directories("${CMAKE_CURRENT_BINARY_DIR}") | ||
|
||
# Targets greeter_[async_](client|server) | ||
foreach(_target | ||
greeter_client greeter_server | ||
greeter_async_client greeter_async_server) | ||
add_executable(${_target} "${_target}.cc" | ||
${hw_proto_srcs} | ||
${hw_grpc_srcs}) | ||
target_link_libraries(${_target} | ||
protobuf::libprotobuf | ||
gRPC::grpc++_unsecure) | ||
endforeach() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.