1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-23 19:23:23 +01:00
llvm-mirror/tools/llvm-ar/install_symlink.cmake
Peter Collingbourne f713e907c2 LibDriver, llvm-lib: introduce.
llvm-lib is intended to be a lib.exe compatible utility that also
understands bitcode. The implementation lives in a library so that
lld can use it to implement /lib.

Differential Revision: http://reviews.llvm.org/D10297

llvm-svn: 239434
2015-06-09 21:50:22 +00:00

32 lines
858 B
CMake

# We need to execute this script at installation time because the
# DESTDIR environment variable may be unset at configuration time.
# See PR8397.
if(UNIX)
set(LINK_OR_COPY create_symlink)
set(DESTDIR $ENV{DESTDIR})
else()
set(LINK_OR_COPY copy)
endif()
# CMAKE_EXECUTABLE_SUFFIX is undefined on cmake scripts. See PR9286.
if( WIN32 )
set(EXECUTABLE_SUFFIX ".exe")
else()
set(EXECUTABLE_SUFFIX "")
endif()
set(bindir "${DESTDIR}${CMAKE_INSTALL_PREFIX}/bin/")
message("Creating llvm-ranlib")
execute_process(
COMMAND "${CMAKE_COMMAND}" -E ${LINK_OR_COPY} "llvm-ar${EXECUTABLE_SUFFIX}" "llvm-ranlib${EXECUTABLE_SUFFIX}"
WORKING_DIRECTORY "${bindir}")
message("Creating llvm-lib")
execute_process(
COMMAND "${CMAKE_COMMAND}" -E ${LINK_OR_COPY} "llvm-ar${EXECUTABLE_SUFFIX}" "llvm-lib${EXECUTABLE_SUFFIX}"
WORKING_DIRECTORY "${bindir}")