[llvm-objcopy] [COFF] Avoid memcpy() with null parameters in more places. NFC.
[llvm-complete.git] / cmake / modules / LLVMInstallSymlink.cmake
blob1a04de931ff7e04f0aae00cfa952d739c09b4467
1 # We need to execute this script at installation time because the
2 # DESTDIR environment variable may be unset at configuration time.
3 # See PR8397.
5 function(install_symlink name target outdir)
6   if(CMAKE_HOST_UNIX)
7     set(LINK_OR_COPY create_symlink)
8     set(DESTDIR $ENV{DESTDIR})
9   else()
10     set(LINK_OR_COPY copy)
11   endif()
13   set(bindir "${DESTDIR}${CMAKE_INSTALL_PREFIX}/${outdir}/")
15   message("Creating ${name}")
17   execute_process(
18     COMMAND "${CMAKE_COMMAND}" -E ${LINK_OR_COPY} "${target}" "${name}"
19     WORKING_DIRECTORY "${bindir}")
21 endfunction()