I\'m completely new to using C++ libraries, so appreciate this might be a bit specific for my case (let me know and I can provide more details).
I have an external
The script by Mobile Ben is great, apart from the final line hardcodes a library filename into the script. The following is a replacement for the last lipo command and dynamically uses lipo merges each library file created after compilation.
Change Mobile Ben's line:
$LIPO -create $pwd/output/armv7/lib/libpresage.a $pwd/output/armv7s/lib/libpresage.a $pwd/output/arm64/lib/libpresage.a $pwd/output/x86_64/lib/libpresage.a $pwd/output/i386/lib/libpresage.a -output libpresage.a
to:
for t in `ls $pwd/output/armv7/lib/*.a` ;
do
export LIB=`basename $t`
export ARCHSTRING=""
for a in `ls $pwd/output`
do
export ARCSTRING="$ARCSTRING $pwd/output/$a/lib/$LIB "
done
$LIPO -create $ARCSTRING -output $LIB
done
Note: I didn't want to edit Mobile Ben's answer with new code functionality, and adding this as a comment lost formatting.