Skip to content

Commit fc13a3a

Browse files
committed
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.
1 parent 9633e75 commit fc13a3a

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

build-llvm.sh

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -240,6 +240,13 @@ fi
240240
if [ -n "$COMPILER_LAUNCHER" ]; then
241241
CMAKEFLAGS="$CMAKEFLAGS -DCMAKE_C_COMPILER_LAUNCHER=$COMPILER_LAUNCHER"
242242
CMAKEFLAGS="$CMAKEFLAGS -DCMAKE_CXX_COMPILER_LAUNCHER=$COMPILER_LAUNCHER"
243+
# Make the LLVM build system set options for forcing relative paths
244+
# within the files, e.g. for source file references within assert
245+
# messages. This on its own isn't enough for making the cache reusable
246+
# across different worktrees though; one also needs to set the ccache
247+
# base_dir (CCACHE_BASEDIR) option. When setting that ccache option, this
248+
# option here doesn't really have any effect either, except for debug info.
249+
CMAKEFLAGS="$CMAKEFLAGS -DLLVM_USE_RELATIVE_PATHS_IN_FILES=ON"
243250
fi
244251

245252
if [ -n "$LTO" ]; then

0 commit comments

Comments
 (0)