Skip to content

Commit d741fc8

Browse files
authored
Merge branch 'master' into patch-4
2 parents 666e134 + 951271b commit d741fc8

File tree

2 files changed

+57
-28
lines changed

2 files changed

+57
-28
lines changed

boost.sh

Lines changed: 32 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
#
3030
#===============================================================================
3131

32-
BOOST_VERSION=1.64.0
32+
BOOST_VERSION=1.67.0
3333

3434
BOOST_LIBS="atomic chrono date_time exception filesystem program_options random signals system thread test"
3535
ALL_BOOST_LIBS=\
@@ -43,17 +43,18 @@ IOS_SDK_VERSION=`xcrun --sdk iphoneos --show-sdk-version`
4343

4444
MIN_TVOS_VERSION=10.0
4545
TVOS_SDK_VERSION=`xcrun --sdk appletvos --show-sdk-version`
46+
TVOS_SDK_PATH=`xcrun --sdk appletvos --show-sdk-path`
47+
TVOSSIM_SDK_PATH=`xcrun --sdk appletvsimulator --show-sdk-path`
4648

4749
MIN_MACOS_VERSION=10.10
4850
MACOS_SDK_VERSION=`xcrun --sdk macosx --show-sdk-version`
51+
MACOS_SDK_PATH=`xcrun --sdk macosx --show-sdk-path`
4952

5053
MACOS_ARCHS=("x86_64")
5154
IOS_ARCHS=("armv7 arm64")
5255

5356
# Applied to all platforms
54-
CXX_FLAGS="-std=c++11 -stdlib=libc++"
55-
56-
MACOS_SDK_PATH=`xcrun --sdk macosx --show-sdk-path`
57+
CXX_FLAGS="-std=c++14 -stdlib=libc++"
5758

5859
XCODE_ROOT=`xcode-select -print-path`
5960
COMPILER="$XCODE_ROOT/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++"
@@ -483,7 +484,7 @@ unpackBoost()
483484
echo Unpacking boost into "$SRCDIR"...
484485

485486
[ -d "$SRCDIR" ] || mkdir -p "$SRCDIR"
486-
[ -d "$BOOST_SRC" ] || ( cd "$SRCDIR"; tar xfj "$BOOST_TARBALL" )
487+
[ -d "$BOOST_SRC" ] || ( cd "$SRCDIR"; tar xjf "$BOOST_TARBALL" )
487488
[ -d "$BOOST_SRC" ] && echo " ...unpacked as $BOOST_SRC"
488489

489490
doneSection
@@ -531,12 +532,12 @@ EOF
531532
if [[ "$1" == "tvOS" ]]; then
532533
cat > "$BOOST_SRC/tools/build/src/user-config.jam" <<EOF
533534
using darwin : ${TVOS_SDK_VERSION}~appletv
534-
: $COMPILER -arch arm64 $EXTRA_TVOS_FLAGS -I${XCODE_ROOT}/Platforms/AppleTVOS.platform/Developer/SDKs/AppleTVOS${TVOS_SDK_VERSION}.sdk/usr/include
535+
: $COMPILER -arch arm64 $EXTRA_TVOS_FLAGS -isysroot $TVOS_SDK_PATH -I $TVOS_SDK_PATH
535536
: <striper> <root>$XCODE_ROOT/Platforms/AppleTVOS.platform/Developer
536537
: <architecture>arm <target-os>iphone
537538
;
538539
using darwin : ${TVOS_SDK_VERSION}~appletvsim
539-
: $COMPILER -arch x86_64 $EXTRA_TVOS_FLAGS -I${XCODE_ROOT}/Platforms/AppleTVSimulator.platform/Developer/SDKs/AppleTVSimulator${TVOS_SDK_VERSION}.sdk/usr/include
540+
: $COMPILER -arch x86_64 $EXTRA_TVOS_FLAGS -isysroot $TVOSSIM_SDK_PATH -I $TVOSSIM_SDK_PATH
540541
: <striper> <root>$XCODE_ROOT/Platforms/AppleTVSimulator.platform/Developer
541542
: <architecture>x86 <target-os>iphone
542543
;
@@ -547,7 +548,7 @@ EOF
547548
if [[ "$1" == "macOS" ]]; then
548549
cat > "$BOOST_SRC/tools/build/src/user-config.jam" <<EOF
549550
using darwin : ${MACOS_SDK_VERSION}
550-
: $COMPILER $MACOS_ARCH_FLAGS $EXTRA_MACOS_FLAGS
551+
: $COMPILER $MACOS_ARCH_FLAGS $EXTRA_MACOS_FLAGS -isysroot $MACOS_SDK_PATH
551552
: <striper> <root>$XCODE_ROOT/Platforms/MacOSX.platform/Developer
552553
: <architecture>x86 <target-os>darwin
553554
;
@@ -759,11 +760,11 @@ scrunchAllLibsTogetherInOneLibPerPlatform()
759760
fi
760761

761762
if [[ -n $BUILD_TVOS ]]; then
762-
$TVOS_ARM_DEV_CMD lipo "appletv-build/stage/lib/libboost_$NAME.a" \
763-
-thin arm64 -o "$TVOS_BUILD_DIR/arm64/libboost_$NAME.a"
763+
cp "appletv-build/stage/lib/libboost_$NAME.a" \
764+
"$TVOS_BUILD_DIR/arm64/libboost_$NAME.a"
764765

765-
$TVOS_SIM_DEV_CMD lipo "appletvsim-build/stage/lib/libboost_$NAME.a" \
766-
-thin x86_64 -o "$TVOS_BUILD_DIR/x86_64/libboost_$NAME.a"
766+
cp "appletvsim-build/stage/lib/libboost_$NAME.a" \
767+
"$TVOS_BUILD_DIR/x86_64/libboost_$NAME.a"
767768
fi
768769

769770
if [[ -n $BUILD_MACOS ]]; then
@@ -830,7 +831,7 @@ scrunchAllLibsTogetherInOneLibPerPlatform()
830831

831832
echo "Archiving $NAME"
832833

833-
# The obj/$NAME/*.o below should all be quotet, but I couldn't figure out how to do that elegantly.
834+
# The obj/$NAME/*.o below should all be quoted, but I couldn't figure out how to do that elegantly.
834835
# Boost lib names probably won't contain non-word characters any time soon, though. ;) - Jan
835836

836837
if [[ -n $BUILD_IOS ]]; then
@@ -867,46 +868,48 @@ buildUniversal()
867868
if [[ -n $BUILD_IOS ]]; then
868869
mkdir -p "$IOS_BUILD_DIR/universal"
869870

871+
cd "$IOS_BUILD_DIR"
870872
for NAME in $BOOTSTRAP_LIBS; do
871873
if [ "$NAME" == "test" ]; then
872874
NAME="unit_test_framework"
873875
fi
874876

875877
ARCH_FILES=""
876878
for ARCH in ${IOS_ARCHS[@]}; do
877-
ARCH_FILES+=" $IOS_BUILD_DIR/$ARCH/libboost_$NAME.a"
879+
ARCH_FILES+=" $ARCH/libboost_$NAME.a"
878880
done
879881
# Ideally IOS_ARCHS contains i386 and x86_64 and simulator build steps are not treated out of band
880-
if [ -f $IOS_BUILD_DIR/i386/libboost_$NAME.a ]; then
881-
ARCH_FILES+=" $IOS_BUILD_DIR/i386/libboost_$NAME.a"
882+
if [ -f "i386/libboost_$NAME.a" ]; then
883+
ARCH_FILES+=" i386/libboost_$NAME.a"
882884
fi
883-
if [ -f $IOS_BUILD_DIR/x86_64/libboost_$NAME.a ]; then
884-
ARCH_FILES+=" $IOS_BUILD_DIR/x86_64/libboost_$NAME.a"
885+
if [ -f "x86_64/libboost_$NAME.a" ]; then
886+
ARCH_FILES+=" x86_64/libboost_$NAME.a"
885887
fi
886888
if [[ ${ARCH_FILES[@]} ]]; then
887889
echo "... $NAME"
888-
$IOS_ARM_DEV_CMD lipo -create $ARCH_FILES -o "$IOS_BUILD_DIR/universal/libboost_$NAME.a" || abort "Lipo $1 failed"
890+
$IOS_ARM_DEV_CMD lipo -create $ARCH_FILES -o "universal/libboost_$NAME.a" || abort "Lipo $1 failed"
889891
fi
890892
done
891893
fi
892894
if [[ -n $BUILD_TVOS ]]; then
893895
mkdir -p "$TVOS_BUILD_DIR/universal"
894896

897+
cd "$TVOS_BUILD_DIR"
895898
for NAME in $BOOTSTRAP_LIBS; do
896899
if [ "$NAME" == "test" ]; then
897900
NAME="unit_test_framework"
898901
fi
899902

900903
ARCH_FILES=""
901-
if [ -f $TVOS_BUILD_DIR/arm64/libboost_$NAME.a ]; then
902-
ARCH_FILES+=" $TVOS_BUILD_DIR/arm64/libboost_$NAME.a"
904+
if [ -f "arm64/libboost_$NAME.a" ]; then
905+
ARCH_FILES+=" arm64/libboost_$NAME.a"
903906
fi
904-
if [ -f $TVOS_BUILD_DIR/x86_64/libboost_$NAME.a ]; then
905-
ARCH_FILES+=" $TVOS_BUILD_DIR/x86_64/libboost_$NAME.a"
907+
if [ -f "x86_64/libboost_$NAME.a" ]; then
908+
ARCH_FILES+=" x86_64/libboost_$NAME.a"
906909
fi
907910
if [[ ${ARCH_FILES[@]} ]]; then
908911
echo "... $NAME"
909-
$TVOS_ARM_DEV_CMD lipo -create $ARCH_FILES -o "$TVOS_BUILD_DIR/universal/libboost_$NAME.a" || abort "Lipo $1 failed"
912+
$TVOS_ARM_DEV_CMD lipo -create $ARCH_FILES -o "universal/libboost_$NAME.a" || abort "Lipo $1 failed"
910913
fi
911914
done
912915
fi
@@ -1036,9 +1039,8 @@ fi
10361039
# Should perhaps also consider/use instead: -BOOST_SP_USE_PTHREADS
10371040

10381041
# Must set these after parseArgs to fill in overriden values
1039-
EXTRA_FLAGS="-DBOOST_AC_USE_PTHREADS -DBOOST_SP_USE_PTHREADS -g -DNDEBUG \
1040-
-fvisibility=hidden -fvisibility-inlines-hidden \
1041-
-Wno-unused-local-typedef -fembed-bitcode"
1042+
EXTRA_FLAGS="-DBOOST_AC_USE_PTHREADS -DBOOST_SP_USE_PTHREADS -g -DNDEBUG"`
1043+
`" -Wno-unused-local-typedef -fembed-bitcode -Wno-nullability-completeness"
10421044
EXTRA_IOS_FLAGS="$EXTRA_FLAGS -mios-version-min=$MIN_IOS_VERSION"
10431045
EXTRA_TVOS_FLAGS="$EXTRA_FLAGS -mtvos-version-min=$MIN_TVOS_VERSION"
10441046
EXTRA_MACOS_FLAGS="$EXTRA_FLAGS -mmacosx-version-min=$MIN_MACOS_VERSION"
@@ -1077,8 +1079,11 @@ printf "$format" "BOOST_VERSION:" "$BOOST_VERSION"
10771079
printf "$format" "IOS_SDK_VERSION:" "$IOS_SDK_VERSION"
10781080
printf "$format" "MIN_IOS_VERSION:" "$MIN_IOS_VERSION"
10791081
printf "$format" "TVOS_SDK_VERSION:" "$TVOS_SDK_VERSION"
1082+
printf "$format" "TVOS_SDK_PATH:" "$TVOS_SDK_PATH"
1083+
printf "$format" "TVOSSIM_SDK_PATH:" "$TVOSSIM_SDK_PATH"
10801084
printf "$format" "MIN_TVOS_VERSION:" "$MIN_TVOS_VERSION"
10811085
printf "$format" "MACOS_SDK_VERSION:" "$MACOS_SDK_VERSION"
1086+
printf "$format" "MACOS_SDK_PATH:" "$MACOS_SDK_PATH"
10821087
printf "$format" "MIN_MACOS_VERSION:" "$MIN_MACOS_VERSION"
10831088
printf "$format" "MACOS_ARCHS:" "${MACOS_ARCHS[*]}"
10841089
printf "$format" "IOS_ARCHS:" "${IOS_ARCHS[*]}"

changelog

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,29 @@
1+
12
-- 2018-09-20 --
2-
* Added support for building 32/64-bit macOS universal.
3+
* Added support for building 32/64-bit macOS universal
4+
5+
-- 2018-08-24 --
6+
* Fixed incorrect ordering of params for tar command
7+
8+
-- 2018-08-21 --
9+
* Disabled hiding symbols & inlines
10+
- This was causing clang to throw warnings, regardless of the project's
11+
visibility settings. I don't see any reason it needs to be enabled
12+
anyways.
13+
14+
If this causes a problem for your project let me know and I will add a
15+
CLI flag to optionally add them back in (or just do it yourself &
16+
submit a PR!)
17+
18+
-- 2018-08-15 --
19+
* Fixed universal build to allow for build directories that contain spaces
20+
21+
-- 2018-08-14 --
22+
* Fixed I'm stupid and forgot how line contiuations work in Bash...
23+
24+
-- 2018-07-27 --
25+
* Updated Boost version to 1.67.0
26+
* Fixed tvOS build
327

428
-- 2018-06-07 --
529
* Added a CLI flag to create universal FAT binaries for iOS and tvOS.

0 commit comments

Comments
 (0)