diff mbox series

[meta-oe,5/8] hdf5: Add PACKAGECONFIG for the C++ library

Message ID 20261026035814.55254-5-khem.raj@oss.qualcomm.com
State New
Headers show
Series [meta-python,1/8] python3-ipy: upgrade 1.01 -> 1.2 | expand

Commit Message

Khem Raj Oct. 26, 2026, 3:58 a.m. UTC
Since 1.14.0 upstream no longer builds the C++ library (libhdf5_cpp,
libhdf5_hl_cpp) by default, so recipes that need it fail to find it.
Add a "cpp" PACKAGECONFIG to turn on HDF5_BUILD_CPP_LIB, keeping it
disabled by default.

The C++ build also installs the h5c++ compiler wrapper, which needs the
same RECIPE_SYSROOT_NATIVE cleanup and multilib script handling as h5cc.

Fixes: https://github.com/openembedded/meta-openembedded/issues/814

Signed-off-by: Khem Raj <khem.raj@oss.qualcomm.com>
---
 meta-oe/recipes-support/hdf5/hdf5_2.0.0.bb | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/meta-oe/recipes-support/hdf5/hdf5_2.0.0.bb b/meta-oe/recipes-support/hdf5/hdf5_2.0.0.bb
index a0eb5eb155..4e493f0aa7 100644
--- a/meta-oe/recipes-support/hdf5/hdf5_2.0.0.bb
+++ b/meta-oe/recipes-support/hdf5/hdf5_2.0.0.bb
@@ -35,6 +35,10 @@  EXTRA_OECMAKE = " \
     -DCMAKE_INSTALL_PREFIX='${prefix}' \
     -DHDF5_INSTALL_LIB_DIR='${baselib}' \
 "
+
+PACKAGECONFIG ??= ""
+PACKAGECONFIG[cpp] = "-DHDF5_BUILD_CPP_LIB=ON,-DHDF5_BUILD_CPP_LIB=OFF"
+
 EXTRA_OECMAKE:prepend:class-target = "-DCMAKE_CROSSCOMPILING_EMULATOR=${WORKDIR}/qemuwrapper "
 
 gen_emu() {
@@ -60,9 +64,14 @@  do_install:append() {
     # Used for generating config files on target
     oe_multilib_header H5pubconf.h
     sed -i -e 's|${RECIPE_SYSROOT_NATIVE}||g' ${D}${bindir}/h5cc
+    if ${@bb.utils.contains('PACKAGECONFIG', 'cpp', 'true', 'false', d)}; then
+        sed -i -e 's|${RECIPE_SYSROOT_NATIVE}||g' ${D}${bindir}/h5c++
+    fi
 }
 
-MULTILIB_SCRIPTS += "${PN}:${bindir}/h5cc"
+MULTILIB_SCRIPTS += "${PN}:${bindir}/h5cc \
+                     ${@bb.utils.contains('PACKAGECONFIG', 'cpp', '${PN}:${bindir}/h5c++', '', d)} \
+"
 
 BBCLASSEXTEND = "native"