From fd5af7efad7ff39a14d49702de4377117e741f51 Mon Sep 17 00:00:00 2001 From: Anutosh Bhat Date: Thu, 23 Jul 2026 01:52:03 +0530 Subject: [PATCH] [MLIR][Python] Avoid printing an unset nanobind include directory (#211240) `nanobind_INCLUDE_DIR` is only populated when MLIR discovers nanobind through the Python package. When `nanobind_DIR` is supplied explicitly, the variable remains unset and the configuration output contains an empty path: ``` Found nanobind v2.13.0: ``` The nanobind CMake package location is already reported by both discovery paths. We can only print the detected nanobind version in the final status message. Or maybe if we want we can find the include dir for the explicit path too and merge them to `nanobind_INCLUDE_DIR` but I think this is better. --- mlir/cmake/modules/MLIRDetectPythonEnv.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mlir/cmake/modules/MLIRDetectPythonEnv.cmake b/mlir/cmake/modules/MLIRDetectPythonEnv.cmake index b66adbcc17ad..5ff28d88110d 100644 --- a/mlir/cmake/modules/MLIRDetectPythonEnv.cmake +++ b/mlir/cmake/modules/MLIRDetectPythonEnv.cmake @@ -82,6 +82,6 @@ macro(mlir_configure_python_dev_packages) set(nanobind_INCLUDE_DIR "${PACKAGE_DIR}") endif() find_package(nanobind 2.9 CONFIG REQUIRED) - message(STATUS "Found nanobind v${nanobind_VERSION}: ${nanobind_INCLUDE_DIR}") + message(STATUS "Found nanobind v${nanobind_VERSION}") endif() endmacro()