8315060: Out of tree incremental build fails with ccache

Reviewed-by: kbarrett, dholmes
This commit is contained in:
Erik Joelsson 2023-08-28 20:56:31 +00:00
parent 8e2a533df6
commit 69d1feb83f
2 changed files with 9 additions and 3 deletions

View File

@ -243,8 +243,11 @@ AC_DEFUN([BPERF_SETUP_CCACHE_USAGE],
fi
fi
# The CCACHE_BASEDIR needs to end with '/' as ccache will otherwise think
# directories next to it, that have the base dir name as a prefix, are sub
# directories of CCACHE_BASEDIR.
CCACHE="CCACHE_COMPRESS=1 $SET_CCACHE_DIR \
CCACHE_SLOPPINESS=$CCACHE_SLOPPINESS CCACHE_BASEDIR=$TOPDIR $CCACHE"
CCACHE_SLOPPINESS=$CCACHE_SLOPPINESS CCACHE_BASEDIR=$WORKSPACE_ROOT/ $CCACHE"
if test "x$SET_CCACHE_DIR" != x; then
mkdir -p $CCACHE_DIR > /dev/null 2>&1

View File

@ -224,9 +224,12 @@ endif
# object files while CCACHE_BASEDIR will make ccache relativize all paths for
# its compiler. The compiler then produces relative dependency files.
# make does not know a relative and absolute filename is the same so it will
# ignore such dependencies.
# ignore such dependencies. This only applies when the OUTPUTDIR is inside
# the WORKSPACE_ROOT.
ifneq ($(CCACHE), )
REWRITE_PATHS_RELATIVE = true
ifneq ($(filter $(WORKSPACE_ROOT)/%, $(OUTPUTDIR)), )
REWRITE_PATHS_RELATIVE = true
endif
endif
ifeq ($(REWRITE_PATHS_RELATIVE), true)