build-llvm: Implicitly set LLVM_USE_RELATIVE_PATHS_IN_FILES when using ccache

This is an option I set outside of this script in a number of
build cases where I build with ccache; move this into the script.

In practice it has little effect though; one has to set
CCACHE_BASEDIR anyway in order to be able to share a ccache
between build directories.

If enabling ccache by adding e.g. /usr/lib/ccache to the front of
PATH, without using the COMPILER_LAUNCHER variable, this won't
get enabled.
This commit is contained in:
Martin Storsjö committed 2025-06-11 16:48:03 +03:00
1 parent 9633e7501c
commit fc13a3a5b1
1 file changed
+7
+7
View File
@@ -240,6 +240,13 @@ fi
if [ -n "$COMPILER_LAUNCHER" ]; then
CMAKEFLAGS="$CMAKEFLAGS -DCMAKE_C_COMPILER_LAUNCHER=$COMPILER_LAUNCHER"
CMAKEFLAGS="$CMAKEFLAGS -DCMAKE_CXX_COMPILER_LAUNCHER=$COMPILER_LAUNCHER"
# Make the LLVM build system set options for forcing relative paths
# within the files, e.g. for source file references within assert
# messages. This on its own isn't enough for making the cache reusable
# across different worktrees though; one also needs to set the ccache
# base_dir (CCACHE_BASEDIR) option. When setting that ccache option, this
# option here doesn't really have any effect either, except for debug info.
CMAKEFLAGS="$CMAKEFLAGS -DLLVM_USE_RELATIVE_PATHS_IN_FILES=ON"
fi
if [ -n "$LTO" ]; then