Skip to content

Commit ed091b8

Browse files
faithfractureJordan Bondo
authored andcommitted
Apparently I suck a bash...
Fixes #36
1 parent 8e168ff commit ed091b8

File tree

2 files changed

+31
-26
lines changed

2 files changed

+31
-26
lines changed

boost.sh

Lines changed: 28 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,8 @@ MACOS_SDK_VERSION=`xcrun --sdk macosx --show-sdk-version`
5555
MACOS_SDK_PATH=`xcrun --sdk macosx --show-sdk-path`
5656

5757
MACOS_ARCHS=("x86_64")
58-
IOS_ARCHS=("armv7 arm64")
59-
IOS_SIM_ARCHS=("i386 x86_64")
58+
IOS_ARCHS=("armv7" "arm64")
59+
IOS_SIM_ARCHS=("i386" "x86_64")
6060

6161
# Applied to all platforms
6262
CXX_FLAGS="-std=c++14 -stdlib=libc++"
@@ -447,24 +447,25 @@ parseArgs()
447447
# other architectures in the future we'll need to be a bit smarter
448448
# about this.
449449
if [[ -n $BUILD_MACOS && -n $UNIVERSAL ]]; then
450-
CUSTOM_MACOS_ARCHS=("i386 x86_64")
450+
CUSTOM_MACOS_ARCHS=("i386" "x86_64")
451451
fi
452452

453453
if [[ -n $CUSTOM_MACOS_ARCHS ]]; then
454-
MACOS_ARCHS=($CUSTOM_MACOS_ARCHS)
454+
IFS=' ' read -ra MACOS_ARCHS <<< "$CUSTOM_MACOS_ARCHS"
455455
fi
456456

457457
if [[ -n $CUSTOM_IOS_ARCHS ]]; then
458-
IOS_ARCHS=($CUSTOM_IOS_ARCHS)
459-
IOS_SIM_ARCHS=""
458+
IFS=' ' read -ra IOS_ARCHS <<< "$CUSTOM_IOS_ARCHS"
459+
#IOS_ARCHS=($CUSTOM_IOS_ARCHS)
460+
IOS_SIM_ARCHS=()
460461
# As of right now this matches the currently available ARM architectures
461462
# Add 32-bit simulator for 32-bit arm
462463
if [[ "${IOS_ARCHS[@]}" =~ armv ]]; then
463-
IOS_SIM_ARCHS="i386 $IOS_SIM_ARCHS"
464+
IOS_SIM_ARCHS+=("i386")
464465
fi
465466
# Add 64-bit simulator for 64-bit arm
466467
if [[ "${IOS_ARCHS[@]}" =~ arm64 ]]; then
467-
IOS_SIM_ARCHS="x86_64 $IOS_SIM_ARCHS"
468+
IOS_SIM_ARCHS+=("x86_64")
468469
fi
469470
elif (( $(echo "$MIN_IOS_VERSION >= 11.0" | bc -l) )); then
470471
IOS_ARCHS=("arm64")
@@ -792,25 +793,26 @@ scrunchAllLibsTogetherInOneLibPerPlatform()
792793
ALL_LIBS="$ALL_LIBS libboost_$NAME.a"
793794

794795
if [[ -n $BUILD_IOS ]]; then
795-
for ARCH in ${IOS_ARCHS[@]}; do
796-
if [[ ${#IOS_ARCHS[@]} > 1 ]]; then
796+
if [[ ${#IOS_ARCHS[@]} > 1 ]]; then
797+
for ARCH in ${IOS_ARCHS[@]}; do
797798
$IOS_ARM_DEV_CMD lipo "iphone-build/stage/lib/libboost_$NAME.a" \
798799
-thin $ARCH -o "$IOS_BUILD_DIR/$ARCH/libboost_$NAME.a"
799-
else
800-
cp "iphone-build/stage/lib/libboost_$NAME.a" \
801-
"$IOS_BUILD_DIR/$ARCH/libboost_$NAME.a"
802-
fi
803-
done
800+
done
801+
else
802+
echo Copying ${IOS_ARCHS[0]}
803+
cp "iphone-build/stage/lib/libboost_$NAME.a" \
804+
"$IOS_BUILD_DIR/${IOS_ARCHS[0]}/libboost_$NAME.a"
805+
fi
804806

805-
for ARCH in ${IOS_SIM_ARCHS[@]}; do
806-
if [[ ${#IOS_SIM_ARCHS[@]} > 1 ]]; then
807+
if [[ ${#IOS_SIM_ARCHS[@]} > 1 ]]; then
808+
for ARCH in ${IOS_SIM_ARCHS[@]}; do
807809
$IOS_SIM_DEV_CMD lipo "iphonesim-build/stage/lib/libboost_$NAME.a" \
808810
-thin $ARCH -o "$IOS_BUILD_DIR/$ARCH/libboost_$NAME.a"
809-
else
810-
cp "iphonesim-build/stage/lib/libboost_$NAME.a" \
811-
"$IOS_BUILD_DIR/$ARCH/libboost_$NAME.a"
812-
fi
813-
done
811+
done
812+
else
813+
cp "iphonesim-build/stage/lib/libboost_$NAME.a" \
814+
"$IOS_BUILD_DIR/${IOS_ARCHS[0]}/libboost_$NAME.a"
815+
fi
814816
fi
815817

816818
if [[ -n $BUILD_TVOS ]]; then
@@ -822,14 +824,14 @@ scrunchAllLibsTogetherInOneLibPerPlatform()
822824
fi
823825

824826
if [[ -n $BUILD_MACOS ]]; then
825-
if (( ${#MACOS_ARCHS[@]} == 1 )); then
826-
cp "macos-build/stage/lib/libboost_$NAME.a" \
827-
"$MACOS_BUILD_DIR/$ARCH/libboost_$NAME.a"
828-
else
827+
if (( ${#MACOS_ARCHS[@]} > 1 )); then
829828
for ARCH in ${MACOS_ARCHS[@]}; do
830829
$MACOS_DEV_CMD lipo "macos-build/stage/lib/libboost_$NAME.a" \
831830
-thin $ARCH -o "$MACOS_BUILD_DIR/$ARCH/libboost_$NAME.a"
832831
done
832+
else
833+
cp "macos-build/stage/lib/libboost_$NAME.a" \
834+
"$MACOS_BUILD_DIR/$ARCH/libboost_$NAME.a"
833835
fi
834836
fi
835837
done

changelog

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
-- 2019-08-14 --
2+
* Fixed my being stupid, doing bash arrays wrong, and breaking everyone
3+
14
-- 2019-07-01 --
25
* Added minimum version flags for the iOS and tvOS simulators
36
* iOS Simulator binaries now only build to match the specified

0 commit comments

Comments
 (0)