Skip to content

Commit

Permalink
feat: ccache on windows
Browse files Browse the repository at this point in the history
  • Loading branch information
luishfonseca committed Sep 26, 2023
1 parent e8e56a8 commit 401fec2
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,21 @@ find_program(CCACHE_EXE NAMES "ccache")
if(CCACHE_EXE)
option(USE_CCACHE "Enable CCache" ON)
if(USE_CCACHE)
set(CMAKE_CXX_COMPILER_LAUNCHER "${CCACHE_EXE}")
if (CMAKE_HOST_WIN32)
file(COPY_FILE
"C:/ProgramData/chocolatey/lib/ccache/tools/ccache-4.8.3-windows-x86_64/ccache.exe" ${CMAKE_BINARY_DIR}/cl.exe
ONLY_IF_DIFFERENT)

set(CMAKE_VS_GLOBALS
"CLToolExe=cl.exe"
"CLToolPath=${CMAKE_BINARY_DIR}"
"TrackFileAccess=false"
"UseMultiToolTask=true"
"DebugInformationFormat=OldStyle"
)
else ()
set(CMAKE_CXX_COMPILER_LAUNCHER "${CCACHE_EXE}")
endif()
endif()
endif()

Expand Down

0 comments on commit 401fec2

Please sign in to comment.