diff mbox series

[master] boost: make Boost.Locale ICU backend optional

Message ID 20260728051641.1997335-1-shinucha@cisco.com
State New
Headers show
Series [master] boost: make Boost.Locale ICU backend optional | expand

Commit Message

Shinu Chandran July 28, 2026, 5:16 a.m. UTC
Boost.Locale currently always depends on ICU when the locale library is
enabled. That makes ICU a mandatory dependency for users that need
boost-locale but do not need the ICU backend.

Add a separate icu PACKAGECONFIG option and keep it enabled by default
so existing builds retain the same feature set and runtime linkage.
When icu is removed, pass boost.locale.icu=off to Boost.Build so
boost-locale can still be built using the non-ICU backends without
pulling ICU into the dependency graph.

Tie the icu dependency to the locale option so configurations that
disable locale do not keep an unused ICU build dependency. This gives
distros and SDK builds a smaller dependency closure while preserving
the current default behavior.

Signed-off-by: Shinu Chandran <shinucha@cisco.com>
---
 meta/recipes-support/boost/boost.inc | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)
diff mbox series

Patch

diff --git a/meta/recipes-support/boost/boost.inc b/meta/recipes-support/boost/boost.inc
index 7a343e54f6..9ad23b279c 100644
--- a/meta/recipes-support/boost/boost.inc
+++ b/meta/recipes-support/boost/boost.inc
@@ -49,8 +49,10 @@  BOOST_LIBS = "\
 	"
 
 # optional libraries
-PACKAGECONFIG ??= "locale python"
-PACKAGECONFIG[locale] = ",,icu"
+PACKAGECONFIG ??= "locale python icu"
+BOOST_LOCALE_ICU_DEP = "${@bb.utils.contains('PACKAGECONFIG', 'locale', 'icu', '', d)}"
+PACKAGECONFIG[locale] = ",,"
+PACKAGECONFIG[icu] = ",,${BOOST_LOCALE_ICU_DEP}"
 PACKAGECONFIG[graph_parallel] = ",,,boost-mpi mpich"
 PACKAGECONFIG[mpi] = ",,mpich"
 PACKAGECONFIG[python] = ",,python3"
@@ -148,7 +150,7 @@  BOOST_PARALLEL_MAKE = "${@oe.utils.parallel_make_argument(d, '-j%d')}"
 BJAM_OPTS    = '${BOOST_PARALLEL_MAKE} -d+2 -q \
 		${BJAM_TOOLS} \
 		-sBOOST_BUILD_USER_CONFIG=${WORKDIR}/user-config.jam \
-		-sICU_PATH=${STAGING_EXECPREFIXDIR} \
+		${@bb.utils.contains('PACKAGECONFIG', 'locale icu', '-sICU_PATH=${STAGING_EXECPREFIXDIR}', 'boost.locale.icu=off', d)} \
 		--build-dir=${B} \
 		--disable-icu \
 		${BJAM_EXTRA}'