From b7de192880edec578682c86c9ca1e6b1b792cba8 Mon Sep 17 00:00:00 2001 From: Dmitri Naumov <github@naumov.de> Date: Mon, 6 May 2019 00:01:51 +0200 Subject: [PATCH] [cmake] Use ccache --get-config for sloppiness. ccache --print-config is not a valid option since ccache 3.7. Using specific config access. --- scripts/cmake/CCacheSetup.cmake | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/scripts/cmake/CCacheSetup.cmake b/scripts/cmake/CCacheSetup.cmake index a6f982ab131..388da19624d 100644 --- a/scripts/cmake/CCacheSetup.cmake +++ b/scripts/cmake/CCacheSetup.cmake @@ -28,18 +28,22 @@ if($ENV{TRAVIS}) endif() # Check ccache pre-compiled headers config -execute_process(COMMAND ${CCACHE_TOOL_PATH} --print-config +execute_process(COMMAND ${CCACHE_TOOL_PATH} --get-config=sloppiness OUTPUT_VARIABLE CCACHE_CONFIG ERROR_VARIABLE CCACHE_CONFIG + OUTPUT_STRIP_TRAILING_WHITESPACE + ERROR_STRIP_TRAILING_WHITESPACE ) -# Regex should be "sloppiness.*time_macros.*pch_defines.*" but due to bug fixed -# in https://ccache.samba.org/releasenotes.html#_ccache_3_2_5 we have to leave -# out pch_defines. Ubuntu 16.04 comes with ccache 3.2.4 ... -string(REGEX MATCH "sloppiness.*time_macros.*" - COTIRE_CCACHE_CONFIG ${CCACHE_CONFIG} +string(REGEX MATCH ".*time_macros.*" + COTIRE_CCACHE_CONFIG_TIME_MACROS ${CCACHE_CONFIG} +) +string(REGEX MATCH ".*pch_defines.*" + COTIRE_CCACHE_CONFIG_PCH_DEFINES ${CCACHE_CONFIG} ) -if(NOT COTIRE_CCACHE_CONFIG) - message(FATAL_ERROR "CCache not configured! You must set sloppiness to pch_defines,time_macros. See https://docs.opengeosys.org/docs/devguide/advanced/using-ccache") +if(NOT (COTIRE_CCACHE_CONFIG_TIME_MACROS AND COTIRE_CCACHE_CONFIG_PCH_DEFINES)) + message(FATAL_ERROR "CCache configuration does not set sloppiness to pch_defines,time_macros. \ + Current sloppiness option is set to '${CCACHE_CONFIG}'. \ + See https://docs.opengeosys.org/docs/devguide/advanced/using-ccache") endif() -- GitLab