From d61b6ea30a4c7ea3a8c6100f74c88c839f66abc4 Mon Sep 17 00:00:00 2001 From: Simon Hausmann Date: Tue, 12 Feb 2019 12:21:30 +0100 Subject: Add support for building conveniently with ccache Pass -DQT_USE_CCACHE=ON to enable the use of ccache. This avoids having to set up symlinks, which is useful when cross-compiling against different targets. Change-Id: I023fff105baaa538730997948aa122d2678887ce Reviewed-by: Kevin Funk --- cmake/QtSetup.cmake | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'cmake/QtSetup.cmake') diff --git a/cmake/QtSetup.cmake b/cmake/QtSetup.cmake index a01d8a651c..6fd2b2d923 100644 --- a/cmake/QtSetup.cmake +++ b/cmake/QtSetup.cmake @@ -47,3 +47,11 @@ endif() ## Enable support for sanitizers: include(${CMAKE_CURRENT_LIST_DIR}/3rdparty/extra-cmake-modules/modules/ECMEnableSanitizers.cmake) + +option(QT_USE_CCACHE "Enable the use of ccache") +if(QT_USE_CCACHE) + find_program(CCACHE_PROGRAM ccache) + set(CMAKE_C_COMPILER_LAUNCHER "${CCACHE_PROGRAM}") + set(CMAKE_CXX_COMPILER_LAUNCHER "${CCACHE_PROGRAM}") + set(CMAKE_OBJC_COMPILER_LAUNCHER "${CCACHE_PROGRAM}") +endif() -- cgit v1.2.3