Created
February 5, 2012 16:09
-
-
Save neonichu/1746287 to your computer and use it in GitHub Desktop.
Create some quick and dirty universal static libraries from a Xcode 4 build directory
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
#!/bin/sh | |
## | |
## Create universal static libraries from a build directory | |
## | |
ls -ld Build >/dev/null 2>&1 | |
if [ $? -ne 0 ] | |
then | |
echo "No 'Build' directory found." | |
exit 1 | |
fi | |
libs=`find Build/Products -name '*.a'|xargs basename|sort|uniq` | |
for lib in $libs | |
do | |
file `find Build/Products -name $lib`|grep 'Mach-O universal binary' >/dev/null 2>&1 | |
if [ $? -eq 0 ] | |
then | |
continue | |
fi | |
lipo -create -output $lib `find Build/Products -name $lib` | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment