This commit is contained in:
2026-02-20 19:44:57 +01:00
committed by Romain BOULLARD
parent 7c0f086969
commit 934b44c1f8
16 changed files with 178 additions and 92 deletions

View File

@@ -0,0 +1,19 @@
# https://github.com/ccache/ccache/wiki/MS-Visual-Studio#usage-with-cmake
find_program(ccache_exe ccache)
if(ccache_exe)
file(COPY_FILE
${ccache_exe} ${CMAKE_BINARY_DIR}/cl.exe
ONLY_IF_DIFFERENT)
# By default Visual Studio generators will use /Zi which is not compatible
# with ccache, so tell Visual Studio to use /Z7 instead.
message(STATUS "Setting MSVC debug information format to 'Embedded'")
set(CMAKE_MSVC_DEBUG_INFORMATION_FORMAT "$<$<CONFIG:Debug,RelWithDebInfo>:Embedded>")
set(CMAKE_VS_GLOBALS
"CLToolExe=cl.exe"
"CLToolPath=${CMAKE_BINARY_DIR}"
"UseMultiToolTask=true"
)
endif()