Skip to content

Add framework linking for iOS builds. #21

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 5, 2025

Conversation

freakboy3742
Copy link

A backport of mesonbuild#14541 into the NumPy version of meson. That PR has been merged into master, for release in Meson 1.9.

When building for iOS, and Python is a dependency, linking against the Python framework is required. This is done automatically for all the standard library modules.

This behavior differs from macOS. On macOS, binary modules are linked with -undefined dynamic_lookup; that option is marked as deprecated for the iOS compiler, so it can't be used.

It also differs from Unix platforms that link against libPython - the link must be against the framework, not the library, as iOS doesn't allow "normal" dynamic library linking. As a result, existing link_libpython can't be used.

Copy link
Member

@rgommers rgommers left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @freakboy3742. I'll get this incorporated into NumPy's main branch now.

@rgommers rgommers merged commit f754c42 into numpy:main-numpymeson May 5, 2025
4 of 27 checks passed
@rgommers
Copy link
Member

rgommers commented May 5, 2025

Done in numpy/numpy#28904

@freakboy3742 freakboy3742 deleted the numpy-ios-linking branch May 5, 2025 22:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants