File tree Expand file tree Collapse file tree 1 file changed +7
-6
lines changed Expand file tree Collapse file tree 1 file changed +7
-6
lines changed Original file line number Diff line number Diff line change @@ -683,15 +683,16 @@ function(add_mlir_python_extension libname extname)
683683 ${eh_rtti_enable}
684684 )
685685 endif ()
686+
687+ if (APPLE )
688+ # NanobindAdaptors.h uses PyClassMethod_New to build `pure_subclass`es but nanobind
689+ # doesn't declare this API as undefined in its linker flags. So we need to declare it as such
690+ # for downstream users that do not do something like -undefined dynamic_lookup
691+ set (CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} -Wl,-U -Wl,_PyClassMethod_New" )
692+ endif ()
686693 endif ()
687694
688695 target_compile_options (${libname} PRIVATE ${eh_rtti_enable} )
689- if (APPLE )
690- # NanobindAdaptors.h uses PyClassMethod_New to build `pure_subclass`es but nanobind
691- # doesn't declare this API as undefined in its linker flags. So we need to declare it as such
692- # for downstream users that do not do something like -undefined dynamic_lookup
693- set (CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} -Wl,-U -Wl,_PyClassMethod_New" )
694- endif ()
695696
696697 # Configure the output to match python expectations.
697698 set_target_properties (
You can’t perform that action at this time.
0 commit comments