ccache.cmake 665 字节
Newer Older
Z
zhangjinchao01 已提交
1 2
# Use ccache if found ccache program

Y
Yu Yang 已提交
3
find_program(CCACHE_PATH ccache)
Z
zhangjinchao01 已提交
4

Y
Yu Yang 已提交
5
if(CCACHE_PATH)
T
Tao Luo 已提交
6 7 8
    execute_process(COMMAND ccache -V OUTPUT_VARIABLE ccache_output)
    execute_process(COMMAND ccache -s cache directory OUTPUT_VARIABLE cache_directory)
    string(REGEX MATCH "[0-9]+.[0-9]+" ccache_version ${ccache_output})
Z
zhangjinchao01 已提交
9
    message(STATUS "Ccache is founded, use ccache to speed up compile.")
T
Tao Luo 已提交
10 11
    # show statistics summary of ccache
    message("ccache version\t\t\t    " ${ccache_version} "\n" ${cache_directory})
Y
Yu Yang 已提交
12 13 14
    set_property(GLOBAL PROPERTY RULE_LAUNCH_COMPILE ${CCACHE_PATH})
    set_property(GLOBAL PROPERTY RULE_LAUNCH_LINK ${CCACHE_PATH})
endif(CCACHE_PATH)