[Lldb-commits] [lldb] r247810 - cmake fixes for lldb target.
Todd Fiala via lldb-commits
lldb-commits at lists.llvm.org
Wed Sep 16 08:34:07 PDT 2015
Author: tfiala
Date: Wed Sep 16 10:34:06 2015
New Revision: 247810
URL: http://llvm.org/viewvc/llvm-project?rev=247810&view=rev
Log:
cmake fixes for lldb target.
ninja lldb now does the following:
* forces the python post-build step to fire, which sets up the python lldb module properly.
* on Darwin and Linux, requires the lldb-server target to be built.
* on Darwin, requires the debugserver target to be built.
See http://reviews.llvm.org/D12899 for details.
Modified:
lldb/trunk/CMakeLists.txt
lldb/trunk/cmake/modules/LLDBConfig.cmake
lldb/trunk/tools/driver/CMakeLists.txt
Modified: lldb/trunk/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/CMakeLists.txt?rev=247810&r1=247809&r2=247810&view=diff
==============================================================================
--- lldb/trunk/CMakeLists.txt (original)
+++ lldb/trunk/CMakeLists.txt Wed Sep 16 10:34:06 2015
@@ -16,10 +16,14 @@ add_subdirectory(unittests)
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 ()
Modified: lldb/trunk/cmake/modules/LLDBConfig.cmake
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/cmake/modules/LLDBConfig.cmake?rev=247810&r1=247809&r2=247810&view=diff
==============================================================================
--- lldb/trunk/cmake/modules/LLDBConfig.cmake (original)
+++ lldb/trunk/cmake/modules/LLDBConfig.cmake Wed Sep 16 10:34:06 2015
@@ -258,3 +258,20 @@ if (CMAKE_SYSTEM_NAME MATCHES "Linux")
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()
+
+# Figure out if lldb could use debugserver. If so, then we'll
+# ensure we build debugserver when we build lldb.
+if ( CMAKE_SYSTEM_NAME MATCHES "Darwin" )
+ set(LLDB_CAN_USE_DEBUGSERVER 1)
+else()
+ set(LLDB_CAN_USE_DEBUGSERVER 0)
+endif()
Modified: lldb/trunk/tools/driver/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/tools/driver/CMakeLists.txt?rev=247810&r1=247809&r2=247810&view=diff
==============================================================================
--- lldb/trunk/tools/driver/CMakeLists.txt (original)
+++ lldb/trunk/tools/driver/CMakeLists.txt Wed Sep 16 10:34:06 2015
@@ -7,6 +7,16 @@ if ( CMAKE_SYSTEM_NAME MATCHES "Windows"
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()
+
+# Add lldb dependency on debugserver if we can use it.
+if ( LLDB_CAN_USE_DEBUGSERVER )
+ add_dependencies(lldb debugserver)
+endif()
+
target_link_libraries(lldb liblldb)
# TODO: why isn't this done by add_lldb_executable?
#target_link_libraries(lldb ${LLDB_USED_LIBS})
More information about the lldb-commits
mailing list