summaryrefslogtreecommitdiffstats
path: root/TOOLS
diff options
context:
space:
mode:
authorder richter <der.richter@gmx.de>2019-09-20 15:14:59 +0200
committerJan Ekström <jeebjp@gmail.com>2019-09-22 17:07:51 +0300
commitf64c0115ae475c8584e0825340b7488be4095c2c (patch)
tree508083d4908374536afc171ed3d191a0c56597cb /TOOLS
parentd00f9b19c77fe8e44c3b7dcacb6a11fe13326c5c (diff)
downloadmpv-f64c0115ae475c8584e0825340b7488be4095c2c.tar.bz2
mpv-f64c0115ae475c8584e0825340b7488be4095c2c.tar.xz
build: fix swift linking with upcoming xcode 11
in xcode 11 the dynamic swift libraries were moved to a separated versioned swift folder, which can't be used for linking and only for distribution. additional to the std dynamic swift lib folder the system wide folder is needed for linking too.
Diffstat (limited to 'TOOLS')
-rwxr-xr-xTOOLS/dylib-unhell.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/TOOLS/dylib-unhell.py b/TOOLS/dylib-unhell.py
index 8f0b151f03..05c75789e7 100755
--- a/TOOLS/dylib-unhell.py
+++ b/TOOLS/dylib-unhell.py
@@ -89,8 +89,16 @@ def process_libraries(libs_dict, binary, processed = []):
def process_swift_libraries(binary):
command = ['xcrun', '--find', 'swift-stdlib-tool']
swiftStdlibTool = subprocess.check_output(command, universal_newlines=True).strip()
+ # from xcode11 on the dynamic swift libs reside in a separate directory from
+ # the std one, might need versioned paths for future swift versions
+ swiftLibPath = os.path.join(swiftStdlibTool, '../../lib/swift-5.0/macosx')
+ swiftLibPath = os.path.abspath(swiftLibPath)
command = [swiftStdlibTool, '--copy', '--platform', 'macosx', '--scan-executable', binary, '--destination', lib_path(binary)]
+
+ if os.path.exists(swiftLibPath):
+ command.extend(['--source-libraries', swiftLibPath])
+
subprocess.check_output(command, universal_newlines=True)
print(">> setting additional rpath for swift libraries")