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 f64a31c commit 566cb01
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
${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 566cb01

Please sign in to comment.