From 4071e460f687d4fe2e72368dfd3ed5a30ca2ca1f Mon Sep 17 00:00:00 2001 From: cyan Date: Sun, 18 Aug 2024 14:25:44 +0200 Subject: [PATCH] fix universal build (#1621) --- scripts/macos/build_monero_all.sh | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/scripts/macos/build_monero_all.sh b/scripts/macos/build_monero_all.sh index c934b4667..edc8efe81 100755 --- a/scripts/macos/build_monero_all.sh +++ b/scripts/macos/build_monero_all.sh @@ -23,12 +23,14 @@ then done else if [[ "x$1" == "xuniversal" ]]; then - ARCHS=(arm64 x86_64) + ARCHS=(x86_64 arm64) else ARCHS=$(uname -m) fi for COIN in monero wownero; do + MONERO_LIBS="" + WOWNERO_LIBS="" for ARCH in "${ARCHS[@]}"; do if [[ "$ARCH" == "arm64" ]]; then @@ -39,17 +41,19 @@ else HOST="${ARCH}-host-apple-darwin" fi - MONERO_LIBS=" -arch ${ARCH} ${MONEROC_RELEASE_DIR}/${HOST}_libwallet2_api_c.dylib" - WOWNERO_LIBS=" -arch ${ARCH} ${WOWNEROC_RELEASE_DIR}/${HOST}_libwallet2_api_c.dylib" + MONERO_LIBS="$MONERO_LIBS -arch ${ARCH} ${MONEROC_RELEASE_DIR}/${HOST}_libwallet2_api_c.dylib" + WOWNERO_LIBS="$WOWNERO_LIBS -arch ${ARCH} ${WOWNEROC_RELEASE_DIR}/${HOST}_libwallet2_api_c.dylib" - if [[ ! $(uname -m) == $ARCH ]]; then - PRC="arch -${ARCH}" - fi + if [[ ! $(uname -m) == $ARCH ]]; then + PRC="arch -${ARCH}" + else + PRC="" + fi - pushd ../monero_c - $PRC ./build_single.sh ${COIN} ${HOST} $NPROC - unxz -f ./release/${COIN}/${HOST}_libwallet2_api_c.dylib.xz - popd + pushd ../monero_c + $PRC ./build_single.sh ${COIN} ${HOST} $NPROC + unxz -f ./release/${COIN}/${HOST}_libwallet2_api_c.dylib.xz + popd done done fi