Skip to content

Commit 1214047

Browse files
committed
Add framework linking for iOS builds.
1 parent 2ba3c2d commit 1214047

1 file changed

Lines changed: 8 additions & 2 deletions

File tree

mesonbuild/dependencies/python.py

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

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

0 commit comments

Comments
 (0)