Adding option to load ccache in qmake command (build.sh)

This commit is contained in:
Thomas Ferreira de Lima 2019-04-04 18:53:54 -04:00
parent a40b0cb793
commit 7cecc4507f
No known key found for this signature in database
GPG Key ID: 43E98870EAA0A86E
2 changed files with 13 additions and 0 deletions

View File

@ -231,6 +231,10 @@ while [ "$*" != "" ]; do
echo " -libcurl Use libcurl instead of QtNetwork (for Qt<4.7)"
echo " -libexpat Use libexpat instead of QtXml"
echo ""
echo "Environment Variables:"
echo ""
echo " QMAKE_CCACHE=1 Adds CONFIG+=ccache to qmake command (only works if Qt>=5.9.2)"
echo ""
exit 0
;;
*)
@ -609,6 +613,14 @@ qmake_options=(
KLAYOUT_VERSION_REV="$KLAYOUT_VERSION_REV"
)
# This should speed up build time considerably
# https://ortogonal.github.io/ccache-and-qmake-qtcreator/
if [ $QMAKE_CCACHE = 1 ]; then
qmake_options+=(
CONFIG+="ccache"
)
fi
if [ $BUILD_EXPERT = 1 ]; then
qmake_options+=(
QMAKE_AR="$AR cqs"

View File

@ -11,6 +11,7 @@ touch build.txt
# Configure ccache
mkdir -p ccache;
export CCACHE_DIR="`pwd`/ccache"
export QMAKE_CCACHE=1
# Show ccache stats
echo "Cache stats:"