1set(LLVM_LINK_COMPONENTS 2 ${LLVM_TARGETS_TO_BUILD} 3 Core 4 Object 5 Support 6 ) 7 8add_llvm_tool(llvm-ar 9 llvm-ar.cpp 10 ) 11 12if(UNIX) 13 set(LLVM_LINK_OR_COPY create_symlink) 14 set(llvm_ar_binary "llvm-ar${CMAKE_EXECUTABLE_SUFFIX}") 15else() 16 set(LLVM_LINK_OR_COPY copy) 17 set(llvm_ar_binary "${LLVM_RUNTIME_OUTPUT_INTDIR}/llvm-ar${CMAKE_EXECUTABLE_SUFFIX}") 18endif() 19 20set(llvm_ranlib "${LLVM_RUNTIME_OUTPUT_INTDIR}/llvm-ranlib${CMAKE_EXECUTABLE_SUFFIX}") 21 22add_custom_command(OUTPUT ${llvm_ranlib} 23 COMMAND ${CMAKE_COMMAND} -E ${LLVM_LINK_OR_COPY} "${llvm_ar_binary}" "${llvm_ranlib}" 24 DEPENDS llvm-ar) 25 26add_custom_target(llvm-ranlib ALL DEPENDS ${llvm_ranlib}) 27set_target_properties(llvm-ranlib PROPERTIES FOLDER Tools) 28 29install(SCRIPT install_symlink.cmake -DCMAKE_INSTALL_PREFIX=\"${CMAKE_INSTALL_PREFIX}\") 30