Require boost between 1.69 and 1.89

Why? Because from boost 1.9 onwards, shlibs are simply not
available anymore.
This commit is contained in:
2026-05-30 10:40:52 -04:00
parent 322a8137b2
commit 2967a4d6ba
+22 -5
View File
@@ -1,4 +1,7 @@
cmake_minimum_required(VERSION 3.16) cmake_minimum_required(VERSION 3.19)
if(POLICY CMP0167)
cmake_policy(SET CMP0167 NEW)
endif()
project(salmanoff VERSION 0.01.001 LANGUAGES CXX) project(salmanoff VERSION 0.01.001 LANGUAGES CXX)
include(CMakeDependentOption) include(CMakeDependentOption)
@@ -111,13 +114,27 @@ include_directories(
# its own copy of boost::asio's metadata, which will cause a segfault if # its own copy of boost::asio's metadata, which will cause a segfault if
# boost::asio objects are used inside of a dlopen()'d library. # boost::asio objects are used inside of a dlopen()'d library.
# #
# Honestly, I never liked this whole "header-only" idea so I'm happy to be rid # Boost.System became header-only in Boost 1.69, and Boost 1.89 removed the
# of it. # compiled stub library that older package sets still exposed as
# libboost_system. This project intentionally links Boost.System as a shared
# library to keep one Boost symbol set across the main binary and dlopen()'d
# libraries, so Boost 1.89+ is not acceptable for this build.
# #
# Tell CMake we're linking against the shared library (not header-only) # Tell CMake we're linking against shared libraries, not static Boost libraries.
set(Boost_USE_STATIC_LIBS OFF) set(Boost_USE_STATIC_LIBS OFF)
set(Boost_USE_HEADER_ONLY OFF) set(Boost_USE_HEADER_ONLY OFF)
find_package(Boost REQUIRED COMPONENTS system log) find_package(Boost 1.69...<1.89 REQUIRED)
if(Boost_VERSION VERSION_GREATER_EQUAL "1.89.0")
message(FATAL_ERROR
"Boost ${Boost_VERSION} was found, but salmanoff requires Boost < 1.89 "
"because Boost 1.89 removed the dynamically linkable Boost.System "
"library. Install a Boost 1.69 through 1.88 development package set "
"that provides Boost::system as a shared library. On Ubuntu 26.04, "
"install libboost1.88-dev, libboost-system1.88-dev, and "
"libboost-log1.88-dev, then clear this build directory's CMake cache "
"or configure with -DBoost_DIR=/usr/lib/<multiarch>/cmake/Boost-1.88.0.")
endif()
find_package(Boost 1.69...<1.89 REQUIRED COMPONENTS system log)
# Define BOOST_ALL_DYN_LINK project-wide to ensure all Boost libraries use dynamic linking # Define BOOST_ALL_DYN_LINK project-wide to ensure all Boost libraries use dynamic linking
add_compile_definitions(BOOST_ALL_DYN_LINK) add_compile_definitions(BOOST_ALL_DYN_LINK)