--- a/meson.build
+++ b/meson.build
@@ -376,24 +376,37 @@
     static: ('speexdsp' in static_libs_list or prefers_static_libs),
 )
 
-# The system has SpeexDSP, so test its floating-point handling
-if speexdsp_dep.found()
-    system_speexdsp_test = cxx.run(
-        files('contrib/check-speexdsp/test_speexdsp_float_api.cpp'),
-        dependencies: speexdsp_dep,
-        name: 'SpeexDSP system library has reliable floating-point API',
-    )
-    is_system_speexdsp_reliable = (
-        system_speexdsp_test.compiled()
-        and system_speexdsp_test.returncode() == 0
-    )
-    if is_system_speexdsp_reliable
-        speexdsp_summary_msg = 'system library'
+if meson.can_run_host_binaries()
+    # The system has SpeexDSP, so test its floating-point handling
+    if speexdsp_dep.found()
+        system_speexdsp_test = cxx.run(
+            files('contrib/check-speexdsp/test_speexdsp_float_api.cpp'),
+            dependencies: speexdsp_dep,
+            name: 'SpeexDSP system library has reliable floating-point API',
+        )
+        is_system_speexdsp_reliable = (
+            system_speexdsp_test.compiled()
+            and system_speexdsp_test.returncode() == 0
+        )
+        if is_system_speexdsp_reliable
+            speexdsp_summary_msg = 'system library'
+        endif
     endif
+else
+    speexdsp_summary_msg = 'system library'
 endif
 
-# The system doesn't have SpeexDSP or it's unreiable, so use the wrap
-if not speexdsp_dep.found() or not is_system_speexdsp_reliable
+use_speex_wrap = false
+# The system doesn't have SpeexDSP or it's unreliable, so use the wrap
+if not speexdsp_dep.found()
+    use_speex_wrap = true
+elif meson.can_run_host_binaries()
+    if not is_system_speexdsp_reliable
+        use_speex_wrap = true
+    endif
+endif
+
+if use_speex_wrap
     speexdsp_dep = subproject(
         'speexdsp',
         default_options: default_wrap_options,
