Skip to content

Commit 5c55951

Browse files
committed
Add post-install script to SDK bundle
1 parent 7f8b23e commit 5c55951

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

swift-ci/sdks/android/scripts/build.sh

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -504,8 +504,8 @@ DESTINATION=$(dirname $(dirname $(realpath $0)))/ndk-sysroot
504504
rm -rf ${DESTINATION}
505505
506506
# copy vs. link the NDK files
507-
ANDROID_NDK_LINK=${ANDROID_NDK_LINK:-1}
508-
if [[ "${ANDROID_NDK_LINK}" != 1 ]]; then
507+
SWIFT_ANDROID_NDK_LINK=${SWIFT_ANDROID_NDK_LINK:-1}
508+
if [[ "${SWIFT_ANDROID_NDK_LINK}" != 1 ]]; then
509509
ANDROID_NDK_DESC="copied"
510510
cp -a ${PREBUILT}/*/sysroot ${DESTINATION}
511511
else
@@ -518,9 +518,13 @@ else
518518
done
519519
fi
520520
521-
# copy each architecture's swiftrt.o into the sysroot
522-
mkdir -p ${DESTINATION}/usr/lib/swift/android
523-
cp -a ${DESTINATION}/../swift-resources/usr/lib/swift-*/android/* ${DESTINATION}/usr/lib/swift/android/
521+
# copy each architecture's swiftrt.o into the sysroot,
522+
# working around https://github.com/swiftlang/swift/pull/79621
523+
for swiftrt in ${DESTINATION}/../swift-resources/usr/lib/swift-*/android/*/swiftrt.o; do
524+
arch=$(basename $(dirname ${swiftrt}))
525+
mkdir -p ${DESTINATION}/usr/lib/swift/android/${arch}
526+
cp -a ${swiftrt} ${DESTINATION}/usr/lib/swift/android/${arch}
527+
done
524528
525529
echo "$(basename $0): success: ndk-sysroot ${ANDROID_NDK_DESC} to Android SDK"
526530
EOF

0 commit comments

Comments
 (0)