[Mlir-commits] [llvm] [mlir] [mlir python] Add nanobind support for standalone dialects. (PR #117922)

Peter Hawkins llvmlistbot at llvm.org
Mon Dec 2 19:11:19 PST 2024


================
@@ -644,9 +652,16 @@ function(add_mlir_python_extension libname extname)
   # The actual extension library produces a shared-object or DLL and has
   # sources that must be compiled in accordance with pybind11 needs (RTTI and
   # exceptions).
-  pybind11_add_module(${libname}
-    ${ARG_SOURCES}
-  )
+  if(NOT DEFINED ARG_PYTHON_BINDINGS_LIBRARY OR ARG_PYTHON_BINDINGS_LIBRARY STREQUAL "pybind11")
+    pybind11_add_module(${libname}
+      ${ARG_SOURCES}
+    )
+  elseif(ARG_PYTHON_BINDINGS_LIBRARY STREQUAL "nanobind")
+    nanobind_add_module(${libname}
+      NB_DOMAIN mlir
----------------
hawkinsp wrote:

Let's do that in a follow-on change?

https://github.com/llvm/llvm-project/pull/117922


More information about the Mlir-commits mailing list