cmake: add minimum required boost version

Added 1.74 just to start somewhere (it's the on tested in CI currently)
This commit is contained in:
Andrej730
2026-09-16 12:21:45 +05:00
parent 3c1f44a42c
commit c2e0ae3bdf
+7 -1
View File
@@ -390,7 +390,13 @@ if(USE_MMAP)
endif()
endif()
find_package(Boost REQUIRED COMPONENTS ${BOOST_COMPONENTS})
# 1.74 is the version shipped with Ubuntu 22.04.
set(BOOST_MIN_VERSION 1.74)
if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU" AND CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 14)
# https://github.com/boostorg/math/issues/992
set(BOOST_MIN_VERSION 1.83)
endif()
find_package(Boost ${BOOST_MIN_VERSION} REQUIRED COMPONENTS ${BOOST_COMPONENTS})
# TODO: drop this whole `if` (and the `regex` component above) once BOOST_MIN_VERSION >= 1.76.
if(Boost_VERSION VERSION_GREATER_EQUAL 1.76)
list(REMOVE_ITEM Boost_LIBRARIES ${Boost_REGEX_LIBRARY} Boost::regex)