diff mbox series

[23/23] meson: clean up the native template in nativesdk builds

Message ID 20250510084400.269726-23-ross.burton@arm.com
State New
Headers show
Series [01/23] buildtools-tarball: fix default_cases assignment | expand

Commit Message

Ross Burton May 10, 2025, 8:43 a.m. UTC
In a nativesdk build, the native build template should be minimal as it
just needs to ensure that Meson can link with libraries in the SDK's
native sysroot.

Specifically, it shouldn't be passing BUILD_* flags to Meson as these
are for the Yocto build host, not the SDK user.

Signed-off-by: Ross Burton <ross.burton@arm.com>
---
 meta/recipes-devtools/meson/meson_1.8.0.bb | 17 ++++++++++++++++-
 1 file changed, 16 insertions(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/meta/recipes-devtools/meson/meson_1.8.0.bb b/meta/recipes-devtools/meson/meson_1.8.0.bb
index 5d4fc39751b..78e0a0ed805 100644
--- a/meta/recipes-devtools/meson/meson_1.8.0.bb
+++ b/meta/recipes-devtools/meson/meson_1.8.0.bb
@@ -86,6 +86,21 @@  cpp_link_args = ${@generate_native_link_template(d)}
 EOF
 }
 
+install_nativesdk_template() {
+    install -d ${D}${datadir}/meson
+
+    cat >${D}${datadir}/meson/meson.native.template <<EOF
+[binaries]
+pkg-config = 'pkg-config-native'
+
+[built-in options]
+c_args = ['-isystem@{OECORE_NATIVE_SYSROOT}${includedir_native}']
+c_link_args = ['-L@{OECORE_NATIVE_SYSROOT}${libdir_native}', '-L@{OECORE_NATIVE_SYSROOT}${base_libdir_native}',]
+cpp_args = ['-isystem@{OECORE_NATIVE_SYSROOT}${includedir_native}']
+cpp_link_args = ['-L@{OECORE_NATIVE_SYSROOT}${libdir_native}', '-L@{OECORE_NATIVE_SYSROOT}${base_libdir_native}',]
+EOF
+}
+
 install_cross_template() {
     install -d ${D}${datadir}/meson
 
@@ -117,7 +132,7 @@  EOF
 }
 
 do_install:append:class-nativesdk() {
-    install_native_template
+    install_nativesdk_template
     install_cross_template
 
     install -d ${D}${SDKPATHNATIVE}/post-relocate-setup.d