From ca21cedb849e1b6a0071f62bb7139ea7ebbda6d0 Mon Sep 17 00:00:00 2001 From: Ander Conselvan de Oliveira Date: Wed, 31 Oct 2018 14:21:08 +0200 Subject: [build] Use clcache in appveyor build clcache is a cache for compiled C and C++ objects similar to ccache but compatible with Microsoft compilers. Using it should result in faster builds. --- CMakeLists.txt | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'CMakeLists.txt') diff --git a/CMakeLists.txt b/CMakeLists.txt index 91b0aa5c1c..a48e2c2b01 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -137,6 +137,14 @@ if(CCACHE_PROGRAM) # Clang also thinks that ccache isn't interactive, so we explicitly need to enable color. set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Qunused-arguments -fcolor-diagnostics") endif() +elseif(WIN32) + find_program(CLCACHE_PROGRAM clcache) + if(CLCACHE_PROGRAM) + # clcache doesn't work with external pdb files + # https://github.com/frerich/clcache/issues/30 + string(REPLACE "/Zi" "/Z7" CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG}") + string(REPLACE "/Zi" "/Z7" CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO}") + endif() else() message(STATUS "Can't find ccache — consider installing ccache to improve recompilation performance") endif() -- cgit v1.2.1