aboutsummaryrefslogtreecommitdiff
path: root/CMakeModules/MSVCCache.cmake
diff options
context:
space:
mode:
authorMorph <39850852+Morph1984@users.noreply.github.com>2022-07-05 20:30:38 -0400
committerGitHub <noreply@github.com>2022-07-05 20:30:38 -0400
commit770611fdf39f274ee9ccde9875e86cfeb79a3f6f (patch)
treea580077f3b8f5ebbba6ee58ba594192f68ebdeea /CMakeModules/MSVCCache.cmake
parent07e3c56f0de7a1567b1ae443abb64b767a31ed8c (diff)
parent1524ff87d26e95f3fa722ca23eb30895e9b6f793 (diff)
Merge pull request #8486 from liushuyu/github-actions-verify
CI: Use GitHub Actions to validate pull requests
Diffstat (limited to 'CMakeModules/MSVCCache.cmake')
-rw-r--r--CMakeModules/MSVCCache.cmake12
1 files changed, 12 insertions, 0 deletions
diff --git a/CMakeModules/MSVCCache.cmake b/CMakeModules/MSVCCache.cmake
new file mode 100644
index 000000000..8848e35ea
--- /dev/null
+++ b/CMakeModules/MSVCCache.cmake
@@ -0,0 +1,12 @@
+# 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)