diff mbox series

[2/3] meson.bbclass: Add an option to specify install tags

Message ID 20250202200319.82231-2-uvv.mail@gmail.com
State New
Headers show
Series [1/3] bitbake.conf: Add conditional host tool getent | expand

Commit Message

Vyacheslav Yurkov Feb. 2, 2025, 8:03 p.m. UTC
From: Vyacheslav Yurkov <uvv.mail@gmail.com>

The feature is available since meson 0.60.0. You can specify
comma-separated list of install tags (not targets).

Signed-off-by: Vyacheslav Yurkov <uvv.mail@gmail.com>
---
 meta/classes-recipe/meson.bbclass | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/meta/classes-recipe/meson.bbclass b/meta/classes-recipe/meson.bbclass
index b343480f9a..cbfc45b94b 100644
--- a/meta/classes-recipe/meson.bbclass
+++ b/meta/classes-recipe/meson.bbclass
@@ -22,6 +22,9 @@  MESON_SOURCEPATH = "${S}"
 # The target to build in do_compile. If unset the default targets are built.
 MESON_TARGET ?= ""
 
+# Since 0.60.0 you can specify custom tags to install
+MESON_INSTALL_TAGS ?= ""
+
 def noprefix(var, d):
     return d.getVar(var).replace(d.getVar('prefix') + '/', '', 1)
 
@@ -182,7 +185,10 @@  meson_do_compile() {
 }
 
 meson_do_install() {
-    meson install --destdir ${D} --no-rebuild
+    if [ "x${MESON_INSTALL_TAGS}" != "x" ] ; then
+        meson_install_tags="--tags ${MESON_INSTALL_TAGS}"
+    fi
+    meson install --destdir ${D} --no-rebuild $meson_install_tags
 }
 
 EXPORT_FUNCTIONS do_configure do_compile do_install