tfiala created this revision.
tfiala added reviewers: labath, clayborg, emaste.
tfiala added a subscriber: lldb-commits.
Addresses:
* https://llvm.org/bugs/show_bug.cgi?id=24831: cmake + ninja: 'ninja lldb'
misses lib/python2.7 build dependency on Linux
* https://llvm.org/bugs/show_bug.cgi?id=24833: cmake + ninja: 'ninja lldb'
misses lldb-server dependency on Linux
Without this fix, 'cmake && ninja lldb' would:
* miss building lldb-server on Linux
* miss copying the python module and fail to create the _lldb.so symlink
With this fix, those issues are resolved on Linux. (The python post-build step
issue is resolved for all platforms that don't disable python and use the lldb
target).
This also prevents the need for executing:
'ninja'
which builds a number of additional executables (llvm/clang) which aren't
needed to test/run lldb. So it should trim down build times for those just
wanting lldb and its immediate dependencies.
http://reviews.llvm.org/D12899
Files:
CMakeLists.txt
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()
+# On Linux, ensure we get lldb-server when we build lldb.
+if ( CMAKE_SYSTEM_NAME MATCHES "Linux" )
+ 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: 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 ()
Index: tools/driver/CMakeLists.txt
===================================================================
--- tools/driver/CMakeLists.txt
+++ tools/driver/CMakeLists.txt
@@ -7,6 +7,11 @@
add_definitions( -DIMPORT_LIBLLDB )
endif()
+# On Linux, ensure we get lldb-server when we build lldb.
+if ( CMAKE_SYSTEM_NAME MATCHES "Linux" )
+ 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: 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 ()
_______________________________________________
lldb-commits mailing list
[email protected]
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits