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
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,7 @@ if(${TRITON_COMMON_ENABLE_GRPC})
TARGETS
grpc-health-library
grpc-service-library
grpccallback-service-library
# grpc-service-py-library
EXPORT
triton-common-targets
Expand Down
52 changes: 52 additions & 0 deletions protobuf/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,58 @@ if(${TRITON_COMMON_ENABLE_GRPC})
)
endif()

#
# GRPC Callback Service
#
if(${TRITON_COMMON_ENABLE_GRPC})
get_filename_component(grpccallback_proto_abspath "grpccallback_service.proto" ABSOLUTE)
get_filename_component(grpccallback_proto_dir "${grpccallback_proto_abspath}" PATH)
set(GRPCCALLBACK_SRCS "grpccallback_service.grpc.pb.cc")
set(GRPCCALLBACK_HDRS "grpccallback_service.grpc.pb.h")

add_custom_command(
OUTPUT "${GRPCCALLBACK_SRCS}" "${GRPCCALLBACK_HDRS}"
COMMAND ${_PROTOBUF_PROTOC}
ARGS
--grpc_out "${CMAKE_CURRENT_BINARY_DIR}"
--cpp_out "${CMAKE_CURRENT_BINARY_DIR}"
-I "${grpccallback_proto_dir}"
--plugin=protoc-gen-grpc="${_GRPC_CPP_PLUGIN_EXECUTABLE}"
"grpccallback_service.proto"
DEPENDS "grpccallback_service.proto" proto-library
)

add_library(
grpccallback-service-library EXCLUDE_FROM_ALL OBJECT
${GRPCCALLBACK_SRCS} ${GRPCCALLBACK_HDRS}
)

target_include_directories(
grpccallback-service-library
PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}>
)

target_link_libraries(
grpccallback-service-library
PRIVATE
common-compile-settings
)

set_target_properties(
grpccallback-service-library
PROPERTIES
POSITION_INDEPENDENT_CODE ON
)

install(
FILES
${CMAKE_CURRENT_BINARY_DIR}/grpccallback_service.grpc.pb.h
DESTINATION include
OPTIONAL
)
endif()

#
# GRPC Health Service
#
Expand Down
Loading