1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-08-13 19:54:17 +02:00

ENABLE_CCACHE option is available for all platforms

This commit is contained in:
Joakim Thorén
2023-12-27 21:10:56 +01:00
parent bb6179d05e
commit 7b02750034

View File

@@ -79,10 +79,19 @@ if(NOT APPLE_IOS AND NOT ANDROID)
option(ENABLE_MONOLITHIC_INSTALL "Install everything in single directory on Linux and Mac" OFF)
endif()
# On Linux, use -DCMAKE_CXX_COMPILER_LAUNCHER=ccache instead.
# The XCode and MSVC builds each require some more configuration, which is enabled by the following option:
if(MSVC OR (CMAKE_GENERATOR STREQUAL "Xcode"))
option(ENABLE_CCACHE "Speed up recompilation by caching previous compilations" OFF)
if(ENABLE_CCACHE)
find_program(CCACHE ccache)
if(CCACHE-NOTFOUND)
message(FATAL_ERROR "'ccache' could not be found; install it or set ENABLE_CCACHE=OFF.")
endif()
endif()
# On Linux, use ccache via CMAKE_CXX_COMPILER_LAUNCHER.
# The XCode and MSVC builds each require some more configuration further down.
if(ENABLE_CCACHE AND LINUX)
set(CMAKE_C_COMPILER_LAUNCHER "ccache")
set(CMAKE_CXX_COMPILER_LAUNCHER "ccache")
endif()
if(ENABLE_CCACHE AND (CMAKE_GENERATOR STREQUAL "Xcode"))