Skip to content

Commit f754c42

Browse files
authored
Merge pull request #21 from freakboy3742/numpy-ios-linking
Add framework linking for iOS builds.
2 parents 23ec306 + ab6278b commit f754c42

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

mesonbuild/dependencies/python.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -349,8 +349,14 @@ def __init__(self, name: str, environment: 'Environment',
349349
SystemDependency.__init__(self, name, environment, kwargs)
350350
_PythonDependencyBase.__init__(self, installation, kwargs.get('embed', False))
351351

352-
# match pkg-config behavior
353-
if self.link_libpython:
352+
# For most platforms, match pkg-config behavior. iOS is a special case;
353+
# check for that first, so that check takes priority over
354+
# `link_libpython` (which *shouldn't* be set, but just in case)
355+
if self.platform.startswith('ios-'):
356+
# iOS doesn't use link_libpython - it links with the *framework*.
357+
self.link_args = ['-framework', 'Python', '-F', self.variables.get('prefix')]
358+
self.is_found = True
359+
elif self.link_libpython:
354360
# link args
355361
if mesonlib.is_windows():
356362
self.find_libpy_windows(environment, limited_api=False)

0 commit comments

Comments
 (0)