Add optional support for ccache for MSVC (#9667)

This commit is contained in:
Magne Sjaastad committed 2023-03-16 07:16:11 +01:00
1 parent 5084057462
commit f7ca100dd3
1 file changed
+14
+14
View File
@@ -45,6 +45,20 @@ set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)
# ##############################################################################
# OPTIONAL: Configuration of ccache for MSVC
# ##############################################################################
find_program(ccache_exe ccache)
if(ccache_exe)
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"
)
endif()
# ##############################################################################
# Setup the main platform defines
# ##############################################################################