[PATCH] D115568: [lld][CMake] Use `GNUInstallDirs` to support custom installation dirs

Martin Storsjö via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Dec 31 16:03:11 PST 2021


mstorsjo added inline comments.


================
Comment at: lld/CMakeLists.txt:159
+  "${LLD_SOURCE_DIR}/cmake/modules"
+  "${LLD_SOURCE_DIR}/../cmake/Modules"
+  )
----------------
This broke building in my setups.

In my setups, I still symlink the clang/lld directories into llvm/tools instead of invoking them via `LLVM_ENABLE_PROJECTS`. Thus referring to `${LLD_SOURCE_DIR}/..` ends up at `llvm-project/llvm/tools` instead of at `llvm-project`.

Is there some better cmake variable we could use here for unambiguously referring to the monorepo root?

(As backstory - a condition for me for getting away from building in that legacy setup, would be to be able to build things with the main llvm-project directory as main target directory for the cmake invocation. When pointing cmake at llvm-project/llvm, cmake uses relative paths for all files under the llvm subdir, but uses absolute paths for files under e.g. llvm-project/lld. With those tools symlinked under llvm-project/llvm/tools, it ends up using relative paths for all files. Using relative paths for compiling files is vital for being able to use ccache across different source trees, otherwise all built object files are unique for each source tree, due to e.g. paths in assert messages.)


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D115568/new/

https://reviews.llvm.org/D115568



More information about the llvm-commits mailing list