[llvm][cmake] Make `llvm_install_symlink` robust to absolute dirs.
authorJohn Ericson <John.Ericson@Obsidian.Systems>
Thu, 20 Jan 2022 22:20:24 +0000 (22:20 +0000)
committerJohn Ericson <John.Ericson@Obsidian.Systems>
Fri, 21 Jan 2022 02:10:50 +0000 (02:10 +0000)
commit58580e922a69d94859a2506c3053d8c066a1e38c
tree2ad37623d3d5cb883929615ef77baf2baef5692a
parent26feef084616a18e9b61acb9c78dfca40f4c6f97
[llvm][cmake] Make `llvm_install_symlink` robust to absolute dirs.

If `CMAKE_INSTALL_BINDIR` is a different absolute path per project, as
it is with NixOS when we install every package to its own prefix, the
old way fails when the absolute path gets prepended.

There are still some issues with dowstream packages using `LLVM_TOOLS_INSTALL_DIR` which also may be absolute and just for LLVM proper, but that will be addressed in a future commit.

Differential Revision: https://reviews.llvm.org/D101070
llvm/cmake/modules/LLVMInstallSymlink.cmake