Skip to content

Commit aa5ccbd

Browse files
authored
Merge pull request #25 from NordSecurity/lukasp/add_function_to_fix_dylib_paths
Fix paths for dylibs for Apple platforms
2 parents 92f5ad1 + dc577d6 commit aa5ccbd

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

rust_build_utils/darwin_build_utils.py

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -185,17 +185,17 @@ def create_xcframework(
185185
command = ["xcodebuild", "-create-xcframework"]
186186

187187
for target_os in target_os_list:
188-
command.extend(
189-
[
190-
"-library",
191-
str(
192-
get_universal_library_distribution_directory(
193-
project, target_os, debug
194-
)
195-
/ library_file_name
196-
),
197-
]
188+
lib_path = str(
189+
get_universal_library_distribution_directory(project, target_os, debug)
190+
/ library_file_name
198191
)
192+
193+
# fix @rpath to relative one since the absolute is embedded at this point
194+
subprocess.run(
195+
["install_name_tool", "-id", f"@rpath/{library_file_name}", lib_path],
196+
check=True,
197+
)
198+
command.extend(["-library", lib_path])
199199
command.extend(["-headers", str(temp_headers)])
200200

201201
command.extend(["-output", str(framework_path)])

0 commit comments

Comments
 (0)