[compiler-rt] r202356 - [CMake] Make sure add_compiler_rt_resource_file doesn't do unnecessary work

Alexey Samsonov samsonov at google.com
Wed Feb 26 23:22:59 PST 2014


Author: samsonov
Date: Thu Feb 27 01:22:59 2014
New Revision: 202356

URL: http://llvm.org/viewvc/llvm-project?rev=202356&view=rev
Log:
[CMake] Make sure add_compiler_rt_resource_file doesn't do unnecessary work

Modified:
    compiler-rt/trunk/cmake/Modules/AddCompilerRT.cmake

Modified: compiler-rt/trunk/cmake/Modules/AddCompilerRT.cmake
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/cmake/Modules/AddCompilerRT.cmake?rev=202356&r1=202355&r2=202356&view=diff
==============================================================================
--- compiler-rt/trunk/cmake/Modules/AddCompilerRT.cmake (original)
+++ compiler-rt/trunk/cmake/Modules/AddCompilerRT.cmake Thu Feb 27 01:22:59 2014
@@ -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()





More information about the llvm-commits mailing list