1
mirror of https://github.com/jedisct1/libsodium.git synced 2024-12-20 02:25:14 -07:00

Add support for arm64 watchOS (#1211)

This commit is contained in:
Elie Hage 2022-09-23 19:29:44 +04:00 committed by Frank Denis
parent d69a2342bc
commit 52e9b08c79

View File

@ -11,6 +11,7 @@ export IOS_SIMULATOR_I386_PREFIX="${PREFIX}/tmp/ios-simulator-i386"
export IOS_SIMULATOR_X86_64_PREFIX="${PREFIX}/tmp/ios-simulator-x86_64"
export WATCHOS32_PREFIX="${PREFIX}/tmp/watchos32"
export WATCHOS64_32_PREFIX="${PREFIX}/tmp/watchos64_32"
export WATCHOS64_PREFIX="${PREFIX}/tmp/watchos64"
export WATCHOS_SIMULATOR_ARM64_PREFIX="${PREFIX}/tmp/watchos-simulator-arm64"
export WATCHOS_SIMULATOR_I386_PREFIX="${PREFIX}/tmp/watchos-simulator-i386"
export WATCHOS_SIMULATOR_X86_64_PREFIX="${PREFIX}/tmp/watchos-simulator-x86_64"
@ -171,6 +172,15 @@ build_watchos() {
./configure --host=arm-apple-darwin10 --prefix="$WATCHOS64_32_PREFIX" \
${LIBSODIUM_ENABLE_MINIMAL_FLAG} || exit 1
make -j${PROCESSORS} install || exit 1
## 64-bit arm64 watchOS
export CFLAGS="-O2 -mthumb -arch arm64 -isysroot ${SDK} -mwatchos-version-min=${WATCHOS_VERSION_MIN}"
export LDFLAGS="-mthumb -arch arm64 -isysroot ${SDK} -mwatchos-version-min=${WATCHOS_VERSION_MIN}"
make distclean >/dev/null 2>&1
./configure --host=arm-apple-darwin10 --prefix="$WATCHOS64_PREFIX" \
${LIBSODIUM_ENABLE_MINIMAL_FLAG} || exit 1
make -j${PROCESSORS} install || exit 1
}
build_watchos_simulator() {
@ -355,6 +365,7 @@ for ext in a dylib; do
lipo -create \
"${WATCHOS32_PREFIX}/lib/libsodium.${ext}" \
"${WATCHOS64_32_PREFIX}/lib/libsodium.${ext}" \
"${WATCHOS64_PREFIX}/lib/libsodium.${ext}" \
-output "${PREFIX}/watchos/lib/libsodium.${ext}"
done