Skip to content

Commit

Permalink
build: relax the version constraint for Protobuf
Browse files Browse the repository at this point in the history
as higher versions of Protobuf does not claim to be compatible with
v2.5.0, so we should not specify a version number which is acceptable
by Seastar as a parameter of `find_package()`. and instead, we just
check the version number after calling `find_package()` in config mode.
if we find the package using config mode, we search it again, for
printing out the version number to the stdout, otherwise we search
using its C++ API version.

Refs #scylladb#2113

Signed-off-by: Kefu Chai <[email protected]>
  • Loading branch information
tchaikov authored and graphcareful committed Mar 20, 2024
1 parent 8f28b7c commit 50434ef
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions cmake/SeastarDependencies.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -159,14 +159,11 @@ macro (seastar_find_dependencies)
# ProtobufConfig.cmake provided by protobuf defines this linkage. so we try
# the CMake package configuration file first, and fall back to CMake's
# FindProtobuf module.
find_package (Protobuf 2.5.0
QUIET CONFIG)
if (Protobuf_FOUND)
find_package (Protobuf QUIET CONFIG)
if (Protobuf_FOUND AND Protobuf_VERSION VERSION_GREATER_EQUAL 2.5.0)
# do it again, so the message is printed when the package is found
find_package(Protobuf 2.5.0
CONFIG REQUIRED)
find_package(Protobuf CONFIG REQUIRED)
else ()
find_package(Protobuf 2.5.0
REQUIRED)
find_package(Protobuf 2.5.0 REQUIRED)
endif ()
endmacro ()

0 comments on commit 50434ef

Please sign in to comment.