From: Ross Burton <[email protected]>

Add a variable to control what target gets built in do_compile.  By
default this value is unset so meson builds the default target, but by
setting MESON_TARGET a specific target can be built.

Signed-off-by: Ross Burton <[email protected]>
---
 meta/classes-recipe/meson.bbclass | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/meta/classes-recipe/meson.bbclass 
b/meta/classes-recipe/meson.bbclass
index 7f5e9b19433..582b41a91b1 100644
--- a/meta/classes-recipe/meson.bbclass
+++ b/meta/classes-recipe/meson.bbclass
@@ -20,6 +20,9 @@ do_configure[cleandirs] = "${B}"
 # Where the meson.build build configuration is
 MESON_SOURCEPATH = "${S}"
 
+# The target to build in do_compile. If unset the default targets are built.
+MESON_TARGET ?= ""
+
 def noprefix(var, d):
     return d.getVar(var).replace(d.getVar('prefix') + '/', '', 1)
 
@@ -170,7 +173,7 @@ do_configure[postfuncs] += "meson_do_qa_configure"
 
 do_compile[progress] = "outof:^\[(\d+)/(\d+)\]\s+"
 meson_do_compile() {
-    meson compile -v ${PARALLEL_MAKE}
+    meson compile -v ${PARALLEL_MAKE} ${MESON_TARGET}
 }
 
 meson_do_install() {
-- 
2.34.1

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#185705): 
https://lists.openembedded.org/g/openembedded-core/message/185705
Mute This Topic: https://lists.openembedded.org/mt/100644363/21656
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub 
[[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to