From e3179ea2f5d7814688d4fb0f3ede899fb28fa225 Mon Sep 17 00:00:00 2001 From: Tao Luo Date: Sun, 26 Apr 2020 21:19:39 +0800 Subject: [PATCH] refine ccache statistics show (#24167) test=develop --- cmake/ccache.cmake | 5 +++++ paddle/scripts/paddle_build.sh | 2 -- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/cmake/ccache.cmake b/cmake/ccache.cmake index 900f59d4cb8..64f4f6c2a1c 100644 --- a/cmake/ccache.cmake +++ b/cmake/ccache.cmake @@ -3,7 +3,12 @@ find_program(CCACHE_PATH ccache) if(CCACHE_PATH) + 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}) message(STATUS "Ccache is founded, use ccache to speed up compile.") + # show statistics summary of ccache + message("ccache version\t\t\t " ${ccache_version} "\n" ${cache_directory}) set_property(GLOBAL PROPERTY RULE_LAUNCH_COMPILE ${CCACHE_PATH}) set_property(GLOBAL PROPERTY RULE_LAUNCH_LINK ${CCACHE_PATH}) endif(CCACHE_PATH) diff --git a/paddle/scripts/paddle_build.sh b/paddle/scripts/paddle_build.sh index 2301a595223..0c09ba88727 100755 --- a/paddle/scripts/paddle_build.sh +++ b/paddle/scripts/paddle_build.sh @@ -253,8 +253,6 @@ EOF function cmake_gen() { mkdir -p ${PADDLE_ROOT}/build cd ${PADDLE_ROOT}/build - # show statistics summary of ccache - ccache -s cache directory cmake_base $1 } -- GitLab