[build] cmake: add absl dependency for newer protobuf (#6609)

Works around a bug on some systems where protobuf does not correctly depend on required absl libraries.
This commit is contained in:
Michael Fisher
2024-05-14 23:25:15 -04:00
committed by GitHub
parent 40b35f0d51
commit b0d3bf4ddf

View File

@@ -159,6 +159,11 @@ endif()
wpilib_target_warnings(wpiutil)
target_link_libraries(wpiutil protobuf::libprotobuf Threads::Threads ${CMAKE_DL_LIBS})
if(Protobuf_VERSION VERSION_GREATER_EQUAL 4)
find_package(absl REQUIRED)
target_link_libraries(wpiutil absl::spinlock_wait)
endif()
if(ATOMIC)
target_link_libraries(wpiutil ${ATOMIC})
endif()