Skip to content

Commit 2883a3b

Browse files
committed
adopt changes from #316
1 parent ef6cd42 commit 2883a3b

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

cmake/GrpcTargets.cmake

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,9 @@ function(generate_grpc_files)
147147

148148
set(did_generate_proto_sources FALSE)
149149
if("${newest_proto_dependency}" IS_NEWER_THAN "${GENERATED_PROTO_DIR}/${path_base}.pb.cc")
150+
# 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)
151+
get_filename_component(real_root_path ${root_path} REALPATH)
152+
get_filename_component(real_proto_file ${proto_file} REALPATH)
150153
execute_process(
151154
COMMAND mkdir -p proto
152155
COMMAND ${PROTOBUF_PROTOC} ${include_options}
@@ -156,12 +159,12 @@ function(generate_grpc_files)
156159
--python_out=${GENERATED_PROTO_DIR}
157160
--grpc_python_out=${GENERATED_PROTO_DIR}
158161
${pyi_out_param}
159-
-I ${root_path}
162+
-I ${real_root_path}
160163
-I ${USERVER_PROTOBUF_IMPORT_DIR}
161164
--plugin=protoc-gen-grpc=${PROTO_GRPC_CPP_PLUGIN}
162165
--plugin=protoc-gen-usrv=${PROTO_GRPC_USRV_PLUGIN}
163166
--plugin=protoc-gen-grpc_python=${PROTO_GRPC_PYTHON_PLUGIN}
164-
${proto_file}
167+
${real_proto_file}
165168
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
166169
RESULT_VARIABLE execute_process_result
167170
)

0 commit comments

Comments
 (0)