2013-12-10 19:13:32 +08:00
|
|
|
set(LLVM_LINK_COMPONENTS
|
2014-07-04 03:40:08 +08:00
|
|
|
${LLVM_TARGETS_TO_BUILD}
|
2014-07-14 13:01:53 +08:00
|
|
|
Core
|
2015-06-10 05:50:22 +08:00
|
|
|
LibDriver
|
2013-12-10 19:13:32 +08:00
|
|
|
Object
|
|
|
|
Support
|
|
|
|
)
|
2008-09-22 09:08:49 +08:00
|
|
|
|
|
|
|
add_llvm_tool(llvm-ar
|
|
|
|
llvm-ar.cpp
|
|
|
|
)
|
|
|
|
|
2013-08-29 00:22:16 +08:00
|
|
|
if(UNIX)
|
|
|
|
set(LLVM_LINK_OR_COPY create_symlink)
|
2014-12-04 08:23:58 +08:00
|
|
|
set(llvm_ar_binary "llvm-ar${CMAKE_EXECUTABLE_SUFFIX}")
|
2013-08-29 00:22:16 +08:00
|
|
|
else()
|
|
|
|
set(LLVM_LINK_OR_COPY copy)
|
2014-12-04 08:23:58 +08:00
|
|
|
set(llvm_ar_binary "${LLVM_RUNTIME_OUTPUT_INTDIR}/llvm-ar${CMAKE_EXECUTABLE_SUFFIX}")
|
2013-08-29 00:22:16 +08:00
|
|
|
endif()
|
|
|
|
|
2013-12-17 00:03:08 +08:00
|
|
|
set(llvm_ranlib "${LLVM_RUNTIME_OUTPUT_INTDIR}/llvm-ranlib${CMAKE_EXECUTABLE_SUFFIX}")
|
2013-08-29 00:22:16 +08:00
|
|
|
|
2014-12-04 07:17:24 +08:00
|
|
|
add_custom_command(OUTPUT ${llvm_ranlib}
|
2014-12-04 08:00:36 +08:00
|
|
|
COMMAND ${CMAKE_COMMAND} -E ${LLVM_LINK_OR_COPY} "${llvm_ar_binary}" "${llvm_ranlib}"
|
|
|
|
DEPENDS llvm-ar)
|
2013-08-29 00:22:16 +08:00
|
|
|
|
2014-12-04 09:34:11 +08:00
|
|
|
add_custom_target(llvm-ranlib ALL DEPENDS ${llvm_ranlib})
|
2015-01-07 22:19:15 +08:00
|
|
|
set_target_properties(llvm-ranlib PROPERTIES FOLDER Tools)
|
|
|
|
|
2015-06-10 05:50:22 +08:00
|
|
|
set(llvm_lib "${LLVM_RUNTIME_OUTPUT_INTDIR}/llvm-lib${CMAKE_EXECUTABLE_SUFFIX}")
|
|
|
|
|
|
|
|
add_custom_command(OUTPUT ${llvm_lib}
|
|
|
|
COMMAND ${CMAKE_COMMAND} -E ${LLVM_LINK_OR_COPY} "${llvm_ar_binary}" "${llvm_lib}"
|
|
|
|
DEPENDS llvm-ar)
|
|
|
|
|
|
|
|
add_custom_target(llvm-lib ALL DEPENDS ${llvm_lib})
|
|
|
|
set_target_properties(llvm-lib PROPERTIES FOLDER Tools)
|
|
|
|
|
2014-12-08 21:43:38 +08:00
|
|
|
install(SCRIPT install_symlink.cmake -DCMAKE_INSTALL_PREFIX=\"${CMAKE_INSTALL_PREFIX}\")
|