From c2e0ae3bdf0cff14638b29053c6c722c0449da52 Mon Sep 17 00:00:00 2001 From: Andrej730 Date: Wed, 16 Sep 2026 12:21:45 +0500 Subject: [PATCH] cmake: add minimum required boost version Added 1.74 just to start somewhere (it's the on tested in CI currently) --- cmake/CMakeLists.txt | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/cmake/CMakeLists.txt b/cmake/CMakeLists.txt index 71051a3c24..5a5ce2f991 100644 --- a/cmake/CMakeLists.txt +++ b/cmake/CMakeLists.txt @@ -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)