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

Fix linking with Protobuf 23 #4104

Merged
merged 1 commit into from
Aug 24, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion cmake/Protobuf.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,15 @@ macro(p4c_obtain_protobuf)
set(SAVED_CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_FIND_LIBRARY_SUFFIXES})
set(CMAKE_FIND_LIBRARY_SUFFIXES .a)
endif()
find_package(Protobuf 3.0.0 REQUIRED)
find_package(Protobuf CONFIG)
jkhsjdhjs marked this conversation as resolved.
Show resolved Hide resolved
if(NOT Protobuf_FOUND)
find_package(Protobuf REQUIRED)
endif()
if(ENABLE_PROTOBUF_STATIC)
set(CMAKE_FIND_LIBRARY_SUFFIXES ${SAVED_CMAKE_FIND_LIBRARY_SUFFIXES})
endif()
set(PROTOBUF_LIBRARY "protobuf::libprotobuf")
set(PROTOBUF_PROTOC_EXECUTABLE "protobuf::protoc")
else()
# Google introduced another breaking change with protobuf 22.x by adding abseil as a new
# dependency. https://protobuf.dev/news/2022-08-03/#abseil-dep We do not want abseil, so we stay
Expand Down
Loading