Merge pull request #4508 from h3xx/fix-ccache-support

Fix ccache support
This commit is contained in:
Bernhard Miklautz 2018-03-22 17:03:52 +01:00 committed by GitHub
commit 1adbc389a6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 11 additions and 2 deletions

View File

@ -125,8 +125,17 @@ endif(CMAKE_CROSSCOMPILING)
find_program(CCACHE ccache) find_program(CCACHE ccache)
if(CCACHE AND WITH_CCACHE) if(CCACHE AND WITH_CCACHE)
set_property(GLOBAL PROPERTY RULE_LAUNCH_COMPILE ${CCACHE}) if(CMAKE_VERSION VERSION_GREATER 3.3.2)
set_property(GLOBAL PROPERTY RULE_LAUNCH_LINK ${CCACHE}) if(NOT DEFINED CMAKE_C_COMPILER_LAUNCHER)
SET(CMAKE_C_COMPILER_LAUNCHER ${CCACHE})
endif(NOT DEFINED CMAKE_C_COMPILER_LAUNCHER)
if(NOT DEFINED CMAKE_CXX_COMPILER_LAUNCHER)
SET(CMAKE_CXX_COMPILER_LAUNCHER ${CCACHE})
endif(NOT DEFINED CMAKE_CXX_COMPILER_LAUNCHER)
else()
set_property(GLOBAL PROPERTY RULE_LAUNCH_COMPILE ${CCACHE})
set_property(GLOBAL PROPERTY RULE_LAUNCH_LINK ${CCACHE})
endif()
endif(CCACHE AND WITH_CCACHE) endif(CCACHE AND WITH_CCACHE)
if(EXISTS "${CMAKE_SOURCE_DIR}/.source_version" ) if(EXISTS "${CMAKE_SOURCE_DIR}/.source_version" )