Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[protobuf] Only find protoc when cross compiling #5258

Merged
merged 1 commit into from Apr 20, 2021

Conversation

anton-danielsson
Copy link
Contributor

@anton-danielsson anton-danielsson commented Apr 18, 2021

Only use find_program to search for protoc if cross compiling.
This is to make sure a system installed protoc is never used in
a normal situation while still allowing a build profile (or system)
protoc to be used when cross compiling.

This fixes an issue introduced in #4556 that would cause a system installed protoc to have a higher priority when a project is built using cmake-conan (https://github.com/conan-io/cmake-conan).

I created a minimal project and a few scripts to try to make sure it works in the situation I could imagine, see:
https://github.com/anton-danielsson/test-conan-protobuf

Specify library name and version: protobuf


  • I've read the guidelines for contributing.
  • I've followed the PEP8 style guides for Python code in the recipes.
  • I've used the latest Conan client version.
  • I've tried at least one configuration locally with the
    conan-center hook activated.

Only use find_program to search for protoc if cross compiling.
This is to make sure a system installed protoc is never used in
a normal situation while still allowing a build profile (or system)
protoc to be used when cross compiling.
@conan-center-bot
Copy link
Collaborator

All green in build 1 (f1da846119bdb9f01d00ad398163c8f97f888ddf):

  • protobuf/3.9.1@:
    All packages built successfully! (All logs)

  • protobuf/3.11.3@:
    All packages built successfully! (All logs)

  • protobuf/3.11.4@:
    All packages built successfully! (All logs)

  • protobuf/3.13.0@:
    All packages built successfully! (All logs)

  • protobuf/3.15.5@:
    All packages built successfully! (All logs)

  • protobuf/3.12.4@:
    All packages built successfully! (All logs)

@conan-center-bot conan-center-bot merged commit 45f2de2 into conan-io:master Apr 20, 2021
AlvaroFS pushed a commit to AlvaroFS/conan-center-index that referenced this pull request May 7, 2021
Only use find_program to search for protoc if cross compiling.
This is to make sure a system installed protoc is never used in
a normal situation while still allowing a build profile (or system)
protoc to be used when cross compiling.
@prince-chrismc prince-chrismc mentioned this pull request May 25, 2021
4 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants