<div dir="ltr">Looks good, thanks</div><br><div class="gmail_quote"><div dir="ltr">On Sun, Sep 6, 2015 at 8:06 AM Bruce Mitchener <<a href="mailto:bruce.mitchener@gmail.com">bruce.mitchener@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">brucem created this revision.<br>
brucem added reviewers: zturner, clayborg, labath.<br>
brucem added a subscriber: lldb-commits.<br>
<br>
This should be a mandatory build process going forward, if Python<br>
is enabled. The longer term desire is to remove the old shell<br>
scripts entirely.<br>
<br>
<a href="http://reviews.llvm.org/D12667" rel="noreferrer" target="_blank">http://reviews.llvm.org/D12667</a><br>
<br>
Files:<br>
CMakeLists.txt<br>
cmake/modules/LLDBConfig.cmake<br>
scripts/CMakeLists.txt<br>
<br>
Index: scripts/CMakeLists.txt<br>
===================================================================<br>
--- scripts/CMakeLists.txt<br>
+++ scripts/CMakeLists.txt<br>
@@ -9,49 +9,26 @@<br>
${LLDB_SOURCE_DIR}/include/lldb/lldb-versioning.h<br>
)<br>
<br>
-if ( LLDB_ENABLE_PYTHON_SCRIPTS_SWIG_API_GENERATION )<br>
- find_package(SWIG REQUIRED)<br>
- add_custom_command(<br>
- OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/LLDBWrapPython.cpp<br>
- DEPENDS ${SWIG_SOURCES}<br>
- DEPENDS ${SWIG_INTERFACES}<br>
- DEPENDS ${SWIG_HEADERS}<br>
- DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/buildSwigWrapperClasses.py<br>
- COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/buildSwigWrapperClasses.py "--srcRoot=${LLDB_SOURCE_DIR}" "--targetDir=${CMAKE_CURRENT_BINARY_DIR}" "--cfgBldDir=${CMAKE_CURRENT_BINARY_DIR}" "--prefix=${CMAKE_BINARY_DIR}" "--swigExecutable=${SWIG_EXECUTABLE}" -m<br>
- COMMENT "Python script building LLDB Python wrapper")<br>
- set_source_files_properties(${CMAKE_CURRENT_BINARY_DIR}/LLDBWrapPython.cpp PROPERTIES GENERATED 1)<br>
+find_package(SWIG REQUIRED)<br>
+add_custom_command(<br>
+ OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/LLDBWrapPython.cpp<br>
+ DEPENDS ${SWIG_SOURCES}<br>
+ DEPENDS ${SWIG_INTERFACES}<br>
+ DEPENDS ${SWIG_HEADERS}<br>
+ DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/buildSwigWrapperClasses.py<br>
+ COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/buildSwigWrapperClasses.py "--srcRoot=${LLDB_SOURCE_DIR}" "--targetDir=${CMAKE_CURRENT_BINARY_DIR}" "--cfgBldDir=${CMAKE_CURRENT_BINARY_DIR}" "--prefix=${CMAKE_BINARY_DIR}" "--swigExecutable=${SWIG_EXECUTABLE}" -m<br>
+ COMMENT "Python script building LLDB Python wrapper")<br>
+set_source_files_properties(${CMAKE_CURRENT_BINARY_DIR}/LLDBWrapPython.cpp PROPERTIES GENERATED 1)<br>
<br>
- add_custom_target(swig_wrapper ALL<br>
- DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/LLDBWrapPython.cpp<br>
- )<br>
+add_custom_target(swig_wrapper ALL<br>
+ DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/LLDBWrapPython.cpp<br>
+ )<br>
<br>
- # Install the LLDB python module on all operating systems (except Windows)<br>
- if (NOT CMAKE_SYSTEM_NAME MATCHES "Windows")<br>
- install(DIRECTORY ${CMAKE_BINARY_DIR}/lib${LLVM_LIBDIR_SUFFIX}/python${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR}<br>
- DESTINATION lib${LLVM_LIBDIR_SUFFIX})<br>
- endif()<br>
-else ()<br>
- add_custom_command(<br>
- OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/LLDBWrapPython.cpp<br>
- DEPENDS ${SWIG_SOURCES}<br>
- DEPENDS ${SWIG_INTERFACES}<br>
- # swig was directly invoked on Windows (where the Python API is not being generated) but on other platforms, we need to run the *swig-wrapper-classes.sh shell-scripts.<br>
- #COMMAND swig -c++ -shadow -python -I${LLDB_SOURCE_DIR}/include -I./. -outdir ${LLDB_SOURCE_DIR}/scripts/Python -o ${LLDB_SOURCE_DIR}/source/LLDBWrapPython.cpp ${LLDB_SOURCE_DIR}/scripts/lldb.swig<br>
- COMMAND env PYTHON_EXECUTABLE=${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/build-swig-wrapper-classes.sh ${LLDB_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_BINARY_DIR} -m<br>
- COMMAND env PYTHON_EXECUTABLE=${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/finish-swig-wrapper-classes.sh ${LLDB_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_BINARY_DIR} -m<br>
- COMMENT "Building lldb python wrapper")<br>
- set_source_files_properties(${CMAKE_CURRENT_BINARY_DIR}/LLDBWrapPython.cpp PROPERTIES GENERATED 1)<br>
-<br>
- add_custom_target(swig_wrapper ALL<br>
- DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/LLDBWrapPython.cpp<br>
- )<br>
-<br>
- # Install the LLDB python module on all operating systems (except Windows)<br>
- if (NOT CMAKE_SYSTEM_NAME MATCHES "Windows")<br>
- install(DIRECTORY ${CMAKE_BINARY_DIR}/lib${LLVM_LIBDIR_SUFFIX}/python${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR}<br>
- DESTINATION lib${LLVM_LIBDIR_SUFFIX})<br>
- endif()<br>
-endif ()<br>
+# Install the LLDB python module on all operating systems (except Windows)<br>
+if (NOT CMAKE_SYSTEM_NAME MATCHES "Windows")<br>
+ install(DIRECTORY ${CMAKE_BINARY_DIR}/lib${LLVM_LIBDIR_SUFFIX}/python${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR}<br>
+ DESTINATION lib${LLVM_LIBDIR_SUFFIX})<br>
+endif()<br>
<br>
# build Python modules<br>
add_subdirectory(Python/modules)<br>
Index: cmake/modules/LLDBConfig.cmake<br>
===================================================================<br>
--- cmake/modules/LLDBConfig.cmake<br>
+++ cmake/modules/LLDBConfig.cmake<br>
@@ -26,8 +26,6 @@<br>
set(LLDB_DISABLE_CURSES ${LLDB_DEFAULT_DISABLE_CURSES} CACHE BOOL<br>
"Disables the Curses integration.")<br>
<br>
-set(LLDB_ENABLE_PYTHON_SCRIPTS_SWIG_API_GENERATION 1 CACHE BOOL<br>
- "Enables using new Python scripts for SWIG API generation .")<br>
set(LLDB_RELOCATABLE_PYTHON 0 CACHE BOOL<br>
"Causes LLDB to use the PYTHONHOME environment variable to locate Python.")<br>
<br>
Index: CMakeLists.txt<br>
===================================================================<br>
--- CMakeLists.txt<br>
+++ CMakeLists.txt<br>
@@ -15,7 +15,7 @@<br>
add_subdirectory(unittests)<br>
add_subdirectory(lit)<br>
<br>
-if ( LLDB_ENABLE_PYTHON_SCRIPTS_SWIG_API_GENERATION AND NOT LLDB_DISABLE_PYTHON )<br>
+if (NOT LLDB_DISABLE_PYTHON)<br>
# Add a Post-Build Event to copy over Python files and create the symlink to liblldb.so for the Python API(hardlink on Windows)<br>
add_custom_target( finish_swig ALL<br>
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<br>
<br>
<br>
</blockquote></div>