Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
build-llvm: Remove the --symlink-projects option
This option was mostly relevant for making it possible to share ccache between builds in different directories, due to specific logic in CMake's Ninja generator, which used relative paths for sources as long as they were below the main source directory (llvm-project/llvm). This option wasn't usable on Windows. Since CMake 3.21.0, this option no longer worked for the intended purpose - that version of CMake changed the Ninja generator to always use absolute paths to sources, for consistency with other generators and to simplify things. (See commit c564a3e3fff52ef811291c5ba8fb07a5a1b47f97 in CMake's git history.) It is still possible to achieve ccache sharing across build directories anyway, by setting the ccache option CCACHE_BASEDIR, which makes ccache rewrite absolute paths to relative ones within that tree, and by setting the LLVM CMake option LLVM_USE_RELATIVE_PATHS_IN_FILES=ON, which adds -ffile-prefix-map options to the compiler, to remap source paths as they are exposed in the generated code. (Strictly speaking, LLVM_USE_RELATIVE_PATHS_IN_FILES is only needed if debug info is enabled. On its own, without CCACHE_BASEDIR, that option produces compiler output that is identical across build directories - but the absolute paths end up in the preprocessor output in source file/line comments, which makes ccache fail to reuse the cache.)
- Loading branch information