setup CCACHE_BASEDIR

This is to help in better ccache utilization while building the same
code but located in different folders.

Signed-off-by: Artur Harasimiuk <artur.harasimiuk@intel.com>
This commit is contained in:
Artur Harasimiuk
2022-02-01 20:29:15 +00:00
committed by Compute-Runtime-Automation
parent 4d953fd125
commit 36f8f67f20
2 changed files with 15 additions and 3 deletions

View File

@@ -461,8 +461,20 @@ option(CCACHE_ALLOWED "allow use of ccache" TRUE)
find_program(CCACHE_EXE_FOUND ccache)
if(CCACHE_EXE_FOUND AND CCACHE_ALLOWED)
message(STATUS "Found ccache: ${CCACHE_EXE_FOUND}")
set_property(GLOBAL PROPERTY RULE_LAUNCH_COMPILE ccache)
set_property(GLOBAL PROPERTY RULE_LAUNCH_LINK ccache)
if(NOT NEO_DONT_SET_CCACHE_BASEDIR AND NOT DEFINED ENV{CCACHE_BASEDIR})
get_filename_component(__tmp_dir "../infra" ABSOLUTE)
if(IS_DIRECTORY ${__tmp_dir})
get_filename_component(NEO_CCACHE_BASEDIR ".." ABSOLUTE)
list(APPEND NEO_RULE_LAUNCH_LIST "CCACHE_BASEDIR=${NEO_CCACHE_BASEDIR}")
endif()
endif()
list(APPEND NEO_RULE_LAUNCH_LIST "ccache")
string(REPLACE ";" " " NEO_RULE_LAUNCH_STR "${NEO_RULE_LAUNCH_LIST}")
message(STATUS "Using rule: ${NEO_RULE_LAUNCH_STR}")
set_property(GLOBAL PROPERTY RULE_LAUNCH_COMPILE ${NEO_RULE_LAUNCH_STR})
set_property(GLOBAL PROPERTY RULE_LAUNCH_LINK ${NEO_RULE_LAUNCH_STR})
endif()
# Miscs options

View File

@@ -20,7 +20,7 @@ components:
infra:
branch: master
dest_dir: infra
revision: 11aaa1edfccd2ddb7918a70b75d1a202aaf05e8c
revision: 10e6b6d86e073c56034712770b16160f8957b18f
type: git
internal:
branch: master