From 52e9b08c79b2d7e9d32b507b66ea290425e2f456 Mon Sep 17 00:00:00 2001 From: Elie Hage Date: Fri, 23 Sep 2022 19:29:44 +0400 Subject: [PATCH] Add support for arm64 watchOS (#1211) --- dist-build/apple-xcframework.sh | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/dist-build/apple-xcframework.sh b/dist-build/apple-xcframework.sh index 12516e13..969b7f75 100755 --- a/dist-build/apple-xcframework.sh +++ b/dist-build/apple-xcframework.sh @@ -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