Remove redundant -arch from Bitcode check

This commit is contained in:
Davide De Rosa 2017-10-18 09:12:55 +02:00
parent 684c23e565
commit 8fd9082487
1 changed files with 6 additions and 12 deletions

View File

@ -23,11 +23,9 @@ if [ -d $FWROOT ]; then
fi fi
ALL_SYSTEMS=("iPhone" "AppleTV") ALL_SYSTEMS=("iPhone" "AppleTV")
ALL_BITCODE_ARCHS=("arm64" "arm64")
function check_bitcode() { function check_bitcode() {
local FWDIR=$1 local FWDIR=$1
local BITCODE_ARCH=$2
if [[ $FWTYPE == static ]]; then if [[ $FWTYPE == static ]]; then
BITCODE_PATTERN="__bitcode" BITCODE_PATTERN="__bitcode"
@ -35,8 +33,8 @@ function check_bitcode() {
BITCODE_PATTERN="__LLVM" BITCODE_PATTERN="__LLVM"
fi fi
if otool -arch $BITCODE_ARCH -l "$FWDIR/$FWNAME" | grep -q "${BITCODE_PATTERN}"; then if otool -l "$FWDIR/$FWNAME" | grep -q "${BITCODE_PATTERN}"; then
#BITCODE_MATCHES=$(otool -arch $BITCODE_ARCH -l "$FWDIR/$FWNAME" | grep -c "${BITCODE_PATTERN}") #BITCODE_MATCHES=$(otool -l "$FWDIR/$FWNAME" | grep -c "${BITCODE_PATTERN}")
#if [[ $BITCODE_MATCHES -gt 0 ]]; then #if [[ $BITCODE_MATCHES -gt 0 ]]; then
echo "INFO: $FWDIR contains Bitcode" echo "INFO: $FWDIR contains Bitcode"
else else
@ -101,12 +99,10 @@ if [ $FWTYPE == "dynamic" ]; then
done done
cd .. cd ..
for SYS_IDX in ${!ALL_SYSTEMS[@]}; do for SYS in ${ALL_SYSTEMS[@]}; do
SYS=${ALL_SYSTEMS[$SYS_IDX]}
SYSDIR="$FWROOT/$SYS" SYSDIR="$FWROOT/$SYS"
FWDIR="$SYSDIR/$FWNAME.framework" FWDIR="$SYSDIR/$FWNAME.framework"
DYLIBS=(bin/${SYS}*/$FWNAME.dylib) DYLIBS=(bin/${SYS}*/$FWNAME.dylib)
BITCODE_ARCH=${ALL_BITCODE_ARCHS[$SYS_IDX]}
if [[ ${#DYLIBS[@]} -gt 0 && -e ${DYLIBS[0]} ]]; then if [[ ${#DYLIBS[@]} -gt 0 && -e ${DYLIBS[0]} ]]; then
echo "Creating framework for $SYS" echo "Creating framework for $SYS"
@ -115,7 +111,7 @@ if [ $FWTYPE == "dynamic" ]; then
cp -r include/$FWNAME/* $FWDIR/Headers/ cp -r include/$FWNAME/* $FWDIR/Headers/
cp -L assets/$SYS/Info.plist $FWDIR/Info.plist cp -L assets/$SYS/Info.plist $FWDIR/Info.plist
echo "Created $FWDIR" echo "Created $FWDIR"
check_bitcode $FWDIR $BITCODE_ARCH check_bitcode $FWDIR
else else
echo "Skipped framework for $SYS" echo "Skipped framework for $SYS"
fi fi
@ -123,11 +119,9 @@ if [ $FWTYPE == "dynamic" ]; then
rm bin/*/$FWNAME.dylib rm bin/*/$FWNAME.dylib
else else
for SYS_IDX in ${!ALL_SYSTEMS[@]}; do for SYS in ${ALL_SYSTEMS[@]}; do
SYS=${ALL_SYSTEMS[$SYS_IDX]}
SYSDIR="$FWROOT/$SYS" SYSDIR="$FWROOT/$SYS"
FWDIR="$SYSDIR/$FWNAME.framework" FWDIR="$SYSDIR/$FWNAME.framework"
BITCODE_ARCH=${ALL_BITCODE_ARCHS[$SYS_IDX]}
if [[ -e lib/libcrypto-$SYS.a && -e lib/libssl-$SYS.a ]]; then if [[ -e lib/libcrypto-$SYS.a && -e lib/libssl-$SYS.a ]]; then
echo "Creating framework for $SYS" echo "Creating framework for $SYS"
@ -136,7 +130,7 @@ else
cp -r include/$FWNAME/* $FWDIR/Headers/ cp -r include/$FWNAME/* $FWDIR/Headers/
cp -L assets/$SYS/Info.plist $FWDIR/Info.plist cp -L assets/$SYS/Info.plist $FWDIR/Info.plist
echo "Created $FWDIR" echo "Created $FWDIR"
check_bitcode $FWDIR $BITCODE_ARCH check_bitcode $FWDIR
else else
echo "Skipped framework for $SYS" echo "Skipped framework for $SYS"
fi fi