Skip to content

Commit 28f1641

Browse files
committed
macOS: Use .tbd files instead of reexported libraries
1 parent 9f662ba commit 28f1641

File tree

1 file changed

+3
-10
lines changed

1 file changed

+3
-10
lines changed

cibw-build-mpi.sh

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -744,19 +744,12 @@ if test "$(uname)" = Linux; then
744744
fi
745745

746746
if test "$(uname)" = Darwin; then
747+
tapi() { /Library/Developer/CommandLineTools/usr/bin/tapi "$@"; }
747748
for linklib in lib*mpi.dylib; do
748749
target=$(readlink "$linklib")
749750
unlink "$linklib"
750-
idname="@rpath/$target"
751-
ldname="@loader_path/$target"
752-
ldflags=("${build_ldflags[@]/-Wl,-dead_strip_dylibs}")
753-
ldflags+=("-Wl,-reexport_library,$target")
754-
cc -shared "${ldflags[@]}" -o "$linklib"
755-
install_name_tool -change "$idname" "$ldname" "$linklib"
756-
install_name_tool -id "$idname" "$linklib"
757-
if test "$(uname -m)" = arm64; then
758-
codesign --force --options linker-signed --sign - "$linklib"
759-
fi
751+
tapi stubify --filetype=tbd-v4 "$target"
752+
mv "${target/%.dylib/.tbd}" "${linklib/%.dylib/.tbd}"
760753
done
761754
fi
762755

0 commit comments

Comments
 (0)