[CMake] Make sure add_compiler_rt_resource_file doesn't do unnecessary work

llvm-svn: 202356
This commit is contained in:
Alexey Samsonov 2014-02-27 07:22:59 +00:00
parent 8c4c09786a
commit 4cced3e19b
1 changed files with 4 additions and 2 deletions

View File

@ -138,9 +138,11 @@ endmacro()
macro(add_compiler_rt_resource_file target_name file_name)
set(src_file "${CMAKE_CURRENT_SOURCE_DIR}/${file_name}")
set(dst_file "${COMPILER_RT_OUTPUT_DIR}/${file_name}")
add_custom_target(${target_name}
add_custom_command(OUTPUT ${dst_file}
DEPENDS ${src_file}
COMMAND ${CMAKE_COMMAND} -E copy_if_different ${src_file} ${dst_file}
DEPENDS ${file_name})
COMMENT "Copying ${file_name}...")
add_custom_target(${target_name} DEPENDS ${dst_file})
# Install in Clang resource directory.
install(FILES ${file_name} DESTINATION ${COMPILER_RT_INSTALL_PATH})
endmacro()