summaryrefslogtreecommitdiffstats
path: root/CMakeModules/MSVCCache.cmake
diff options
context:
space:
mode:
Diffstat (limited to 'CMakeModules/MSVCCache.cmake')
-rw-r--r--CMakeModules/MSVCCache.cmake15
1 files changed, 15 insertions, 0 deletions
diff --git a/CMakeModules/MSVCCache.cmake b/CMakeModules/MSVCCache.cmake
new file mode 100644
index 000000000..ba0d22d9e
--- /dev/null
+++ b/CMakeModules/MSVCCache.cmake
@@ -0,0 +1,15 @@
+# SPDX-FileCopyrightText: 2022 yuzu Emulator Project
+# SPDX-License-Identifier: GPL-3.0-or-later
+
+# buildcache wrapper
+OPTION(USE_CCACHE "Use buildcache for compilation" OFF)
+IF(USE_CCACHE)
+ FIND_PROGRAM(CCACHE buildcache)
+ IF (CCACHE)
+ MESSAGE(STATUS "Using buildcache found in PATH")
+ SET_PROPERTY(GLOBAL PROPERTY RULE_LAUNCH_COMPILE ${CCACHE})
+ SET_PROPERTY(GLOBAL PROPERTY RULE_LAUNCH_LINK ${CCACHE})
+ ELSE(CCACHE)
+ MESSAGE(WARNING "USE_CCACHE enabled, but no buildcache executable found")
+ ENDIF(CCACHE)
+ENDIF(USE_CCACHE)