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/CMakeLists.txt
Rafael Espindola 1972f7d7c5 Add support for inline asm symbols in llvm-ar.
This should allow llvm-ar to be used instead of gnu ar + plugin in a LTO
build. I will add a release note about it once I finish a LTO bootstrap with it.

llvm-svn: 212287
2014-07-03 19:40:08 +00:00

30 lines
835 B
CMake

set(LLVM_LINK_COMPONENTS
${LLVM_TARGETS_TO_BUILD}
Object
Support
)
add_llvm_tool(llvm-ar
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)
set(LLVM_LINK_OR_COPY create_symlink)
set(llvm_ar_binary "llvm-ar${CMAKE_EXECUTABLE_SUFFIX}")
else()
set(LLVM_LINK_OR_COPY copy)
set(llvm_ar_binary "${LLVM_RUNTIME_OUTPUT_INTDIR}/llvm-ar${CMAKE_EXECUTABLE_SUFFIX}")
endif()
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
PROPERTY ADDITIONAL_MAKE_CLEAN_FILES ${llvm_ranlib})
# TODO: Support check-local.