Skip to content

Commit 99837df

Browse files
committed
Skip nanobind configure if MLIR_DISABLE_CONFIGURE_PYTHON_DEV_PACKAGES is set.
1 parent 6ab9daf commit 99837df

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

mlir/cmake/modules/AddMLIRPython.cmake

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -672,8 +672,11 @@ function(add_mlir_python_extension libname extname)
672672
${ARG_SOURCES}
673673
)
674674

675-
if (LLVM_COMPILER_IS_GCC_COMPATIBLE OR CLANG_CL)
676-
# Avoids warnings from upstream nanobind.
675+
if (NOT MLIR_DISABLE_CONFIGURE_PYTHON_DEV_PACKAGES
676+
AND (LLVM_COMPILER_IS_GCC_COMPATIBLE OR CLANG_CL))
677+
# Avoid some warnings from upstream nanobind.
678+
# If a superproject set MLIR_DISABLE_CONFIGURE_PYTHON_DEV_PACKAGES, let
679+
# the super project handle compile options as it wishes.
677680
set(nanobind_target "nanobind-static")
678681
if (NOT TARGET ${nanobind_target})
679682
# Get correct nanobind target name: nanobind-static-ft or something else
@@ -702,7 +705,7 @@ function(add_mlir_python_extension libname extname)
702705
${eh_rtti_enable}
703706
)
704707
endif()
705-
708+
706709
if(APPLE)
707710
# NanobindAdaptors.h uses PyClassMethod_New to build `pure_subclass`es but nanobind
708711
# doesn't declare this API as undefined in its linker flags. So we need to declare it as such

0 commit comments

Comments
 (0)