1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-26 12:43:36 +01:00
llvm-mirror/cmake/modules/LLVMInstallSymlink.cmake
Kirill Bobyrev f1dff186b8 [CMake] try creating symlink first on windows
//-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
2021-04-07 11:23:10 +02:00

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()