From b0d3bf4ddfbf47f239b8b09581afee5dbbe99820 Mon Sep 17 00:00:00 2001 From: Michael Fisher <880111+mfisher31@users.noreply.github.com> Date: Tue, 14 May 2024 23:25:15 -0400 Subject: [PATCH] [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. --- wpiutil/CMakeLists.txt | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/wpiutil/CMakeLists.txt b/wpiutil/CMakeLists.txt index b4482ff048a..32ce9fa537a 100644 --- a/wpiutil/CMakeLists.txt +++ b/wpiutil/CMakeLists.txt @@ -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()