From 58580e922a69d94859a2506c3053d8c066a1e38c Mon Sep 17 00:00:00 2001 From: John Ericson Date: Thu, 20 Jan 2022 22:20:24 +0000 Subject: [PATCH] [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 | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/llvm/cmake/modules/LLVMInstallSymlink.cmake b/llvm/cmake/modules/LLVMInstallSymlink.cmake index b5c35f7..ef7f5ab 100644 --- a/llvm/cmake/modules/LLVMInstallSymlink.cmake +++ b/llvm/cmake/modules/LLVMInstallSymlink.cmake @@ -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}") -- 2.7.4