From 7cecc4507fdef92feb617ed2883f227c5734980c Mon Sep 17 00:00:00 2001 From: Thomas Ferreira de Lima Date: Thu, 4 Apr 2019 18:53:54 -0400 Subject: [PATCH] Adding option to load ccache in qmake command (build.sh) --- build.sh | 12 ++++++++++++ travis-build.sh | 1 + 2 files changed, 13 insertions(+) diff --git a/build.sh b/build.sh index 715ab8a7d..cec552875 100755 --- a/build.sh +++ b/build.sh @@ -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" diff --git a/travis-build.sh b/travis-build.sh index bd412f30f..bab2aa080 100755 --- a/travis-build.sh +++ b/travis-build.sh @@ -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:"