[Mlir-commits] [llvm] [mlir] [mlir python] Add nanobind support for standalone dialects. (PR #117922)
Maksim Levental
llvmlistbot at llvm.org
Mon Dec 2 15:16:00 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
----------------
makslevental wrote:
I was imagining this would be an arg (that naturally defaulted to `mlir`) so that downstream users could set this to whatever they wanted (if they wanted).
https://github.com/llvm/llvm-project/pull/117922
More information about the Mlir-commits
mailing list