Openembedded Core Discussions
 help / color / mirror / Atom feed
* [PATCH v2] meson: make wrapper options sub-command specific
@ 2022-09-28  2:52 Liam Beguin
  2022-09-28  9:08 ` [OE-core] " Peter Kjellerstedt
  0 siblings, 1 reply; 2+ messages in thread
From: Liam Beguin @ 2022-09-28  2:52 UTC (permalink / raw)
  To: liambeguin, openembedded-core; +Cc: alexandre.belloni

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                 | 19 ++++++++++++++++---
 1 file changed, 16 insertions(+), 3 deletions(-)

diff --git a/meta/recipes-devtools/meson/meson/meson-wrapper b/meta/recipes-devtools/meson/meson/meson-wrapper
index c62007f5077e..866dc33cf4be 100755
--- a/meta/recipes-devtools/meson/meson/meson-wrapper
+++ b/meta/recipes-devtools/meson/meson/meson-wrapper
@@ -13,7 +13,20 @@ 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
+
+if [ "x${SUBCMD}" == "xsetup" ] || [ -d ${SUBCMD} ]; then
+    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" \
+        "
+fi
+
 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" \
-     "$@"
+    "$@" \
+    ${MESON_SUB_OPTS}

base-commit: a2659cc2bf5d3f1cedf5c52c3b45e0427d40732d
-- 
2.37.1.223.g6a475b71f8c4



^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-09-28  9:09 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-09-28  2:52 [PATCH v2] meson: make wrapper options sub-command specific Liam Beguin
2022-09-28  9:08 ` [OE-core] " Peter Kjellerstedt

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox