This was previously only done if preprocessor was run.
cc_log("Base dir not set, skip using relative paths");
return; // nothing to do
}
- if (!has_absolute_include_headers) {
+ if (!has_absolute_include_headers && !conf->depend_mode) {
cc_log("No absolute path for included files found, skip using relative"
" paths");
return; // nothing to do
expect_stat 'cache miss' 1
expect_stat 'files in cache' 3
+ # -------------------------------------------------------------------------
+ TEST "Dependency file paths converted to relative if CCACHE_BASEDIR specified"
+
+ CCACHE_DEPEND=1 CCACHE_BASEDIR="`pwd`" $CCACHE_COMPILE $DEPSFLAGS_CCACHE -c "`pwd`/test.c"
+ if grep -q "[^.]/test.c" "test.d"; then
+ test_failed "Dependency file does not contain relative path to test.c"
+ fi
+
# -------------------------------------------------------------------------
TEST "stderr from both preprocessor and compiler"