From 20a5af2583de60969124b4dc15e045ee47516da4 Mon Sep 17 00:00:00 2001 From: Ross Burton Date: Thu, 25 Mar 2021 17:39:01 +0000 Subject: meson: use native-file instead of environment variables Meson now supports native-files, which are the same as cross files but describe the native build. By writing and using a native file which describes the tools to use, we can drop the environment variable overriding. Signed-off-by: Ross Burton Signed-off-by: Richard Purdie --- meta/classes/meson.bbclass | 54 +++++++++++++++++++++------------------------- 1 file changed, 24 insertions(+), 30 deletions(-) diff --git a/meta/classes/meson.bbclass b/meta/classes/meson.bbclass index a7644e70cb..bf9b02e06e 100644 --- a/meta/classes/meson.bbclass +++ b/meta/classes/meson.bbclass @@ -26,7 +26,8 @@ MESONOPTS = " --prefix ${prefix} \ --sysconfdir ${sysconfdir} \ --localstatedir ${localstatedir} \ --sharedstatedir ${sharedstatedir} \ - --wrap-mode nodownload" + --wrap-mode nodownload \ + --native-file ${WORKDIR}/meson.native" EXTRA_OEMESON_append = " ${PACKAGECONFIG_CONFARGS}" @@ -102,12 +103,14 @@ cups-config = 'cups-config' g-ir-scanner = '${STAGING_BINDIR}/g-ir-scanner-wrapper' g-ir-compiler = '${STAGING_BINDIR}/g-ir-compiler-wrapper' -[properties] -needs_exe_wrapper = true +[built-in options] c_args = ${@meson_array('CFLAGS', d)} c_link_args = ${@meson_array('LDFLAGS', d)} cpp_args = ${@meson_array('CXXFLAGS', d)} cpp_link_args = ${@meson_array('LDFLAGS', d)} + +[properties] +needs_exe_wrapper = true gtkdoc_exe_wrapper = '${B}/gtkdoc-qemuwrapper' [host_machine] @@ -121,9 +124,27 @@ system = '${@meson_operating_system('TARGET_OS', d)}' cpu_family = '${@meson_cpu_family('TARGET_ARCH', d)}' cpu = '${TARGET_ARCH}' endian = '${@meson_endian('TARGET', d)}' +EOF + + cat >${WORKDIR}/meson.native <