[Lldb-commits] [PATCH] D12899: cmake fixups: post-build python step dependency and lldb-server dependency for lldb on Linux

Todd Fiala via lldb-commits lldb-commits at lists.llvm.org
Wed Sep 16 08:03:16 PDT 2015


tfiala updated this revision to Diff 34893.
tfiala added a comment.

Adjustments to set indirect variable for whether lldb can use lldb-server.  If so, then we'll add the dependency for lldb-server on lldb at the time we declare the lldb target.


http://reviews.llvm.org/D12899

Files:
  CMakeLists.txt
  cmake/modules/LLDBConfig.cmake
  tools/driver/CMakeLists.txt

Index: tools/driver/CMakeLists.txt
===================================================================
--- tools/driver/CMakeLists.txt
+++ tools/driver/CMakeLists.txt
@@ -7,6 +7,11 @@
   add_definitions( -DIMPORT_LIBLLDB )
 endif()
 
+# Add lldb dependency on lldb-server if we can use it.
+if ( LLDB_CAN_USE_LLDB_SERVER )
+  add_dependencies(lldb lldb-server)
+endif()
+
 target_link_libraries(lldb liblldb)
 # TODO: why isn't this done by add_lldb_executable?
 #target_link_libraries(lldb ${LLDB_USED_LIBS})
Index: cmake/modules/LLDBConfig.cmake
===================================================================
--- cmake/modules/LLDBConfig.cmake
+++ cmake/modules/LLDBConfig.cmake
@@ -258,3 +258,12 @@
         endif()
     endif()
 endif()
+
+# Figure out if lldb could use lldb-server.  If so, then we'll
+# ensure we build lldb-server when an lldb target is being built.
+if ( ( CMAKE_SYSTEM_NAME MATCHES "Linux" ) OR
+     ( CMAKE_SYSTEM_NAME MATCHES "Darwin" ) )
+    set(LLDB_CAN_USE_LLDB_SERVER 1)
+else()
+    set(LLDB_CAN_USE_LLDB_SERVER 0)
+endif()
\ No newline at end of file
Index: CMakeLists.txt
===================================================================
--- CMakeLists.txt
+++ CMakeLists.txt
@@ -16,10 +16,14 @@
 add_subdirectory(lit)
 
 if (NOT LLDB_DISABLE_PYTHON)
-	# Add a Post-Build Event to copy over Python files and create the symlink to liblldb.so for the Python API(hardlink on Windows)
+    # Add a Post-Build Event to copy over Python files and create the symlink to liblldb.so for the Python API(hardlink on Windows)
     add_custom_target( finish_swig ALL
         COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/scripts/finishSwigWrapperClasses.py "--srcRoot=${LLDB_SOURCE_DIR}" "--targetDir=${CMAKE_CURRENT_BINARY_DIR}/scripts" "--cfgBldDir=${CMAKE_CURRENT_BINARY_DIR}/scripts" "--prefix=${CMAKE_BINARY_DIR}" "--cmakeBuildConfiguration=${CMAKE_CFG_INTDIR}" -m
         DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/scripts/finishSwigWrapperClasses.py
         COMMENT "Python script sym-linking LLDB Python API")
+    # We depend on liblldb being built before we can do this step.
     add_dependencies(finish_swig liblldb argdumper)
+
+    # Ensure we do the python post-build step when building lldb.
+    add_dependencies(lldb finish_swig)
 endif ()


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D12899.34893.patch
Type: text/x-patch
Size: 2296 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20150916/b7cb48f3/attachment.bin>


More information about the lldb-commits mailing list