build: enable ccache for MSVC
ccache supports MSVC now, so don't disable it for MSVC builds. Remove the global RULE_LAUNCH_COMPILE property because it breaks resource compilation on MSVC and just use CMAKE_CXX_COMPILER_LAUNCHER etc.. Signed-off-by: Rafael Kitover <rkitover@gmail.com>
This commit is contained in:
parent
72d772189a
commit
3e224bab40
|
@ -59,12 +59,11 @@ endif()
|
||||||
# Use ccache if available and not already enabled on the command line.
|
# Use ccache if available and not already enabled on the command line.
|
||||||
# This has to be done before the project() call.
|
# This has to be done before the project() call.
|
||||||
|
|
||||||
if(NOT (VCPKG_TARGET_TRIPLET OR CMAKE_CXX_COMPILER_LAUNCHER OR CMAKE_CXX_COMPILER MATCHES ccache))
|
if(NOT CMAKE_CXX_COMPILER_LAUNCHER)
|
||||||
find_program(CCACHE_EXECUTABLE ccache)
|
find_program(CCACHE_EXECUTABLE ccache)
|
||||||
if(CCACHE_EXECUTABLE)
|
if(CCACHE_EXECUTABLE)
|
||||||
message(STATUS "Enabling ccache")
|
message(STATUS "Enabling ccache")
|
||||||
|
|
||||||
set_property(GLOBAL PROPERTY RULE_LAUNCH_COMPILE ${CCACHE_EXECUTABLE})
|
|
||||||
set(CMAKE_C_COMPILER_LAUNCHER ${CCACHE_EXECUTABLE} CACHE STRING "C compiler launcher" FORCE)
|
set(CMAKE_C_COMPILER_LAUNCHER ${CCACHE_EXECUTABLE} CACHE STRING "C compiler launcher" FORCE)
|
||||||
set(CMAKE_CXX_COMPILER_LAUNCHER ${CCACHE_EXECUTABLE} CACHE STRING "C++ compiler launcher" FORCE)
|
set(CMAKE_CXX_COMPILER_LAUNCHER ${CCACHE_EXECUTABLE} CACHE STRING "C++ compiler launcher" FORCE)
|
||||||
set(CMAKE_ASM_NASM_COMPILER_LAUNCHER ${CCACHE_EXECUTABLE} CACHE STRING "nasm assembler launcher" FORCE)
|
set(CMAKE_ASM_NASM_COMPILER_LAUNCHER ${CCACHE_EXECUTABLE} CACHE STRING "nasm assembler launcher" FORCE)
|
||||||
|
|
Loading…
Reference in New Issue