abseil-cpp: Split so-files into separate packages

Use PACKAGES_DYNAMIC and PACKAGESPLITFUNCS to put each shared object
into its own package named libabsl-*.
The shared objects depend on each other which means you still get a
lot of them if you link against a single one.

The main package abseil-cpp RDEPENDS on all of the libabsl-* packages.

Signed-off-by: Ola x Nilsson <olani@axis.com>
Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
This commit is contained in:
Ola x Nilsson
2024-03-06 17:27:37 +01:00
committed by Khem Raj
parent 5c554c9b8c
commit 32eefcf1ca

View File

@@ -28,4 +28,27 @@ EXTRA_OECMAKE = "-DBUILD_SHARED_LIBS=ON \
SYSROOT_DIRS:append:class-nativesdk:mingw32 = " ${bindir}"
PACKAGES_DYNAMIC = "^libabsl-*"
PACKAGES_DYNAMIC:class-native = ""
PACKAGESPLITFUNCS =+ "split_dynamic_packages"
python split_dynamic_packages() {
libdir = d.getVar('libdir')
libpackages = do_split_packages(
d,
root=libdir,
file_regex=r'^libabsl_(.*)\.so\..*$',
output_pattern='libabsl-%s',
description="abseil shared library %s",
prepend=True,
extra_depends='',
)
if libpackages:
d.appendVar('RDEPENDS:' + d.getVar('PN'), ' ' + ' '.join(libpackages))
}
ALLOW_EMPTY:${PN} = "1"
BBCLASSEXTEND = "native nativesdk"