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

[build] Fix CMake protobuf dependency handling #6772

Merged
merged 4 commits into from
Jun 28, 2024

Conversation

Gold856
Copy link
Contributor

@Gold856 Gold856 commented Jun 23, 2024

Reverts #6609 since that fix didn't Just Work(tm) on Windows. (edit: or Ubuntu. Seems to have broken everything except macOS.) This PR configures CMake to try and find protobuf-config.cmake first, which allows protobuf to pull in abseil for us. If protobuf-config.cmake is not available (coprocessors which don't have a new enough protobuf installed are a common case), it will fallback to CMake's built-in FindProtobuf module, which is what we were using before.

This PR also adds wpi::CreateMessage, a wrapper with an ifdef to switch between Arena::CreateMessage and Arena::Create, since the former is deprecated in newer versions of protobuf. This allows forward compatibility with newer versions of protobuf.

@Gold856 Gold856 requested review from PeterJohnson and a team as code owners June 23, 2024 22:43
@Gold856
Copy link
Contributor Author

Gold856 commented Jun 23, 2024

/format

@calcmogul
Copy link
Member

This works for me on Linux.

@PeterJohnson PeterJohnson merged commit 5ce72d4 into wpilibsuite:main Jun 28, 2024
30 checks passed
@Gold856 Gold856 deleted the cmake-protobuf-fix branch June 28, 2024 21:14
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.

3 participants