build: Add optional ccache support to cmake

This commit is contained in:
Cody Northrop 2017-10-31 17:05:03 -06:00
parent 38935954d7
commit f0e54d2655
2 changed files with 11 additions and 0 deletions

View File

@ -40,6 +40,8 @@ cd dbuild
make
```
If your build system supports ccache, you can enable that via cmake option `-DUSE_CCACHE=On`
If you have installed a Vulkan driver obtained from your graphics hardware vendor, the install process should
have configured the driver so that the Vulkan loader can find and load it.

View File

@ -15,6 +15,15 @@ string(TOLOWER ${API_NAME} API_LOWERCASE)
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
find_package(PythonInterp 3 REQUIRED)
option(USE_CCACHE "Use ccache" OFF)
if (USE_CCACHE)
find_program(CCACHE_FOUND ccache)
if(CCACHE_FOUND)
set_property(GLOBAL PROPERTY RULE_LAUNCH_COMPILE ccache)
set_property(GLOBAL PROPERTY RULE_LAUNCH_LINK ccache)
endif(CCACHE_FOUND)
endif()
if(CMAKE_SYSTEM_NAME STREQUAL "Linux")
set(FALLBACK_CONFIG_DIRS "/etc/xdg" CACHE STRING
"Search path to use when XDG_CONFIG_DIRS is unset or empty or the current process is SUID/SGID. Default is freedesktop compliant.")