Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions mlir/cmake/modules/AddMLIRPython.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -672,8 +672,11 @@ function(add_mlir_python_extension libname extname)
${ARG_SOURCES}
)

if (LLVM_COMPILER_IS_GCC_COMPATIBLE OR CLANG_CL)
# Avoids warnings from upstream nanobind.
if (NOT MLIR_DISABLE_CONFIGURE_PYTHON_DEV_PACKAGES
AND (LLVM_COMPILER_IS_GCC_COMPATIBLE OR CLANG_CL))
# Avoid some warnings from upstream nanobind.
# If a superproject set MLIR_DISABLE_CONFIGURE_PYTHON_DEV_PACKAGES, let
# the super project handle compile options as it wishes.
set(nanobind_target "nanobind-static")
if (NOT TARGET ${nanobind_target})
# Get correct nanobind target name: nanobind-static-ft or something else
Expand Down Expand Up @@ -702,7 +705,7 @@ function(add_mlir_python_extension libname extname)
${eh_rtti_enable}
)
endif()

if(APPLE)
# NanobindAdaptors.h uses PyClassMethod_New to build `pure_subclass`es but nanobind
# doesn't declare this API as undefined in its linker flags. So we need to declare it as such
Expand Down
Loading