diff options
author | Tor Arne Vestbø <tor.arne.vestbo@qt.io> | 2017-06-02 14:08:32 +0200 |
---|---|---|
committer | Tor Arne Vestbø <tor.arne.vestbo@qt.io> | 2017-09-05 10:47:35 +0000 |
commit | d64940891dffcb951f4b76426490cbc94fb4aba7 (patch) | |
tree | 2d4a61f5455bce51a2fa4eb4e190961db6e2381c /mkspecs | |
parent | 0adc14d8dbdd9e28ccb72c49d865009dd8df1b1c (diff) |
Add qmake feature and configure option to use ccache
Enabled via configure --ccache, or CONFIG += ccache in 3rd party
projects.
Ensures that we use the right sloppiness and other ccache options
during compilation.
Task-number: QTBUG-31034
Change-Id: I696b3d3f0398873a29b93d1bc2b4d4e06ef23dc9
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
Diffstat (limited to 'mkspecs')
-rw-r--r-- | mkspecs/features/unix/ccache.prf | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/mkspecs/features/unix/ccache.prf b/mkspecs/features/unix/ccache.prf new file mode 100644 index 0000000000..d5739d3eab --- /dev/null +++ b/mkspecs/features/unix/ccache.prf @@ -0,0 +1,19 @@ +macx-xcode: return() + +darwin: load(sdk) + +ccache_prefix = ccache + +precompile_header { + CCACHE_SLOPPINESS += pch_defines time_macros + + ccache_prefix = \ + CCACHE_SLOPPINESS=\"$$join(CCACHE_SLOPPINESS, ',')\$${CCACHE_SLOPPINESS+,\$$CCACHE_SLOPPINESS}\" \ + # Make sure we build sources directly, not from their preprocessed version, + # otherwise precompiled headers will not be used during cache misses. + CCACHE_CPP2=true \ + $$ccache_prefix +} + +for(tool, $$list(QMAKE_CC QMAKE_CXX QMAKE_LINK QMAKE_LINK_SHLIB QMAKE_LINK_C)): \ + $$tool = $$ccache_prefix $$eval($$tool) |