Skip to content
Merged
Changes from 1 commit
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
6 changes: 6 additions & 0 deletions mlir/cmake/modules/AddMLIRPython.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -686,6 +686,12 @@ function(add_mlir_python_extension libname extname)
endif()

target_compile_options(${libname} PRIVATE ${eh_rtti_enable})
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
# for downstream users that do not do something like -undefined dynamic_lookup
set(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} -Wl,-U -Wl,_PyClassMethod_New")
endif()

# Configure the output to match python expectations.
set_target_properties(
Expand Down
Loading