Skip to content

Commit

Permalink
Build Linux: enable dependency debug build
Browse files Browse the repository at this point in the history
Automatically cleans buildCache when switching between Release and Debug builds. Mostly useful for local debugging.
  • Loading branch information
ChristianBeer committed Apr 11, 2017
1 parent 469fcc1 commit a964b72
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 7 deletions.
14 changes: 14 additions & 0 deletions 3rdParty/buildLinuxDependencies.sh
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ ROOTDIR=$(pwd)
cache_dir=""
doclean=""
wxoption=""
build_config="Release"
while [[ $# -gt 0 ]]; do
key="$1"
case $key in
Expand All @@ -63,6 +64,7 @@ while [[ $# -gt 0 ]]; do
;;
--debug)
wxoption="--debug"
build_config="Debug"
;;
*)
echo "unrecognized option $key"
Expand All @@ -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}"
Expand Down Expand Up @@ -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
Expand Down
9 changes: 2 additions & 7 deletions 3rdParty/buildWxLinux.sh
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ else
fi

doclean=""
configuration="Release"
debug_flag="--disable-debug_flag"
lprefix=""
cmdline_prefix=""
while [[ $# -gt 0 ]]; do
Expand All @@ -71,7 +71,7 @@ while [[ $# -gt 0 ]]; do
doclean="yes"
;;
-debug|--debug)
configuration="Debug"
debug_flag="--enable-debug"
;;
-prefix|--prefix)
lprefix="$2"
Expand All @@ -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
Expand Down

0 comments on commit a964b72

Please sign in to comment.