Skip to content

Commit

Permalink
[llvm][cmake] Make llvm_install_symlink robust to absolute dirs.
Browse files Browse the repository at this point in the history
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
  • Loading branch information
Ericson2314 committed Jan 21, 2022
1 parent 26feef0 commit 58580e9
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion llvm/cmake/modules/LLVMInstallSymlink.cmake
Expand Up @@ -6,7 +6,8 @@ include(GNUInstallDirs)

function(install_symlink name target outdir)
set(DESTDIR $ENV{DESTDIR})
set(bindir "${DESTDIR}${CMAKE_INSTALL_PREFIX}/${outdir}")
GNUInstallDirs_get_absolute_install_dir(bindir "${outdir}" BINDIR)
set(bindir "${DESTDIR}${bindir}")

message(STATUS "Creating ${name}")

Expand Down

0 comments on commit 58580e9

Please sign in to comment.