1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2025-01-31 20:51:52 +01:00

Make llvm-ar a real build target and install it.

llvm-svn: 223309
This commit is contained in:
Rafael Espindola 2014-12-03 23:17:24 +00:00
parent d632e02f75
commit f6eab70376

View File

@ -9,22 +9,17 @@ add_llvm_tool(llvm-ar
llvm-ar.cpp llvm-ar.cpp
) )
# FIXME: this is duplicated from the clang CMakeLists.txt
# FIXME: bin/llvm-ranlib is not a valid build target with this setup (pr17024)
if(UNIX) if(UNIX)
set(LLVM_LINK_OR_COPY create_symlink) set(LLVM_LINK_OR_COPY create_symlink)
set(llvm_ar_binary "llvm-ar${CMAKE_EXECUTABLE_SUFFIX}")
else() else()
set(LLVM_LINK_OR_COPY copy) set(LLVM_LINK_OR_COPY copy)
set(llvm_ar_binary "${LLVM_RUNTIME_OUTPUT_INTDIR}/llvm-ar${CMAKE_EXECUTABLE_SUFFIX}")
endif() endif()
set(llvm_ar_binary "llvm-ar${CMAKE_EXECUTABLE_SUFFIX}")
set(llvm_ranlib "${LLVM_RUNTIME_OUTPUT_INTDIR}/llvm-ranlib${CMAKE_EXECUTABLE_SUFFIX}") set(llvm_ranlib "${LLVM_RUNTIME_OUTPUT_INTDIR}/llvm-ranlib${CMAKE_EXECUTABLE_SUFFIX}")
add_custom_command(TARGET llvm-ar POST_BUILD
COMMAND ${CMAKE_COMMAND} -E ${LLVM_LINK_OR_COPY} "${llvm_ar_binary}" "${llvm_ranlib}")
set_property(DIRECTORY APPEND add_custom_command(OUTPUT ${llvm_ranlib}
PROPERTY ADDITIONAL_MAKE_CLEAN_FILES ${llvm_ranlib}) COMMAND ${CMAKE_COMMAND} -E ${LLVM_LINK_OR_COPY} "${llvm_ar_binary}" "${llvm_ranlib}")
# TODO: Support check-local. add_custom_target(llvm_ranlib_build ALL DEPENDS ${llvm_ranlib})
install(FILES "${llvm_ranlib}" DESTINATION bin)