mirror of
https://github.com/WinampDesktop/winamp.git
synced 2025-06-13 12:15:46 -04:00
CMake: Support multiple CMAKE_OSX_ARCHITECTURES
This commit is contained in:
@ -1,48 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
set -e
|
||||
|
||||
DEPS=$HOME/deps
|
||||
|
||||
if [ "$#" -ne 1 ]; then
|
||||
echo "Syntax: $0 <path to source directory>"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# no realpath...
|
||||
SOURCEDIR="$1"
|
||||
|
||||
echo "Build x64..."
|
||||
mkdir build-x64
|
||||
cd build-x64
|
||||
export MACOSX_DEPLOYMENT_TARGET=11.0
|
||||
cmake -DCMAKE_BUILD_TYPE=Release -DENABLE_OPENGL=OFF -DCMAKE_PREFIX_PATH="$DEPS" -DCMAKE_INTERPROCEDURAL_OPTIMIZATION=ON -G Ninja "../$SOURCEDIR"
|
||||
cmake --build . --parallel
|
||||
cd ..
|
||||
|
||||
echo "Build arm64..."
|
||||
mkdir build-arm64
|
||||
cd build-arm64
|
||||
export MACOSX_DEPLOYMENT_TARGET=11.00
|
||||
cmake -DCMAKE_OSX_ARCHITECTURES=arm64 -DCMAKE_BUILD_TYPE=Release -DENABLE_OPENGL=OFF -DCMAKE_PREFIX_PATH="$DEPS" -DCMAKE_INTERPROCEDURAL_OPTIMIZATION=ON -G Ninja "../$SOURCEDIR"
|
||||
cmake --build . --parallel
|
||||
cd ..
|
||||
|
||||
echo "Combine binary..."
|
||||
unset MACOSX_DEPLOYMENT_TARGET
|
||||
BINPATH=bin/DuckStation.app/Contents/MacOS/DuckStation
|
||||
UPDATERPATH=bin/DuckStation.app/Contents/Resources/Updater.app/Contents/MacOS/Updater
|
||||
lipo -create "build-x64/$BINPATH" "build-arm64/$BINPATH" -o "build-x64/$BINPATH"
|
||||
lipo -create "build-x64/$UPDATERPATH" "build-arm64/$UPDATERPATH" -o "build-x64/$UPDATERPATH"
|
||||
|
||||
# For some reason, the svg image format plugin doesn't get included in combined builds...
|
||||
if [ -f $HOME/deps/plugins/imageformats/libqsvg.dylib ]; then
|
||||
cp -v -n $HOME/deps/plugins/imageformats/libqsvg.dylib build-x64/bin/DuckStation.app/Contents/PlugIns/imageformats
|
||||
fi
|
||||
|
||||
echo "Grab app..."
|
||||
mv build-x64/bin/DuckStation.app .
|
||||
rm -fr build-x64 build-arm64
|
||||
|
||||
echo "Sign binary with self-signed cert..."
|
||||
codesign -s - --deep -f -v DuckStation.app
|
Reference in New Issue
Block a user