mirror of
https://github.com/vcmi/vcmi.git
synced 2025-08-15 20:03:15 +02:00
ENABLE_CCACHE option is available for all platforms
This commit is contained in:
@@ -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)
|
option(ENABLE_MONOLITHIC_INSTALL "Install everything in single directory on Linux and Mac" OFF)
|
||||||
endif()
|
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)
|
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()
|
endif()
|
||||||
|
|
||||||
if(ENABLE_CCACHE AND (CMAKE_GENERATOR STREQUAL "Xcode"))
|
if(ENABLE_CCACHE AND (CMAKE_GENERATOR STREQUAL "Xcode"))
|
||||||
|
Reference in New Issue
Block a user