diff --git a/cmake/build/Ccache.cmake b/cmake/build/Ccache.cmake index 473fe7c..f02e102 100644 --- a/cmake/build/Ccache.cmake +++ b/cmake/build/Ccache.cmake @@ -13,8 +13,12 @@ set(USE_CCACHE ON CACHE BOOL "use ccache to speed up compiling.") +message(STATUS "Use Ccache with USE_CCACHE: ${USE_CCACHE} + Ccache Options: + USE_CCACHE: If use ccache to speed up compiling. Default is ON.") + if(NOT USE_CCACHE) - message(STATUS "Disable ccache") + message(STATUS "Disable ccache because of USE_CCACHE is OFF") return() endif() @@ -23,14 +27,14 @@ find_program( NAMES ccache DOC "ccache executable") -if(CCACHE_COMMAND) - message(STATUS "Activate ccache: ${CCACHE_COMMAND}") - set(CMAKE_C_COMPILER_LAUNCHER "${CCACHE_COMMAND}") - set(CMAKE_CXX_COMPILER_LAUNCHER "${CCACHE_COMMAND}") - - # set_property(GLOBAL PROPERTY RULE_LAUNCH_COMPILE ccache) - - # set_property(GLOBAL PROPERTY RULE_LAUNCH_LINK ccache) -else() +if(NOT CCACHE_COMMAND) message(WARNING "Disable ccache because of no ccache installed") + return() endif() + +set(CMAKE_C_COMPILER_LAUNCHER "${CCACHE_COMMAND}") +set(CMAKE_CXX_COMPILER_LAUNCHER "${CCACHE_COMMAND}") + +# set_property(GLOBAL PROPERTY RULE_LAUNCH_COMPILE ccache) + +# set_property(GLOBAL PROPERTY RULE_LAUNCH_LINK ccache)