[Lldb-commits] [lldb] r338058 - Make framework-header-fix process copied headers

Alex Langford via lldb-commits lldb-commits at lists.llvm.org
Thu Jul 26 12:04:46 PDT 2018


Author: xiaobai
Date: Thu Jul 26 12:04:46 2018
New Revision: 338058

URL: http://llvm.org/viewvc/llvm-project?rev=338058&view=rev
Log:
Make framework-header-fix process copied headers

Summary:
Previously the framework-header-fix script would change the sources
before they were copied, leading to unnecessary rebuilds on repeat
`ninja lldb` invocations. This runs the script on the headers after
they're copied into the produced LLDB.framework, meaning it doesn't
affect any files being built.

Patch by Keith Smiley <keithbsmiley at gmail.com>!

Differential Revision: https://reviews.llvm.org/D49779

Modified:
    lldb/trunk/cmake/modules/LLDBFramework.cmake

Modified: lldb/trunk/cmake/modules/LLDBFramework.cmake
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/cmake/modules/LLDBFramework.cmake?rev=338058&r1=338057&r2=338058&view=diff
==============================================================================
--- lldb/trunk/cmake/modules/LLDBFramework.cmake (original)
+++ lldb/trunk/cmake/modules/LLDBFramework.cmake Thu Jul 26 12:04:46 2018
@@ -12,24 +12,21 @@ foreach(header
                      COMMAND ${CMAKE_COMMAND} -E copy ${header} ${CMAKE_CURRENT_BINARY_DIR}/FrameworkHeaders/${basename})
   list(APPEND framework_headers ${CMAKE_CURRENT_BINARY_DIR}/FrameworkHeaders/${basename})
 endforeach()
-add_custom_target(lldb-framework-headers
-  DEPENDS ${framework_headers}
-  COMMAND ${LLDB_SOURCE_DIR}/scripts/framework-header-fix.sh ${CMAKE_CURRENT_BINARY_DIR} ${LLDB_VERSION})
+
+add_custom_command(TARGET lldb-framework POST_BUILD
+  COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_CURRENT_BINARY_DIR}/FrameworkHeaders $<TARGET_FILE_DIR:liblldb>/Headers
+  COMMAND ${LLDB_SOURCE_DIR}/scripts/framework-header-fix.sh $<TARGET_FILE_DIR:liblldb>/Headers ${LLDB_VERSION}
+)
 
 if (NOT IOS)
   if (NOT LLDB_BUILT_STANDALONE)
     add_dependencies(lldb-framework clang-headers)
   endif()
   add_custom_command(TARGET lldb-framework POST_BUILD
-    COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_CURRENT_BINARY_DIR}/FrameworkHeaders $<TARGET_FILE_DIR:liblldb>/Headers
     COMMAND ${CMAKE_COMMAND} -E create_symlink Versions/Current/Headers ${LLDB_FRAMEWORK_DIR}/LLDB.framework/Headers
     COMMAND ${CMAKE_COMMAND} -E create_symlink ${LLDB_FRAMEWORK_VERSION} ${LLDB_FRAMEWORK_DIR}/LLDB.framework/Versions/Current
     COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_BINARY_DIR}/lib${LLVM_LIBDIR_SUFFIX}/clang/${LLDB_VERSION} $<TARGET_FILE_DIR:liblldb>/Resources/Clang
   )
-else()
-  add_custom_command(TARGET lldb-framework POST_BUILD
-    COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_CURRENT_BINARY_DIR}/FrameworkHeaders $<TARGET_FILE_DIR:liblldb>/Headers
-  )
 endif()
 
 set_target_properties(liblldb PROPERTIES
@@ -41,5 +38,4 @@ set_target_properties(liblldb PROPERTIES
   PUBLIC_HEADER "${framework_headers}")
 
 add_dependencies(lldb-framework
-  lldb-framework-headers
   lldb-suite)




More information about the lldb-commits mailing list