cmake: don't use ccache on msys2+ninja

When using msys ccache with a mingw ninja, the compiler fails to
execute.

Don't try to detect ccache when using the Ninja generator on msys2, it
can still be specified through cmake variables.

Do not check for the mingw ccache because it is broken and I will assume
not being used.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
This commit is contained in:
Rafael Kitover 2019-02-14 14:58:13 -08:00
parent ed29b9c497
commit 5a77d8f4ba
No known key found for this signature in database
GPG Key ID: 08AB596679D86240
1 changed files with 9 additions and 6 deletions

View File

@ -40,12 +40,15 @@ endif()
set(ASM_DEFAULT OFF)
# use ccache if available, and not already enabled on the command line
if(NOT CMAKE_CXX_COMPILER_LAUNCHER AND NOT CMAKE_C_COMPILER_LAUNCHER)
find_program(CCACHE_FOUND ccache)
if(CCACHE_FOUND)
set_property(GLOBAL PROPERTY RULE_LAUNCH_COMPILE ccache)
set_property(GLOBAL PROPERTY RULE_LAUNCH_LINK ccache)
endif(CCACHE_FOUND)
# but not with ninja and msys ccache on msys2
if(NOT (WIN32 AND (NOT $ENV{MSYSTEM} STREQUAL "") AND CMAKE_GENERATOR STREQUAL Ninja))
if(NOT CMAKE_CXX_COMPILER_LAUNCHER AND NOT CMAKE_C_COMPILER_LAUNCHER)
find_program(CCACHE_FOUND ccache)
if(CCACHE_FOUND)
set_property(GLOBAL PROPERTY RULE_LAUNCH_COMPILE ccache)
set_property(GLOBAL PROPERTY RULE_LAUNCH_LINK ccache)
endif(CCACHE_FOUND)
endif()
endif()
if(NOT CMAKE_SYSTEM_PROCESSOR)