mirror of
https://github.com/python/cpython.git
synced 2025-08-04 17:08:35 +00:00
gh-114099 - Add iOS framework loading machinery. (GH-116454)
Co-authored-by: Malcolm Smith <smith@chaquo.com> Co-authored-by: Eric Snow <ericsnowcurrently@gmail.com>
This commit is contained in:
parent
a557478987
commit
408e127159
22 changed files with 302 additions and 62 deletions
|
@ -348,6 +348,17 @@ class CDLL(object):
|
|||
winmode=None):
|
||||
if name:
|
||||
name = _os.fspath(name)
|
||||
|
||||
# If the filename that has been provided is an iOS/tvOS/watchOS
|
||||
# .fwork file, dereference the location to the true origin of the
|
||||
# binary.
|
||||
if name.endswith(".fwork"):
|
||||
with open(name) as f:
|
||||
name = _os.path.join(
|
||||
_os.path.dirname(_sys.executable),
|
||||
f.read().strip()
|
||||
)
|
||||
|
||||
self._name = name
|
||||
flags = self._func_flags_
|
||||
if use_errno:
|
||||
|
|
|
@ -67,7 +67,7 @@ if os.name == "nt":
|
|||
return fname
|
||||
return None
|
||||
|
||||
elif os.name == "posix" and sys.platform == "darwin":
|
||||
elif os.name == "posix" and sys.platform in {"darwin", "ios", "tvos", "watchos"}:
|
||||
from ctypes.macholib.dyld import dyld_find as _dyld_find
|
||||
def find_library(name):
|
||||
possible = ['lib%s.dylib' % name,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue