[PATCH] D101070: [llvm][cmake] Make `install_symlink` robust to absolute dirs.
John Ericson via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Sat Jul 23 21:13:15 PDT 2022
Ericson2314 updated this revision to Diff 447108.
Ericson2314 added a comment.
Rebase to retrigger CI
I think it tried to cherry-pick an already-landed patch.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D101070/new/
https://reviews.llvm.org/D101070
Files:
llvm/cmake/modules/AddLLVM.cmake
llvm/cmake/modules/LLVMInstallSymlink.cmake
Index: llvm/cmake/modules/LLVMInstallSymlink.cmake
===================================================================
--- llvm/cmake/modules/LLVMInstallSymlink.cmake
+++ llvm/cmake/modules/LLVMInstallSymlink.cmake
@@ -2,21 +2,22 @@
# DESTDIR environment variable may be unset at configuration time.
# See PR8397.
-include(GNUInstallDirs)
+include(ExtendPath)
function(install_symlink name target outdir)
set(DESTDIR $ENV{DESTDIR})
- set(bindir "${DESTDIR}${CMAKE_INSTALL_PREFIX}/${outdir}")
+ extend_path(outdir_abs "${CMAKE_INSTALL_PREFIX}" "${outdir}")
+ set(outdir_abs "${DESTDIR}${outdir_abs}")
message(STATUS "Creating ${name}")
execute_process(
COMMAND "${CMAKE_COMMAND}" -E create_symlink "${target}" "${name}"
- WORKING_DIRECTORY "${bindir}" ERROR_VARIABLE has_err)
+ WORKING_DIRECTORY "${outdir_abs}" ERROR_VARIABLE has_err)
if(CMAKE_HOST_WIN32 AND has_err)
execute_process(
COMMAND "${CMAKE_COMMAND}" -E copy "${target}" "${name}"
- WORKING_DIRECTORY "${bindir}")
+ WORKING_DIRECTORY "${outdir_abs}")
endif()
endfunction()
Index: llvm/cmake/modules/AddLLVM.cmake
===================================================================
--- llvm/cmake/modules/AddLLVM.cmake
+++ llvm/cmake/modules/AddLLVM.cmake
@@ -2006,7 +2006,7 @@
set(output_dir lib${LLVM_LIBDIR_SUFFIX})
if(WIN32 AND "${type}" STREQUAL "SHARED")
- set(output_dir bin)
+ set(output_dir "${CMAKE_INSTALL_LIBDIR}")
endif()
install(SCRIPT ${INSTALL_SYMLINK}
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D101070.447108.patch
Type: text/x-patch
Size: 1516 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20220724/302a8865/attachment.bin>
More information about the cfe-commits
mailing list