CMake: Error out if ccache is requested but not found

Before, we would just issue a warning which is likely to get overlooked
in CMake's output.  Also, the configure summary would report "Using
ccache ... yes" but CMAKE_<LANG>_COMPILER_LAUNCHER stays unset, which is
inconsistent.

Make QT_USE_CCACHE=ON and missing ccache a hard error.

Task-number: QTBUG-88308
Change-Id: Iddc7f3a91428fd96ad0defbb1ca72bd46a90aa98
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
This commit is contained in:
Joerg Bornemann 2021-08-27 11:43:04 +02:00
parent d94652f792
commit f9e9d21a11

View File

@ -228,7 +228,7 @@ if(QT_USE_CCACHE)
set(CMAKE_OBJC_COMPILER_LAUNCHER "${CCACHE_PROGRAM}")
set(CMAKE_OBJCXX_COMPILER_LAUNCHER "${CCACHE_PROGRAM}")
else()
message(WARNING "Ccache use was requested, but the program was not found.")
message(FATAL_ERROR "Ccache use was requested, but the program was not found.")
endif()
endif()