Build Linux: enable dependency debug build

Automatically cleans buildCache when switching between Release and Debug builds. Mostly useful for local debugging.
This commit is contained in:
Christian Beer 2017-04-11 13:07:44 +02:00
parent 469fcc10ce
commit a964b72f12
2 changed files with 16 additions and 7 deletions

View File

@ -51,6 +51,7 @@ ROOTDIR=$(pwd)
cache_dir=""
doclean=""
wxoption=""
build_config="Release"
while [[ $# -gt 0 ]]; do
key="$1"
case $key in
@ -63,6 +64,7 @@ while [[ $# -gt 0 ]]; do
;;
--debug)
wxoption="--debug"
build_config="Debug"
;;
*)
echo "unrecognized option $key"
@ -82,6 +84,17 @@ else
PREFIX="$(pwd)/3rdParty/buildCache/linux"
fi
if [ -f "${PREFIX}/build-config" ]; then
cur_config=$(<${PREFIX}/build-config)
if [ "${cur_config}" != "${build_config}" ]; then
doclean="yes"
wxoption="${wxoption} --clean"
fi
else
doclean="yes"
wxoption="${wxoption} --clean"
fi
download_and_build() {
cd "${ROOTDIR}/3rdParty/linux" || exit 1
DIRNAME="${1}"
@ -114,6 +127,7 @@ if [ "${doclean}" = "yes" ]; then
echo "cleaning cache"
rm -rf ${PREFIX}
mkdir -p ${PREFIX}
echo ${build_config} >${PREFIX}/build-config
fi
#download_and_build $DIRNAME $FILENAME $DOWNLOADURL $BUILDSCRIPT

View File

@ -61,7 +61,7 @@ else
fi
doclean=""
configuration="Release"
debug_flag="--disable-debug_flag"
lprefix=""
cmdline_prefix=""
while [[ $# -gt 0 ]]; do
@ -71,7 +71,7 @@ while [[ $# -gt 0 ]]; do
doclean="yes"
;;
-debug|--debug)
configuration="Debug"
debug_flag="--enable-debug"
;;
-prefix|--prefix)
lprefix="$2"
@ -82,11 +82,6 @@ while [[ $# -gt 0 ]]; do
shift # past argument or value
done
debug_flag="--disable-debug_flag"
if [ $configuration = "Debug" ]; then
debug_flag="--enable-debug"
fi
if [ -d buildgtk ] && [ "${doclean}" = "yes" ]; then
rm -rf buildgtk
fi