Merge pull request #1669 from AlvinMooreSr/cmake-ccache

Enable ccache by Environmental Variable
This commit is contained in:
Alvin Moore 2019-06-06 12:50:02 -07:00 committed by GitHub
commit 3fcf491b00
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 7 additions and 1 deletions

View File

@ -45,7 +45,13 @@ else()
add_definitions(-DUSE_UCONTEXT)
endif()
if(USE_CCACHE)
if ((NOT USE_CCACHE) AND (NOT "$ENV{USE_CCACHE}" STREQUAL ""))
string(TOUPPER "$ENV{USE_CCACHE}" USE_CCACHEENV)
if (("${USE_CCACHEENV}" STREQUAL "ON") OR ("${USE_CCACHEENV}" STREQUAL "1") OR ("${USE_CCACHEENV}" STREQUAL "YES"))
set(USE_CCACHE ON)
endif()
endif()
if (USE_CCACHE)
FIND_PROGRAM(CCACHE_FOUND "ccache")
if(CCACHE_FOUND)
set_property(GLOBAL PROPERTY RULE_LAUNCH_COMPILE ccache)