You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
One can put an external_program returned by the find_program() as a dependency for the custom target only if the program is an executable target that is a part of the built (so it is likely an exe not an external_program). Unfortunately, you cannot depend on the program found in the PATH.
Moreover, I didn't see a clean solution for determining where the program is coming from that covers all the cases.
It would be nice to unify the experience and always put the program into the list of dependencies.
Note: it is about the case not covered by auto-added dependencies in the list of the command parameters.
Consider the following example:
protoc = find_program('protoc')
grpc_cpp_plugin = find_program('grpc_cpp_plugin')
proto_generated_sources = custom_target('my-proto-gen-sources',
input: proto_files,
output: proto_generated_output_names,
command: [protoc,
'--proto_path=@CURRENT_SOURCE_DIR@',
'--plugin=protoc-gen-grpc=' + grpc_cpp_plugin.full_path(), # this cannot be used to auto add a dependency
'--grpc_out=@OUTDIR@', '--cpp_out=@OUTDIR@',
'@INPUT@'],
depends: [is_grpc_internal ? grpc_cpp_plugin : []], # how to determine `is_grpc_internal` is not clear
)
The text was updated successfully, but these errors were encountered:
This is a well known issue that we've talked about how to handle it, because we don't want to add it to depends, we want to handle it correctly via command.
I had proposed #12287 at one point (now very out of date), but that didn't really move forward.
One can put an
external_program
returned by thefind_program()
as a dependency for the custom target only if the program is an executable target that is a part of the built (so it is likely anexe
not anexternal_program
). Unfortunately, you cannot depend on the program found in the PATH.Moreover, I didn't see a clean solution for determining where the program is coming from that covers all the cases.
It would be nice to unify the experience and always put the program into the list of dependencies.
Note: it is about the case not covered by auto-added dependencies in the list of the
command
parameters.Consider the following example:
The text was updated successfully, but these errors were encountered: