Skip to content

Commit

Permalink
adopt changes from #316
Browse files Browse the repository at this point in the history
  • Loading branch information
apolukhin committed Jul 1, 2023
1 parent ef6cd42 commit 2883a3b
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions cmake/GrpcTargets.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,9 @@ function(generate_grpc_files)

set(did_generate_proto_sources FALSE)
if("${newest_proto_dependency}" IS_NEWER_THAN "${GENERATED_PROTO_DIR}/${path_base}.pb.cc")
# resolve root_path, proto_file to real path's - protoc check that root_path is prefix of proto_file (this can be non true if project inside folder sym linked to other dir)
get_filename_component(real_root_path ${root_path} REALPATH)
get_filename_component(real_proto_file ${proto_file} REALPATH)
execute_process(
COMMAND mkdir -p proto
COMMAND ${PROTOBUF_PROTOC} ${include_options}
Expand All @@ -156,12 +159,12 @@ function(generate_grpc_files)
--python_out=${GENERATED_PROTO_DIR}
--grpc_python_out=${GENERATED_PROTO_DIR}
${pyi_out_param}
-I ${root_path}
-I ${real_root_path}
-I ${USERVER_PROTOBUF_IMPORT_DIR}
--plugin=protoc-gen-grpc=${PROTO_GRPC_CPP_PLUGIN}
--plugin=protoc-gen-usrv=${PROTO_GRPC_USRV_PLUGIN}
--plugin=protoc-gen-grpc_python=${PROTO_GRPC_PYTHON_PLUGIN}
${proto_file}
${real_proto_file}
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
RESULT_VARIABLE execute_process_result
)
Expand Down

0 comments on commit 2883a3b

Please sign in to comment.