bundle .framework dependencies while keeping symlinks intact

This commit is contained in:
2024-09-08 15:54:56 -05:00
committed by Celtic Minstrel
parent d5753e18d1
commit 3e5c4b3701

View File

@@ -185,7 +185,13 @@ if platform == "darwin":
dest_path = path.join(target[0].path, basefile)
if path.exists(dest_path):
break
Execute(Copy(dest_path, src_path))
# Copying .frameworks needs to preserve symlinks by using cp -a.
# SCons provides Copy(symlinks=True) but that doesn't seem to work.
try:
print(subprocess.check_output(['cp', '-av', src_path, dest_path], text=True))
except:
print('cp -av failed')
Exit(1)
# Recursively bundle the dependencies of each dependency:
bundle_libraries_for(target, [File(check_path)], env)
break