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

CMake: Handle Dependency Checks With Newer Protobuf #6609

Merged
merged 5 commits into from
May 15, 2024

Conversation

mfisher31
Copy link
Contributor

This fix works fine with homebrew installed protobuf on macOS v14.4.1. It, checks for the Absl cmake package in addition to protobuf which is needed by glassnt + modern macOS.

see #6607

Draft until I can check behavior on windows and linux. The Absl check might need to be a homebrew/mac-only dependency.

@mfisher31 mfisher31 changed the title CMake: macOS: Link With absl_spinlock_wait in glassnt CMake: Handle Dependency Checks With Newer Protobuf May 13, 2024
@mfisher31 mfisher31 marked this pull request as ready for review May 13, 2024 18:03
@mfisher31 mfisher31 requested a review from PeterJohnson as a code owner May 13, 2024 18:03
@PeterJohnson PeterJohnson merged commit b0d3bf4 into wpilibsuite:main May 15, 2024
25 checks passed
@mfisher31 mfisher31 deleted the macos-absl-spinloc-wait branch May 23, 2024 10:22
chauser pushed a commit to chauser/allwpilib that referenced this pull request May 30, 2024
Works around a bug on some systems where protobuf does not correctly depend on required absl libraries.
Gold856 added a commit to Gold856/allwpilib that referenced this pull request Jun 22, 2024
Gold856 added a commit to Gold856/allwpilib that referenced this pull request Jun 22, 2024
PeterJohnson pushed a commit that referenced this pull request Jun 28, 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.

Add 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.
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.

2 participants