Skip to content

Instantly share code, notes, and snippets.

@nacho4d
Created October 8, 2015 08:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nacho4d/a41e1f456fbe9a52b2cb to your computer and use it in GitHub Desktop.
Save nacho4d/a41e1f456fbe9a52b2cb to your computer and use it in GitHub Desktop.
Make universal framework at build time to pass github binary size restrictions
cd "${PROJECT_DIR}/MyProject/lib/"
libs=( IBMMobileFirstPlatformFoundation sqlcipher )
archs=( armv7 armv7s i386 x86_64 arm64 )
# create bunch of thin files.
function lipo_extract() {
lib=${1}
pushd "${lib}.framework" > /dev/null
for arch in "${archs[@]}"; do
lipo -extract $arch ${lib} -o "${lib}_${arch}"
done
popd > /dev/null
}
#lipo_extract ${libs[0]}
#lipo_extract ${libs[1]}
#exit 1;
echo 'Attempting to do `lipo -create`:'
echo "Libs: ${libs[@]}"
echo "Architectures: ${archs[@]}"
# create one fat file
function lipo_create() {
lib=${1}
pushd "${lib}.framework" > /dev/null
if [ -e ${lib} ]; then
echo "Nothing to do. File was found: ${lib}";
else
thins="";
for arch in "${archs[@]}"; do
thins="${thins} ${lib}_${arch}";
done
lipo -create $thins -o ${lib}
echo "Created ${lib} !"
fi
popd > /dev/null
}
lipo_create ${libs[0]}
lipo_create ${libs[1]}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment