Add setting the CMAKE_BUILD_TYPE to build-me.sh.

The default MUST set -DCMAKE_BUILD_TYPE=Release - without this addition
the -DNDEBUG compiler flag is NOT set, leaving 'asserts' in the code.

Asserts are good and necessary for a Debug version, for testing, but
with their brutal abort on error should NOT really be in Release code
IMHO.

And after all this is ONLY in a 'sample' build-me.sh script. Users
are free to use whatever options they desire in their own build of
tidy, and frequently do.
This commit is contained in:
Geoff R. McLane 2015-04-29 18:23:28 +02:00
parent b2b9f1d6f2
commit 4293c8cc3e

View file

@ -30,28 +30,31 @@ if [ -f "$BLDLOG" ]; then
rm -f $BLDLOG
fi
BLDDBG=0
TMPOPTS=""
##############################################
### ***** NOTE THIS INSTALL LOCATION ***** ###
### Change to suit your taste, environment ###
##############################################
# TMPINST="$HOME/projects/install/tidy"
# TMPOPTS="-DCMAKE_INSTALL_PREFIX=$TMPINST"
#############################################
# To build SHARED library
TMPOPTS="$TMPOPTS -DBUILD_SHARED_LIB:BOOL=TRUE"
TMPINST="/usr"
TMPOPTS="$TMPOPTS -DCMAKE_INSTALL_PREFIX=$TMPINST"
##############################################
### Accept user argument
for arg in $@; do
case $arg in
VERBOSE) TMPOPTS="$TMPOPTS -DCMAKE_VERBOSE_MAKEFILE=ON" ;;
DEBUG) TMPOPTS="$TMPOPTS -DCMAKE_BUILD_TYPE=Debug -DENABLE_DEBUG_SYMBOLS:BOOL=TRUE" ;;
DEBUG) BLDDBG=1 ;;
SHARED) TMPOPTS="$TMPOPTS -DBUILD_SHARED_LIB:BOOL=TRUE" ;;
*) TMPOPTS="$TMPOPTS $arg" ;;
esac
done
if [ "$BLDDBG" = "1" ]; then
TMPOPTS="$TMPOPTS -DCMAKE_BUILD_TYPE=Debug -DENABLE_DEBUG_SYMBOLS:BOOL=TRUE"
else
TMPOPTS="$TMPOPTS -DCMAKE_BUILD_TYPE=Release"
fi
echo "$BN: Will do: 'cmake $TMPSRC $TMPOPTS' to $BLDLOG"
wait_for_input