mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-22 10:42:39 +01:00
f1dff186b8
//-E create_symlink// is available on windows since CMake 3.13 (LLVM now uses 3.13.4) It may needs administrator privileges or enabled developer mode (Windows 10) See https://cmake.org/cmake/help/latest/release/3.13.html Reviewed By: kbobyrev Differential Revision: https://reviews.llvm.org/D99170
21 lines
651 B
CMake
21 lines
651 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)
|
|
set(DESTDIR $ENV{DESTDIR})
|
|
set(bindir "${DESTDIR}${CMAKE_INSTALL_PREFIX}/${outdir}/")
|
|
|
|
message(STATUS "Creating ${name}")
|
|
|
|
execute_process(
|
|
COMMAND "${CMAKE_COMMAND}" -E create_symlink "${target}" "${name}"
|
|
WORKING_DIRECTORY "${bindir}" ERROR_VARIABLE has_err)
|
|
if(CMAKE_HOST_WIN32 AND has_err)
|
|
execute_process(
|
|
COMMAND "${CMAKE_COMMAND}" -E copy "${target}" "${name}"
|
|
WORKING_DIRECTORY "${bindir}")
|
|
endif()
|
|
|
|
endfunction()
|