From 96b5cd92e26056d491beeb8593160197ed08f7c0 Mon Sep 17 00:00:00 2001 From: Johan Mabille Date: Mon, 29 Jan 2024 23:18:23 +0100 Subject: [PATCH] only search for numpy when the numpy-include directory is not passed --- CMakeLists.txt | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 319dfeb..6521c98 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -60,8 +60,12 @@ else() message(STATUS "Found pybind11: ${pybind11_INCLUDE_DIRS}/pybind11") endif() -# Look for NumPy headers -find_package(Python REQUIRED COMPONENTS NumPy) +# Look for NumPy headers, except if NUMPY_INCLUDE_DIRS is passed, +# which is required under some circumstances (such as wasm, where +# there is no real python executable) +if(NOT NUMPY_INCLUDE_DIRS) + find_package(Python REQUIRED COMPONENTS NumPy) +endif() # Build # =====