Skip to content

grpc plugin with shared=True doesn't work #709

@alex1234567890123456789

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions