mirror of
https://github.com/RPCS3/llvm.git
synced 2024-12-22 20:20:03 +00:00
26751e1575
In order to resolve PR25059, we're going to need to be able to generate symlinks to libraries manually, so I need this code to be reusable. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@250573 91177308-0d34-0410-b5e6-96231b3b80d8
22 lines
553 B
CMake
22 lines
553 B
CMake
# We need to execute this script at installation time because the
|
|
# DESTDIR environment variable may be unset at configuration time.
|
|
# See PR8397.
|
|
|
|
function(install_symlink name target outdir)
|
|
if(UNIX)
|
|
set(LINK_OR_COPY create_symlink)
|
|
set(DESTDIR $ENV{DESTDIR})
|
|
else()
|
|
set(LINK_OR_COPY copy)
|
|
endif()
|
|
|
|
set(bindir "${DESTDIR}${CMAKE_INSTALL_PREFIX}/${outdir}/")
|
|
|
|
message("Creating ${name}")
|
|
|
|
execute_process(
|
|
COMMAND "${CMAKE_COMMAND}" -E ${LINK_OR_COPY} "${target}" "${name}"
|
|
WORKING_DIRECTORY "${bindir}")
|
|
|
|
endfunction()
|