Skip to content

Commit 8cd15a0

Browse files
committed
ios: faster make-frameworks
1 parent 569b8d9 commit 8cd15a0

1 file changed

Lines changed: 15 additions & 2 deletions

File tree

pkg/apple/make-frameworks.sh

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,11 @@ fi
3737

3838
mkdir -p "$OUTDIR"
3939

40-
for dylib in $(find "$BASE_DIR"/modules -maxdepth 1 -type f -regex '.*libretro.*\.dylib$') ; do
40+
process_one() {
41+
set -e
42+
local dylib="$1"
43+
local intermediate fwName fwDir build_sdk dSYMDir dylibName
44+
4145
intermediate=$(basename "$dylib")
4246
intermediate="${intermediate/%.dylib/}"
4347
if [ -n "$SUFFIX" ] ; then
@@ -87,7 +91,16 @@ for dylib in $(find "$BASE_DIR"/modules -maxdepth 1 -type f -regex '.*libretro.*
8791
# Update Info.plist with framework identifier
8892
/usr/libexec/PlistBuddy -c "Set :CFBundleIdentifier com.apple.xcode.dsym.$fwName" "$dSYMDir/Contents/Info.plist"
8993
fi
90-
done
94+
}
95+
export -f process_one
96+
export OUTDIR DSYM_OUTDIR SUFFIX PLATFORM_FAMILY_NAME PLATFORM \
97+
DEPLOYMENT_TARGET CODE_SIGN_IDENTITY_FOR_ITEMS
98+
99+
JOBS=$(sysctl -n hw.ncpu)
100+
if [ "$JOBS" -gt 8 ] ; then JOBS=8 ; fi
101+
102+
find "$BASE_DIR"/modules -maxdepth 1 -type f -regex '.*libretro.*\.dylib$' -print0 \
103+
| xargs -0 -n1 -P"$JOBS" bash -c 'process_one "$0"' || exit 1
91104

92105
# Copy in MoltenVK as an embedded library manually instead of having
93106
# Xcode do it. This makes it potentially easier to substitute out

0 commit comments

Comments
 (0)