Skip to content

Commit 84e9ad2

Browse files
author
Ralph-Gordon Paul
committed
Add possibility to compile debug version
1 parent 1b94ec2 commit 84e9ad2

File tree

1 file changed

+19
-8
lines changed

1 file changed

+19
-8
lines changed

boost.sh

Lines changed: 19 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,8 @@ TVOS_ARM_DEV_CMD="xcrun --sdk appletvos"
7070
TVOS_SIM_DEV_CMD="xcrun --sdk appletvsimulator"
7171
MACOS_DEV_CMD="xcrun --sdk macosx"
7272

73+
BUILD_VARIANT=release
74+
7375
#===============================================================================
7476
# Functions
7577
#===============================================================================
@@ -91,6 +93,9 @@ OPTIONS:
9193
-h | --help
9294
Display these options and exit.
9395
96+
-debug
97+
Build a debug variant.
98+
9499
-ios
95100
Build for the iOS platform.
96101
@@ -263,6 +268,10 @@ parseArgs()
263268
exit
264269
;;
265270

271+
-debug)
272+
BUILD_VARIANT=debug
273+
;;
274+
266275
-ios)
267276
BUILD_IOS=1
268277
;;
@@ -613,22 +622,22 @@ buildBoost_iOS()
613622
--prefix="$IOS_OUTPUT_DIR/prefix" toolset=darwin \
614623
cxxflags="${CXX_FLAGS} ${IOS_ARCH_FLAGS}" architecture=arm target-os=iphone \
615624
macosx-version=iphone-${IOS_SDK_VERSION} define=_LITTLE_ENDIAN \
616-
link=static stage >> "${IOS_OUTPUT_DIR}/ios-build.log" 2>&1
625+
link=static variant=${BUILD_VARIANT} stage >> "${IOS_OUTPUT_DIR}/ios-build.log" 2>&1
617626
if [ $? != 0 ]; then echo "Error staging iPhone. Check log."; exit 1; fi
618627

619628
./b2 $THREADS --build-dir=iphone-build --stagedir=iphone-build/stage \
620629
--prefix="$IOS_OUTPUT_DIR/prefix" toolset=darwin \
621630
cxxflags="${CXX_FLAGS} ${IOS_ARCH_FLAGS}" architecture=arm \
622631
target-os=iphone macosx-version=iphone-${IOS_SDK_VERSION} \
623-
define=_LITTLE_ENDIAN link=static install >> "${IOS_OUTPUT_DIR}/ios-build.log" 2>&1
632+
define=_LITTLE_ENDIAN link=static variant=${BUILD_VARIANT} install >> "${IOS_OUTPUT_DIR}/ios-build.log" 2>&1
624633
if [ $? != 0 ]; then echo "Error installing iPhone. Check log."; exit 1; fi
625634
doneSection
626635

627636
echo Building Boost for iPhoneSimulator
628637
./b2 $THREADS --build-dir=iphonesim-build --stagedir=iphonesim-build/stage \
629638
toolset=darwin-${IOS_SDK_VERSION}~iphonesim cxxflags="${CXX_FLAGS}" architecture=x86 \
630639
target-os=iphone macosx-version=iphonesim-${IOS_SDK_VERSION} \
631-
link=static stage >> "${IOS_OUTPUT_DIR}/ios-build.log" 2>&1
640+
link=static variant=${BUILD_VARIANT} stage >> "${IOS_OUTPUT_DIR}/ios-build.log" 2>&1
632641
if [ $? != 0 ]; then echo "Error staging iPhoneSimulator. Check log."; exit 1; fi
633642
doneSection
634643
}
@@ -642,20 +651,21 @@ buildBoost_tvOS()
642651
./b2 $THREADS --build-dir=appletv-build --stagedir=appletv-build/stage \
643652
--prefix="$TVOS_OUTPUT_DIR/prefix" toolset=darwin-${TVOS_SDK_VERSION}~appletv \
644653
cxxflags="${CXX_FLAGS}" architecture=arm target-os=iphone define=_LITTLE_ENDIAN \
645-
link=static stage >> "${TVOS_OUTPUT_DIR}/tvos-build.log" 2>&1
654+
link=static variant=${BUILD_VARIANT} stage >> "${TVOS_OUTPUT_DIR}/tvos-build.log" 2>&1
646655
if [ $? != 0 ]; then echo "Error staging AppleTV. Check log."; exit 1; fi
647656

648657
./b2 $THREADS --build-dir=appletv-build --stagedir=appletv-build/stage \
649658
--prefix="$TVOS_OUTPUT_DIR/prefix" toolset=darwin-${TVOS_SDK_VERSION}~appletv \
650659
cxxflags="${CXX_FLAGS}" architecture=arm target-os=iphone define=_LITTLE_ENDIAN \
651-
link=static install >> "${TVOS_OUTPUT_DIR}/tvos-build.log" 2>&1
660+
link=static variant=${BUILD_VARIANT} install >> "${TVOS_OUTPUT_DIR}/tvos-build.log" 2>&1
652661
if [ $? != 0 ]; then echo "Error installing AppleTV. Check log."; exit 1; fi
653662
doneSection
654663

655664
echo Building Boost for AppleTVSimulator
656665
./b2 $THREADS --build-dir=appletv-build --stagedir=appletvsim-build/stage \
657666
toolset=darwin-${TVOS_SDK_VERSION}~appletvsim architecture=x86 \
658-
cxxflags="${CXX_FLAGS}" target-os=iphone link=static stage >> "${TVOS_OUTPUT_DIR}/tvos-build.log" 2>&1
667+
cxxflags="${CXX_FLAGS}" target-os=iphone link=static variant=${BUILD_VARIANT} \
668+
stage >> "${TVOS_OUTPUT_DIR}/tvos-build.log" 2>&1
659669
if [ $? != 0 ]; then echo "Error staging AppleTVSimulator. Check log."; exit 1; fi
660670
doneSection
661671
}
@@ -669,14 +679,14 @@ buildBoost_macOS()
669679
./b2 $THREADS --build-dir=macos-build --stagedir=macos-build/stage --prefix="$MACOS_OUTPUT_DIR/prefix" \
670680
toolset=darwin-${MACOS_SDK_VERSION} architecture=x86 \
671681
cxxflags="${CXX_FLAGS} ${MACOS_ARCH_FLAGS} ${EXTRA_MACOS_SDK_FLAGS}" \
672-
linkflags="-stdlib=libc++ ${EXTRA_MACOS_SDK_FLAGS}" link=static threading=multi \
682+
linkflags="-stdlib=libc++ ${EXTRA_MACOS_SDK_FLAGS}" link=static variant=${BUILD_VARIANT} threading=multi \
673683
macosx-version=${MACOS_SDK_VERSION} stage >> "${MACOS_OUTPUT_DIR}/macos-build.log" 2>&1
674684
if [ $? != 0 ]; then echo "Error staging macOS. Check log."; exit 1; fi
675685

676686
./b2 $THREADS --build-dir=macos-build --stagedir=macos-build/stage --prefix="$MACOS_OUTPUT_DIR/prefix" \
677687
toolset=darwin-${MACOS_SDK_VERSION} architecture=x86 \
678688
cxxflags="${CXX_FLAGS} ${MACOS_ARCH_FLAGS} ${EXTRA_MACOS_SDK_FLAGS}" \
679-
linkflags="-stdlib=libc++ ${EXTRA_MACOS_SDK_FLAGS}" link=static threading=multi \
689+
linkflags="-stdlib=libc++ ${EXTRA_MACOS_SDK_FLAGS}" link=static variant=${BUILD_VARIANT} threading=multi \
680690
macosx-version=${MACOS_SDK_VERSION} install >> "${MACOS_OUTPUT_DIR}/macos-build.log" 2>&1
681691
if [ $? != 0 ]; then echo "Error installing macOS. Check log."; exit 1; fi
682692

@@ -1101,6 +1111,7 @@ printf "$format" "IOS_FRAMEWORK_DIR:" "$IOS_FRAMEWORK_DIR"
11011111
printf "$format" "MACOS_FRAMEWORK_DIR:" "$MACOS_FRAMEWORK_DIR"
11021112
printf "$format" "XCODE_ROOT:" "$XCODE_ROOT"
11031113
printf "$format" "THREADS:" "$THREADS"
1114+
printf "$format" "VARIANT:" "$BUILD_VARIANT"
11041115
echo
11051116

11061117
if [[ -n "$PURGE" ]]; then

0 commit comments

Comments
 (0)