mirror of
https://github.com/YACReader/yacreader
synced 2025-07-18 04:54:29 -04:00
Add support for building for different architectures on macos
This commit is contained in:
@ -9,29 +9,39 @@ SKIP_CODESIGN=${3:-false}
|
||||
|
||||
QT_VERSION=${4:-""}
|
||||
|
||||
ARCH=${5:-"arm64"}
|
||||
|
||||
echo "building macos binaries with these params: ${VERSION} ${BUILD_NUMBER} ${SKIP_CODESIGN} ${QT_VERSION}"
|
||||
|
||||
if [ "$5" == "clean" ]; then
|
||||
if [ "$6" == "clean" ]; then
|
||||
./cleanOSX.sh
|
||||
fi
|
||||
|
||||
if [ "$ARCH" == "arm64"]; then
|
||||
ARCH_NAME="Apple"
|
||||
fi
|
||||
|
||||
if [ "$ARCH" == "x86_64"]; then
|
||||
ARCH_NAME="Intel"
|
||||
fi
|
||||
|
||||
hash qmake 2>/dev/null || { echo >&2 "Qmake command not available. Please add the bin subfolder of your Qt installation to the PATH environment variable."; exit 1; }
|
||||
|
||||
echo "Compiling YACReader"
|
||||
cd YACReader
|
||||
qmake DEFINES+="BUILD_NUMBER=\\\\\\\"${BUILD_NUMBER}\\\\\\\""
|
||||
qmake DEFINES+="BUILD_NUMBER=\\\\\\\"${BUILD_NUMBER}\\\\\\\"" QMAKE_APPLE_DEVICE_ARCHS="${ARCH}"
|
||||
make
|
||||
cd ..
|
||||
|
||||
echo "Compiling YACReaderLibrary"
|
||||
cd YACReaderLibrary
|
||||
qmake DEFINES+="BUILD_NUMBER=\\\\\\\"${BUILD_NUMBER}\\\\\\\""
|
||||
qmake DEFINES+="BUILD_NUMBER=\\\\\\\"${BUILD_NUMBER}\\\\\\\"" QMAKE_APPLE_DEVICE_ARCHS="${ARCH}"
|
||||
make
|
||||
cd ..
|
||||
|
||||
echo "Compiling YACReaderLibraryServer"
|
||||
cd YACReaderLibraryServer
|
||||
qmake DEFINES+="BUILD_NUMBER=\\\\\\\"${BUILD_NUMBER}\\\\\\\""
|
||||
qmake DEFINES+="BUILD_NUMBER=\\\\\\\"${BUILD_NUMBER}\\\\\\\"" QMAKE_APPLE_DEVICE_ARCHS="${ARCH}"
|
||||
make
|
||||
cd ..
|
||||
|
||||
@ -53,9 +63,9 @@ mkdir -p YACReader.app/Contents/MacOS/utils
|
||||
mkdir -p YACReaderLibrary.app/Contents/MacOS/utils
|
||||
mkdir -p YACReaderLibraryServer.app/Contents/MacOS/utils
|
||||
|
||||
cp -R dependencies/7zip/macx/* YACReader.app/Contents/MacOS/utils/
|
||||
cp -R dependencies/7zip/macx/* YACReaderLibrary.app/Contents/MacOS/utils/
|
||||
cp -R dependencies/7zip/macx/* YACReaderLibraryServer.app/Contents/MacOS/utils/
|
||||
cp -R dependencies/7zip/macx/${ARCH}/* YACReader.app/Contents/MacOS/utils/
|
||||
cp -R dependencies/7zip/macx/${ARCH}/* YACReaderLibrary.app/Contents/MacOS/utils/
|
||||
cp -R dependencies/7zip/macx/${ARCH}/* YACReaderLibraryServer.app/Contents/MacOS/utils/
|
||||
|
||||
cp -R release/server YACReaderLibrary.app/Contents/MacOS/
|
||||
cp -R release/server YACReaderLibraryServer.app/Contents/MacOS/
|
||||
@ -74,7 +84,7 @@ fi
|
||||
|
||||
echo "Preparing apps for release, Done."
|
||||
|
||||
dest="YACReader-$VERSION.$BUILD_NUMBER MacOSX-Intel ${QT_VERSION}"
|
||||
dest="YACReader-$VERSION.$BUILD_NUMBER MacOSX-${ARCH_NAME} ${QT_VERSION}"
|
||||
echo "Copying to destination folder ${dest}"
|
||||
mkdir -p "$dest"
|
||||
cp -R YACReader.app "${dest}/YACReader.app"
|
||||
|
Reference in New Issue
Block a user