diff mbox series

[2/4] meson: Allow exe_wrapper to be overriden

Message ID 20240519055050.2331637-2-alejandro@enedino.org
State New
Headers show
Series [1/4] newlib: Use mcmodel=medany for RISCV64 | expand

Commit Message

Alejandro Enedino Hernandez Samaniego May 19, 2024, 5:50 a.m. UTC
When the meson build configuration file is generated the exe_wrapper value
was being hardcoded, however, there may be applications which require for us
to use a different value.

To allow for this value to be manually set; create a variable EXEWRAPPER_EXE
that defaults to ${WORKDIR}/meson-qemuwrapper, allowing us to easily change
its when required without modifying its default functionality.

Signed-off-by: Alejandro Enedino Hernandez Samaniego <alejandro@enedino.org>
---
 meta/classes-recipe/meson.bbclass | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
diff mbox series

Patch

diff --git a/meta/classes-recipe/meson.bbclass b/meta/classes-recipe/meson.bbclass
index 03fa2c06eb..864135d78b 100644
--- a/meta/classes-recipe/meson.bbclass
+++ b/meta/classes-recipe/meson.bbclass
@@ -8,6 +8,7 @@  inherit python3native meson-routines qemu
 
 DEPENDS:append = " meson-native ninja-native"
 
+EXEWRAPPER_EXE ?= "exe_wrapper = '${WORKDIR}/meson-qemuwrapper'"
 EXEWRAPPER_ENABLED:class-native = "False"
 EXEWRAPPER_ENABLED:class-nativesdk = "False"
 EXEWRAPPER_ENABLED ?= "${@bb.utils.contains('MACHINE_FEATURES', 'qemu-usermode', 'True', 'False', d)}"
@@ -61,7 +62,7 @@  def rust_tool(d, target_var):
     return "rust = %s" % repr(cmd)
 
 addtask write_config before do_configure
-do_write_config[vardeps] += "CC CXX AR NM STRIP READELF OBJCOPY CFLAGS CXXFLAGS LDFLAGS RUSTC RUSTFLAGS EXEWRAPPER_ENABLED"
+do_write_config[vardeps] += "CC CXX AR NM STRIP READELF OBJCOPY CFLAGS CXXFLAGS LDFLAGS RUSTC RUSTFLAGS EXEWRAPPER_ENABLED EXEWRAPPER_EXE"
 do_write_config() {
     # This needs to be Py to split the args into single-element lists
     cat >${WORKDIR}/meson.cross <<EOF
@@ -80,7 +81,7 @@  cups-config = 'cups-config'
 g-ir-scanner = '${STAGING_BINDIR}/g-ir-scanner-wrapper'
 g-ir-compiler = '${STAGING_BINDIR}/g-ir-compiler-wrapper'
 ${@rust_tool(d, "RUST_HOST_SYS")}
-${@"exe_wrapper = '${WORKDIR}/meson-qemuwrapper'" if d.getVar('EXEWRAPPER_ENABLED') == 'True' else ""}
+${@"${EXEWRAPPER_EXE}" if d.getVar('EXEWRAPPER_ENABLED') == 'True' else ""}
 
 [built-in options]
 c_args = ${@meson_array('CFLAGS', d)}