diff --git a/meta/classes-recipe/meson.bbclass b/meta/classes-recipe/meson.bbclass
index 03fa2c06eb..492243c3c0 100644
--- a/meta/classes-recipe/meson.bbclass
+++ b/meta/classes-recipe/meson.bbclass
@@ -61,7 +61,7 @@ def rust_tool(d, target_var):
     return "rust = %s" % repr(cmd)
 
 addtask write_config before do_configure
-do_write_config[vardeps] += "CC CXX AR NM STRIP READELF OBJCOPY CFLAGS CXXFLAGS LDFLAGS RUSTC RUSTFLAGS EXEWRAPPER_ENABLED"
+do_write_config[vardeps] += "CC CXX AR NM STRIP READELF OBJCOPY CFLAGS CXXFLAGS LDFLAGS RUSTC RUSTFLAGS EXEWRAPPER_ENABLED MESON_SKIP_SANITY_CHECK"
 do_write_config() {
     # This needs to be Py to split the args into single-element lists
     cat >${WORKDIR}/meson.cross <<EOF
@@ -89,6 +89,7 @@ cpp_args = ${@meson_array('CXXFLAGS', d)}
 cpp_link_args = ${@meson_array('LDFLAGS', d)}
 
 [properties]
+${@"skip_sanity_check = true" if d.getVar('MESON_SKIP_SANITY_CHECK') == '1' else ""}
 needs_exe_wrapper = true
 sys_root = '${STAGING_DIR_HOST}'
 
