diff --git a/meta/recipes-devtools/python/python3-numpy_1.26.4.bb b/meta/recipes-devtools/python/python3-numpy_1.26.4.bb
index 914245507c7..4ffbe0d3708 100644
--- a/meta/recipes-devtools/python/python3-numpy_1.26.4.bb
+++ b/meta/recipes-devtools/python/python3-numpy_1.26.4.bb
@@ -23,6 +23,9 @@ DEPENDS += "python3-cython-native"
 inherit ptest setuptools3 github-releases
 
 S = "${WORKDIR}/numpy-${PV}"
+# numpy built with setuptools fails to build correctly when out-of-tree, so
+# until we switch to mesonpy we need this.
+B = "${S}/build"
 
 CLEANBROKEN = "1"
 
