Skip to content

Commit 09dc8ab

Browse files
committed
Avoids domain conflict with nanobind by specifying NB_DOMAIN
1 parent 1ac52ec commit 09dc8ab

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

mlir/cmake/modules/AddMLIRPython.cmake

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -658,6 +658,13 @@ function(add_mlir_python_extension libname extname)
658658
set(eh_rtti_enable -frtti -fexceptions)
659659
endif ()
660660

661+
# Avoids domain conflict with nanobind by specifying NB_DOMAIN.
662+
if(NB_DOMAIN)
663+
set(_nb_domain ${NB_DOMAIN})
664+
else()
665+
set(_nb_domain "mlir")
666+
endif ()
667+
661668
# The actual extension library produces a shared-object or DLL and has
662669
# sources that must be compiled in accordance with pybind11 needs (RTTI and
663670
# exceptions).
@@ -667,7 +674,7 @@ function(add_mlir_python_extension libname extname)
667674
)
668675
elseif(ARG_PYTHON_BINDINGS_LIBRARY STREQUAL "nanobind")
669676
nanobind_add_module(${libname}
670-
NB_DOMAIN mlir
677+
NB_DOMAIN ${_nb_domain}
671678
FREE_THREADED
672679
${ARG_SOURCES}
673680
)

0 commit comments

Comments
 (0)