-
Notifications
You must be signed in to change notification settings - Fork 260
Description
This one is a bit complicated. I need to use the shared versions of grpc and protobuf in my project. However, the shared grpc_cpp_plugin will not run, because it can't find the shared proto libs. It does not have an RPATH/RUNPATH set.
I was able to compile a static version of grpc_cpp_plugin by adding [options] *:shared!=False
to my build profile (note the ! is required or else the grpc requires recipe overrides the tool_requires recipe's shared option). However, at configure time, the shared version is found, not the static version.
Without using cmake-conan, this actually works, because the CMakeToolchain generator adds the path to the static grpc plugin to the PATH in CMakePresets.json. Grpc uses find_program to discover grpc_cpp_plugin. I realize find_program does not work properly in cmake-conan. However, I don't think find_program needs to be used here - the Conan grpc package knows where grpc_cpp_plugin is, so it could set the exact path instead of finding itself - but it would need to know to set the path to the tool_requires version and not the requires version.