public inbox for openembedded-core@lists.openembedded.org
 help / color / mirror / Atom feed
From: Liam Beguin <liambeguin@gmail.com>
To: liambeguin@gmail.com, openembedded-core@lists.openembedded.org
Subject: [PATCH v1] meson: make wrapper options sub-command specific
Date: Sat, 17 Sep 2022 18:07:35 -0400	[thread overview]
Message-ID: <20220917220735.4192854-1-liambeguin@gmail.com> (raw)

The meson-wrapper adds setup options to facilitate cross-compilation.
The current options are exclusive to the setup sub-command and might
cause issues with other sub-commands.

Update the wrapper to make options sub-command specific.

Signed-off-by: Liam Beguin <liambeguin@gmail.com>
---
 .../meson/meson/meson-wrapper                 | 22 ++++++++++++++++---
 1 file changed, 19 insertions(+), 3 deletions(-)

diff --git a/meta/recipes-devtools/meson/meson/meson-wrapper b/meta/recipes-devtools/meson/meson/meson-wrapper
index c62007f5077e..fae9e167a325 100755
--- a/meta/recipes-devtools/meson/meson/meson-wrapper
+++ b/meta/recipes-devtools/meson/meson/meson-wrapper
@@ -13,7 +13,23 @@ fi
 # config is already in meson.cross.
 unset CC CXX CPP LD AR NM STRIP
 
+for arg in "${@}"; do
+    case ${arg} in
+    -*) continue ;;
+    *) SUBCMD=${arg}; break ;;
+    esac
+done
+
+case ${SUBCMD} in
+setup)
+    MESON_SUB_OPTS=" \
+        --cross-file="${OECORE_NATIVE_SYSROOT}/usr/share/meson/${TARGET_PREFIX}meson.cross" \
+        --native-file="${OECORE_NATIVE_SYSROOT}/usr/share/meson/meson.native" \
+        "
+    ;;
+esac
+
 exec "$OECORE_NATIVE_SYSROOT/usr/bin/meson.real" \
-     --cross-file "${OECORE_NATIVE_SYSROOT}/usr/share/meson/${TARGET_PREFIX}meson.cross" \
-     --native-file "${OECORE_NATIVE_SYSROOT}/usr/share/meson/meson.native" \
-     "$@"
+    ${SUBCMD} \
+    ${MESON_SUB_OPTS} \
+    $(echo $@ | sed s/${SUBCMD}//)

base-commit: 09c1cac053c2892e3af3250cc6229e8da78e7a50
-- 
2.37.1.223.g6a475b71f8c4



             reply	other threads:[~2022-09-17 22:07 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-17 22:07 Liam Beguin [this message]
2022-09-20 21:14 ` [OE-core] [PATCH v1] meson: make wrapper options sub-command specific Alexandre Belloni
2022-09-28  2:46   ` Liam Beguin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220917220735.4192854-1-liambeguin@gmail.com \
    --to=liambeguin@gmail.com \
    --cc=openembedded-core@lists.openembedded.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox