Skip to content

Commit e3172f4

Browse files
Add missing flags on Apple.
1 parent 7843b9c commit e3172f4

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

source/non_limited_api/CMakeLists.txt

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,10 @@ if (${PYBIND11_NONLIMITEDAPI_BUILD_STUBS})
2222
LIBRARY DESTINATION lib
2323
RUNTIME DESTINATION bin
2424
)
25+
26+
if (APPLE)
27+
target_link_options(pybind11nonlimitedapi_stubs PRIVATE -undefined dynamic_lookup)
28+
endif()
2529
endif()
2630

2731
set(PYBIND11_NONLIMITEDAPI_PYTHON_MIN_VERSION_HEX "" CACHE STRING "A hex Python version to bake into the library, e.g. `0x030800f0` for 3.8 (the `f0` suffix is always there and means a release version).")
@@ -38,6 +42,10 @@ else()
3842
target_link_libraries(${PYBIND11_NONLIMITEDAPI_LIBNAME} PUBLIC pybind11nonlimitedapi_stubs)
3943
target_link_libraries(${PYBIND11_NONLIMITEDAPI_LIBNAME} PUBLIC Python::Python)
4044

45+
if (APPLE)
46+
target_link_options(${PYBIND11_NONLIMITEDAPI_LIBNAME} PRIVATE -undefined dynamic_lookup)
47+
endif()
48+
4149
if (NOT(${PYBIND11_NONLIMITEDAPI_LIBRARY_OUTPUT_DIR} STREQUAL ""))
4250
set_target_properties(${PYBIND11_NONLIMITEDAPI_LIBNAME} PROPERTIES LIBRARY_OUTPUT_DIRECTORY ${PYBIND11_NONLIMITEDAPI_LIBRARY_OUTPUT_DIR})
4351
endif()

0 commit comments

Comments
 (0)