diff mbox series

[meta-dpdk] dpdk: set platform to generic for cross-compilation

Message ID 20260407165135.3581258-1-mohd.anwar@oss.qualcomm.com
State New
Headers show
Series [meta-dpdk] dpdk: set platform to generic for cross-compilation | expand

Commit Message

Mohd Ayaan Anwar April 7, 2026, 4:51 p.m. UTC
Meson resolves the platform property from the build host during
cross-compilation. Generate a meson cross-file that sets platform
to 'generic' and pass it to meson for class-target builds.

Suggested-by: Anuj Mittal <anuj.mittal@oss.qualcomm.com>
Signed-off-by: Mohd Ayaan Anwar <mohd.anwar@oss.qualcomm.com>
---
 recipes-extended/dpdk/dpdk_25.11.0.bb | 10 ++++++++++
 1 file changed, 10 insertions(+)
diff mbox series

Patch

diff --git a/recipes-extended/dpdk/dpdk_25.11.0.bb b/recipes-extended/dpdk/dpdk_25.11.0.bb
index 58fc441..b56d77e 100644
--- a/recipes-extended/dpdk/dpdk_25.11.0.bb
+++ b/recipes-extended/dpdk/dpdk_25.11.0.bb
@@ -16,6 +16,7 @@  def get_cpu_instruction_set(bb, d):
         return "core2"
 
 EXTRA_OEMESON = " -Dexamples=all -Dcpu_instruction_set=${@get_cpu_instruction_set(bb, d)} "
+EXTRA_OEMESON:append:class-target = " --cross-file ${WORKDIR}/dpdk.cross"
 
 COMPATIBLE_MACHINE = "null"
 COMPATIBLE_HOST:libc-musl:class-target = "null"
@@ -33,6 +34,15 @@  inherit meson pkgconfig
 
 INSTALL_PATH = "${prefix}/share/dpdk"
 
+RTE_PLATFORM ?= "generic"
+
+do_write_config:append() {
+    cat >${WORKDIR}/dpdk.cross <<EOF
+[properties]
+platform = '${RTE_PLATFORM}'
+EOF
+}
+
 do_install:append(){
     # remove  source files
     rm -rf ${D}/${INSTALL_PATH}/examples/*