[Lldb-commits] [PATCH] D142245: [lldb/swig] Remove deprecated flags for generating bindings

Med Ismail Bennani via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Fri Jan 20 15:01:27 PST 2023


mib updated this revision to Diff 490983.
mib retitled this revision from "[lldb/swig] Remove deprecated `-py3` flag to generate bindings" to "[lldb/swig] Remove deprecated flags for generating bindings".
mib edited the summary of this revision.
mib added a comment.

Address @JDevlieghere & @kastiglione comments


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D142245/new/

https://reviews.llvm.org/D142245

Files:
  lldb/bindings/python/CMakeLists.txt


Index: lldb/bindings/python/CMakeLists.txt
===================================================================
--- lldb/bindings/python/CMakeLists.txt
+++ lldb/bindings/python/CMakeLists.txt
@@ -1,3 +1,10 @@
+set(SWIG_EXTRA_FLAGS -c++ -threads -python)
+
+if ("${SWIG_VERSION}" VERSION_LESS "4.1.0")
+  set(SWIG_EXTRA_FLAGS ${SWIG_EXTRA_FLAGS} -py3)
+  message(STATUS "SWIG version ${SWIG_VERSION} uses `-py3` flag.")
+endif()
+
 add_custom_command(
   OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/LLDBWrapPython.cpp
   OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/lldb.py
@@ -7,11 +14,7 @@
   COMMAND ${SWIG_EXECUTABLE}
       ${SWIG_COMMON_FLAGS}
       -I${CMAKE_CURRENT_SOURCE_DIR}
-      -c++
-      -shadow
-      -python
-      -py3
-      -threads
+      ${SWIG_EXTRA_FLAGS}
       -outdir ${CMAKE_CURRENT_BINARY_DIR}
       -o ${CMAKE_CURRENT_BINARY_DIR}/LLDBWrapPython.cpp
       ${CMAKE_CURRENT_SOURCE_DIR}/python.swig


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D142245.490983.patch
Type: text/x-patch
Size: 910 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20230120/bf2ada55/attachment.bin>


More information about the lldb-commits mailing list