forked from ares-emulator/ares
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add script to build an universal binary on mac
- Loading branch information
Showing
2 changed files
with
33 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,6 @@ | ||
obj/ | ||
out/ | ||
obj-amd64/ | ||
obj-arm64/ | ||
out-amd64/ | ||
out-arm64/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
#!/bin/bash | ||
set -euo pipefail | ||
|
||
if ! command -v lipo >/dev/null; then | ||
echo "Command lipo not found; please install XCode" | ||
exit 1 | ||
fi | ||
|
||
if ! command -v gmake >/dev/null; then | ||
echo "Please install make via Homebrew (brew install make)" | ||
exit 1 | ||
fi | ||
|
||
# Change to parent directory (top-level) | ||
cd "$(dirname "$0")"/.. || exit 1 | ||
|
||
echo "Building for amd64..." | ||
gmake arch=amd64 object.path=obj-amd64 output.path=out-amd64 "$@" | ||
|
||
echo "Building for arm64..." | ||
gmake arch=arm64 object.path=obj-arm64 output.path=out-arm64 "$@" | ||
|
||
echo "Assembling universal binary" | ||
rm -rf desktop-ui/out | ||
cp -a desktop-ui/out-amd64 desktop-ui/out | ||
lipo -create -output desktop-ui/out/ares.app/Contents/MacOS/ares \ | ||
desktop-ui/out-amd64/ares.app/Contents/MacOS/ares \ | ||
desktop-ui/out-arm64/ares.app/Contents/MacOS/ares | ||
codesign --force --deep --sign - desktop-ui/out/ares.app |