Created
October 8, 2015 08:22
-
-
Save nacho4d/a41e1f456fbe9a52b2cb to your computer and use it in GitHub Desktop.
Make universal framework at build time to pass github binary size restrictions
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
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