Skip to content
Snippets Groups Projects
Verified Commit bf3ca106 authored by Lars Bilke's avatar Lars Bilke
Browse files

[cmake] Added support for ccache on Windows, dropped clcache.

- clache is not developed anymore
- ccache for windows is not yet in the main branch but here:
    https://github.com/cristianadam/ccache/releases
- Ninja and Release only!
parent 770209ab
No related branches found
No related tags found
No related merge requests found
......@@ -71,7 +71,6 @@ include(ConanSetup)
include(CompilerSetup)
include(JobPools)
include(Find)
include(CLCacheSetup)
include(packaging/PackagingDependencies)
include(DependenciesExternalProject)
include(Dependencies)
......
if(NOT WIN32 OR NOT CLCACHE_TOOL_PATH OR OGS_DISABLE_COMPILER_CACHE)
return()
endif()
file(DOWNLOAD
https://gitlab.com/timblechmann/clcache-launcher/uploads/c11842f963af3543b448cb400ed5fce9/clcache-launcher.exe
${PROJECT_BINARY_DIR}/clcache-launcher.exe
)
set(CMAKE_C_COMPILER_LAUNCHER ${PROJECT_BINARY_DIR}/clcache-launcher.exe)
set(CMAKE_CXX_COMPILER_LAUNCHER ${PROJECT_BINARY_DIR}/clcache-launcher.exe)
message(STATUS "clcache enabled! (${CLCACHE_TOOL_PATH})")
set(CMAKE_FOLDER ThirdParty)
# ccache
# ccache, on Windows requires https://github.com/cristianadam/ccache/releases
if(NOT WIN32 AND CCACHE_TOOL_PATH AND NOT OGS_DISABLE_COMPILER_CACHE)
set(CCACHE_OPTIONS "CCACHE_SLOPPINESS=pch_defines,time_macros")
if(${CMAKE_CXX_COMPILER_ID} MATCHES "Clang|AppleClang")
......@@ -12,6 +12,15 @@ if(NOT WIN32 AND CCACHE_TOOL_PATH AND NOT OGS_DISABLE_COMPILER_CACHE)
VERSION 1.2.2
OPTIONS "USE_CCACHE ON"
)
elseif(
WIN32
AND CCACHE_TOOL_PATH
AND NOT OGS_DISABLE_COMPILER_CACHE
AND "${CMAKE_GENERATOR}" STREQUAL "Ninja"
)
set(CMAKE_C_COMPILER_LAUNCHER ${CCACHE_TOOL_PATH} CACHE STRING "" FORCE)
set(CMAKE_CXX_COMPILER_LAUNCHER ${CCACHE_TOOL_PATH} CACHE STRING "" FORCE)
message(STATUS "Using ccache (${CCACHE_TOOL_PATH}).")
endif()
if(OGS_BUILD_TESTING)
......
......@@ -36,13 +36,7 @@ find_program(CURL_TOOL_PATH curl DOC "The curl-tool")
find_program(S3CMD_TOOL_PATH s3cmd DOC "S3cmd tool for uploading to Amazon S3")
if(WIN32)
if(${CMAKE_GENERATOR} STREQUAL "Ninja")
find_program(CLCACHE_TOOL_PATH clcache)
endif()
else()
find_program(CCACHE_TOOL_PATH ccache)
endif()
find_program(CCACHE_TOOL_PATH ccache)
# Tools for web
find_program(
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment