Skip to contentSkip to conversation

meson.bbclass: Add support for nativesdk

PATCH New Peter Kjellerstedt 1 participant 1 message Feb 20, 2018 Arm/Amlogic Meson SoC support

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 meson.bbclass: Add support for nativesdk

We need to use the meson.cross file when building for nativesdk. Additionally, we need to trick meson's sanity tests, just as it is done for target builds.

---

I have not tested this extensively, but it at least seems to build things correctly.

 meta/classes/meson.bbclass | 13 +++++++++++++
 1 file changed, 13 insertions(+)
meta/classes/meson.bbclass +13 -0
index cd3497a802..31d32a56f6 100644
@@ -39,6 +39,7 @@ EXTRA_OEMESON += "${PACKAGECONFIG_CONFARGS}"
 
 MESON_CROSS_FILE = ""
 MESON_CROSS_FILE_class-target = "--cross-file ${WORKDIR}/meson.cross"
+MESON_CROSS_FILE_class-nativesdk = "--cross-file ${WORKDIR}/meson.cross"
 
 CCOMPILER ?= "gcc"
 CXXCOMPILER ?= "g++"
@@ -105,6 +106,18 @@ meson_do_configure_prepend_class-target() {
     export AR="${BUILD_AR}"
 }
 
+meson_do_configure_prepend_class-nativesdk() {
+    # Set these so that meson uses the native tools for its build sanity tests,
+    # which require executables to be runnable. The cross file will still
+    # override these for the nativesdk build. Note that we do *not* set CFLAGS,
+    # LDFLAGS, etc. as they will be slurped in by meson and applied to the
+    # nativesdk build, causing errors.
+    export CC="${BUILD_CC}"
+    export CXX="${BUILD_CXX}"
+    export LD="${BUILD_LD}"
+    export AR="${BUILD_AR}"
+}
+
 meson_do_configure_prepend_class-native() {
     export PKG_CONFIG="pkg-config-native"
 }
Signature · 1 line
2.12.0