open-telemetry / opentelemetry-cpp

The OpenTelemetry C++ Client
https://opentelemetry.io/
Apache License 2.0
889 stars 425 forks source link

Allow cross-compilation with protobuf #3117

Open tobim opened 3 weeks ago

tobim commented 3 weeks ago

The upstream config module from protobuf always declares targets for the protobuf library and protoc of the same platform. This means one of the two is always wrong, as protoc needs to be run on the build machine, but the library must be linked for the "host" platform.

A small change in the CMake scaffold allows the user to pass -DPROTOBUF_PROTOC_EXECUTABLE=<path/to/protoc> to cmake when creating the build tree.

Fixes # (issue)

Changes

Please provide a brief description of the changes here.

For significant contributions please make sure you have completed the following items:

netlify[bot] commented 3 weeks ago

Deploy Preview for opentelemetry-cpp-api-docs canceled.

Name Link
Latest commit 5c7e514cdcb7d166210264f4f45d98c8e1fe5978
Latest deploy log https://app.netlify.com/sites/opentelemetry-cpp-api-docs/deploys/672330d0a950690008e53192
codecov[bot] commented 3 weeks ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 87.88%. Comparing base (497eaf4) to head (5c7e514). Report is 151 commits behind head on main.

Additional details and impacted files [![Impacted file tree graph](https://app.codecov.io/gh/open-telemetry/opentelemetry-cpp/pull/3117/graphs/tree.svg?width=650&height=150&src=pr&token=FJESTYQ2AD&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=open-telemetry)](https://app.codecov.io/gh/open-telemetry/opentelemetry-cpp/pull/3117?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=open-telemetry) ```diff @@ Coverage Diff @@ ## main #3117 +/- ## ========================================== + Coverage 87.12% 87.88% +0.76% ========================================== Files 200 195 -5 Lines 6109 6137 +28 ========================================== + Hits 5322 5393 +71 + Misses 787 744 -43 ``` [see 99 files with indirect coverage changes](https://app.codecov.io/gh/open-telemetry/opentelemetry-cpp/pull/3117/indirect-changes?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=open-telemetry)