[Lldb-commits] [PATCH] D64397: [CMake] Remove extra lldb-framework target

Stefan Gränitz via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Tue Jul 9 03:59:28 PDT 2019


sgraenitz created this revision.
sgraenitz added a reviewer: xiaobai.
Herald added a subscriber: mgorny.
Herald added a project: LLDB.

The custom lldb-framework target was meant to encapsulate all build steps that LLDB.framework needs on top of the ordinaly liblldb. In the end all of it happens in post-build steps, so we can do the same with liblldb and cut down another source of confusion.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D64397

Files:
  lldb/CMakeLists.txt
  lldb/cmake/modules/LLDBFramework.cmake


Index: lldb/cmake/modules/LLDBFramework.cmake
===================================================================
--- lldb/cmake/modules/LLDBFramework.cmake
+++ lldb/cmake/modules/LLDBFramework.cmake
@@ -42,12 +42,8 @@
     XCODE_ATTRIBUTE_MACOSX_DEPLOYMENT_TARGET "${MACOSX_DEPLOYMENT_TARGET}")
 endif()
 
-# Target to capture extra steps for a fully functional framework bundle.
-add_custom_target(lldb-framework ALL)
-add_dependencies(lldb-framework liblldb)
-
 # Apart from this one, CMake creates all required symlinks in the framework bundle.
-add_custom_command(TARGET lldb-framework POST_BUILD
+add_custom_command(TARGET liblldb POST_BUILD
   COMMAND ${CMAKE_COMMAND} -E create_symlink
           Versions/Current/Headers
           ${framework_target_dir}/LLDB.framework/Headers
@@ -79,12 +75,12 @@
 endforeach()
 
 # Wrap output in a target, so lldb-framework can depend on it.
-add_custom_target(lldb-framework-headers DEPENDS ${lldb_staged_headers})
-add_dependencies(lldb-framework lldb-framework-headers)
+add_custom_target(liblldb-resource-headers DEPENDS ${lldb_staged_headers})
+add_dependencies(liblldb liblldb-resource-headers)
 
 # At build time, copy the staged headers into the framework bundle (and do
 # some post-processing in-place).
-add_custom_command(TARGET lldb-framework-headers POST_BUILD
+add_custom_command(TARGET liblldb POST_BUILD
   COMMAND ${CMAKE_COMMAND} -E copy_directory ${lldb_header_staging} $<TARGET_FILE_DIR:liblldb>/Headers
   COMMAND ${LLDB_SOURCE_DIR}/scripts/framework-header-fix.sh $<TARGET_FILE_DIR:liblldb>/Headers ${LLDB_VERSION}
   COMMENT "LLDB.framework: copy framework headers"
@@ -93,7 +89,7 @@
 # Copy vendor-specific headers from clang (without staging).
 if(NOT IOS)
   if (TARGET clang-resource-headers)
-    add_dependencies(lldb-framework clang-resource-headers)
+    add_dependencies(liblldb clang-resource-headers)
     set(clang_resource_headers_dir $<TARGET_PROPERTY:clang-resource-headers,RUNTIME_OUTPUT_DIRECTORY>)
   else()
     # In standalone builds try the best possible guess
@@ -115,7 +111,7 @@
     endif()
   endif()
 
-  add_custom_command(TARGET lldb-framework POST_BUILD
+  add_custom_command(TARGET liblldb POST_BUILD
     COMMAND ${CMAKE_COMMAND} -E copy_directory
             ${clang_resource_headers_dir}
             $<TARGET_FILE_DIR:liblldb>/Resources/Clang/include
Index: lldb/CMakeLists.txt
===================================================================
--- lldb/CMakeLists.txt
+++ lldb/CMakeLists.txt
@@ -203,10 +203,6 @@
     # Ensure we do the python post-build step when building lldb.
     add_dependencies(lldb finish_swig)
 
-    if(LLDB_BUILD_FRAMEWORK)
-      add_dependencies(lldb-framework finish_swig)
-    endif()
-
     # Add a Post-Build Event to copy the custom Python DLL to the lldb binaries dir so that Windows can find it when launching
     # lldb.exe or any other executables that were linked with liblldb.
     if (WIN32 AND NOT "${PYTHON_DLL}" STREQUAL "")


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D64397.208632.patch
Type: text/x-patch
Size: 2978 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20190709/a94bde47/attachment-0001.bin>


More information about the lldb-commits mailing list