rpcs3/.ci/optimize-mac.sh
nastys eb9acd9b56
macOS arm64 CI (#16070)
* Merge MacOS jobs
* Code signing
* rpath hack
* Upgrade macOS VM to 13
* Update llvm compiler
* Update to macOS Sonoma
* Update build-mac.sh
* Remove unnecessary version check
* Disable Homebrew cache
* Use macosx_version_min
* Downgrade min version and VM to 13
* Force -D__MAC_OS_X_VERSION_MIN_REQUIRED=130000
* Ignore -Welaborated-enum-base in display_sleep
* Move compiler version to env variable
* Enable auto-updater on macOS ARM64
2024-09-22 20:39:43 +02:00

22 lines
506 B
Bash

#!/bin/sh
file_path=$(find "$1/Contents/MacOS" -type f -print0 | head -n 1)
if [ -z "$file_path" ]; then
echo "No executable file found in $1/Contents/MacOS" >&2
exit 1
fi
target_architecture="$(lipo "$file_path" -archs)"
if [ -z "$target_architecture" ]; then
exit 1
fi
# shellcheck disable=SC3045
find "$1" -type f -print0 | while IFS= read -r -d '' file; do
echo Thinning "$file" -> "$target_architecture"
lipo "$file" -thin "$target_architecture" -output "$file" || true
done