diff mbox series

boost: install CMake config for header-only system library

Message ID 20260703095925.265641-1-sivakumar.bs@gmail.com
State New
Headers show
Series boost: install CMake config for header-only system library | expand

Commit Message

Siva Balasubramanian July 3, 2026, 9:59 a.m. UTC
In 1.91.0 (4981f3087a30) boost-system became a header-only "modular"
library with no separate shared object, and was therefore dropped from
BOOST_LIBS. As a side effect its CMake package config is no longer
installed: the top-level b2 install target only ships configs for the
libraries selected via --with-<library>, and 'system' can no longer be
named there (b2 errors out with "wrong library name 'system'").

Downstream software that does find_package(Boost COMPONENTS system) then
fails to configure and has to be patched.

Install the modular 'libs/system//install' target explicitly from
do_install so that lib/cmake/boost_system-<ver>/ is shipped again in the
-dev package. The target is header-only, so no library is built or
packaged; only the CMake config (and already-present headers) are added.

Verified with a from-scratch build: boost_system-config.cmake is packaged
into boost-dev and find_package(Boost REQUIRED COMPONENTS system)
succeeds against the installed tree again.

[YOCTO #16346]

Signed-off-by: Siva Balasubramanian <sivakumar.bs@gmail.com>
---
 meta/recipes-support/boost/boost.inc | 11 +++++++++++
 1 file changed, 11 insertions(+)
diff mbox series

Patch

diff --git a/meta/recipes-support/boost/boost.inc b/meta/recipes-support/boost/boost.inc
index 7a343e54f6..3cd71c4d6e 100644
--- a/meta/recipes-support/boost/boost.inc
+++ b/meta/recipes-support/boost/boost.inc
@@ -203,6 +203,17 @@  do_install() {
 		--libdir=${D}${libdir} \
 		--includedir=${D}${includedir} \
 		install
+
+	# In 1.91 boost-system became a header-only "modular" library and is no
+	# longer selectable through --with-system, so it is not part of BOOST_LIBS
+	# and the top-level install target no longer ships its CMake package
+	# config. Install that modular target explicitly so downstream
+	# find_package(Boost COMPONENTS system) keeps working.
+	b2 ${BJAM_OPTS} \
+		--libdir=${D}${libdir} \
+		--includedir=${D}${includedir} \
+		libs/system//install
+
 	for lib in ${BOOST_LIBS}; do
 		if [ -e ${D}${libdir}/libboost_${lib}.a ]; then
 			ln -s libboost_${lib}.a ${D}${libdir}/libboost_${lib}-mt.a