]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core-contrib.git/commitdiff
meson.bbclass: enable qemu exe wrapper in nativesdk
authorAlexander Kanavin <alex@linutronix.de>
Wed, 4 Dec 2024 06:48:47 +0000 (07:48 +0100)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Thu, 5 Dec 2024 11:55:08 +0000 (11:55 +0000)
nativesdk builds are cross-builds like target ones, and
so meson expectations regarding ability to run binaries are the same:
either provide the wrapper, or disable the build time options that
need executing target binaries during build time (if such options
are made available by upstream).

Signed-off-by: Alexander Kanavin <alex@linutronix.de>
Signed-off-by: Mathieu Dubois-Briand <mathieu.dubois-briand@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/classes-recipe/meson.bbclass

index 03fa2c06eb4aa5046b2f50ffe593c816452e04b7..b343480f9a79dc504dc8d1999e77f8993b00e64e 100644 (file)
@@ -9,7 +9,6 @@ inherit python3native meson-routines qemu
 DEPENDS:append = " meson-native ninja-native"
 
 EXEWRAPPER_ENABLED:class-native = "False"
-EXEWRAPPER_ENABLED:class-nativesdk = "False"
 EXEWRAPPER_ENABLED ?= "${@bb.utils.contains('MACHINE_FEATURES', 'qemu-usermode', 'True', 'False', d)}"
 DEPENDS:append = "${@' qemu-native' if d.getVar('EXEWRAPPER_ENABLED') == 'True' else ''}"
 
@@ -127,7 +126,7 @@ cpp_link_args = ${@meson_array('BUILD_LDFLAGS', d)}
 EOF
 }
 
-do_write_config:append:class-target() {
+write_qemuwrapper() {
     # Write out a qemu wrapper that will be used as exe_wrapper so that meson
     # can run target helper binaries through that.
     qemu_binary="${@qemu_wrapper_cmdline(d, '$STAGING_DIR_HOST', ['$STAGING_DIR_HOST/${libdir}','$STAGING_DIR_HOST/${base_libdir}'])}"
@@ -145,6 +144,14 @@ EOF
     chmod +x ${WORKDIR}/meson-qemuwrapper
 }
 
+do_write_config:append:class-target() {
+    write_qemuwrapper
+}
+
+do_write_config:append:class-nativesdk() {
+    write_qemuwrapper
+}
+
 # Tell externalsrc that changes to this file require a reconfigure
 CONFIGURE_FILES = "meson.build"