mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2025-01-31 12:41:49 +01:00
[CMake] Cleaning up and generalizing the LLVMInstallSymlink script so that it can be used for libraries too.
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. llvm-svn: 250573
This commit is contained in:
parent
a51be6eaa4
commit
f6944257e9
@ -1044,8 +1044,11 @@ function(llvm_install_symlink name dest)
|
|||||||
set(component ${name})
|
set(component ${name})
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
set(full_name ${name}${CMAKE_EXECUTABLE_SUFFIX})
|
||||||
|
set(full_dest ${dest}${CMAKE_EXECUTABLE_SUFFIX})
|
||||||
|
|
||||||
install(SCRIPT ${INSTALL_SYMLINK}
|
install(SCRIPT ${INSTALL_SYMLINK}
|
||||||
CODE "install_symlink(${name} ${dest})"
|
CODE "install_symlink(${full_name} ${full_dest} bin)"
|
||||||
COMPONENT ${component})
|
COMPONENT ${component})
|
||||||
|
|
||||||
if (NOT CMAKE_CONFIGURATION_TYPES AND NOT ARG_ALWAYS_GENERATE)
|
if (NOT CMAKE_CONFIGURATION_TYPES AND NOT ARG_ALWAYS_GENERATE)
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
# DESTDIR environment variable may be unset at configuration time.
|
# DESTDIR environment variable may be unset at configuration time.
|
||||||
# See PR8397.
|
# See PR8397.
|
||||||
|
|
||||||
function(install_symlink name target)
|
function(install_symlink name target outdir)
|
||||||
if(UNIX)
|
if(UNIX)
|
||||||
set(LINK_OR_COPY create_symlink)
|
set(LINK_OR_COPY create_symlink)
|
||||||
set(DESTDIR $ENV{DESTDIR})
|
set(DESTDIR $ENV{DESTDIR})
|
||||||
@ -10,19 +10,12 @@ function(install_symlink name target)
|
|||||||
set(LINK_OR_COPY copy)
|
set(LINK_OR_COPY copy)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# CMAKE_EXECUTABLE_SUFFIX is undefined on cmake scripts. See PR9286.
|
set(bindir "${DESTDIR}${CMAKE_INSTALL_PREFIX}/${outdir}/")
|
||||||
if( WIN32 )
|
|
||||||
set(EXECUTABLE_SUFFIX ".exe")
|
|
||||||
else()
|
|
||||||
set(EXECUTABLE_SUFFIX "")
|
|
||||||
endif()
|
|
||||||
|
|
||||||
set(bindir "${DESTDIR}${CMAKE_INSTALL_PREFIX}/bin/")
|
|
||||||
|
|
||||||
message("Creating ${name}")
|
message("Creating ${name}")
|
||||||
|
|
||||||
execute_process(
|
execute_process(
|
||||||
COMMAND "${CMAKE_COMMAND}" -E ${LINK_OR_COPY} "${target}${EXECUTABLE_SUFFIX}" "${name}${EXECUTABLE_SUFFIX}"
|
COMMAND "${CMAKE_COMMAND}" -E ${LINK_OR_COPY} "${target}" "${name}"
|
||||||
WORKING_DIRECTORY "${bindir}")
|
WORKING_DIRECTORY "${bindir}")
|
||||||
|
|
||||||
endfunction()
|
endfunction()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user