_meson_create_cross_file() sets needs_exe_wrapper to true, but there seems to be no way to set exe wrapper program itself (exe_wrapper variable in binaries section). IMHO there should be a way to set it via environment. Reproducible: Always Steps to Reproduce: Try to crossbuild dev-libs/gobject-introspection. Actual Results: Build fails with: Cannot use target g-ir-compiler as a generator because it is built for the host machine and no exe wrapper is defined or needs_exe_wrapper is true.
Just FYI, we have a work around for this in our chromiumos code: https://chromium.googlesource.com/chromiumos/overlays/eclass-overlay/+/refs/heads/main/eclass/meson.eclass#155
*** Bug 850895 has been marked as a duplicate of this bug. ***