aboutsummaryrefslogtreecommitdiff
path: root/lldb/bindings/python
diff options
context:
space:
mode:
authorMed Ismail Bennani <medismail.bennani@gmail.com>2023-01-30 14:07:32 -0800
committerMed Ismail Bennani <medismail.bennani@gmail.com>2023-01-30 14:07:32 -0800
commit8520b0fc59c010675afbfdae71d48893afc7b68b (patch)
tree74709c28cfd1ae129f7a34e2c14fe2838273e9a7 /lldb/bindings/python
parentd502e0fbf933d08df2daf1618e97589af9e3c7d9 (diff)
downloadllvm-8520b0fc59c010675afbfdae71d48893afc7b68b.tar.gz
llvm-8520b0fc59c010675afbfdae71d48893afc7b68b.tar.bz2
llvm-8520b0fc59c010675afbfdae71d48893afc7b68b.zip
[lldb/swig] Remove deprecated flags for generating bindings
This patch conditionaly removes the `-py3` swig flag that was used to generate python3 bindings, since it's unsued since SWIG 4.1.0. ``` Deprecated command line option: -py3. Ignored, this option is no longer supported ``` This also removes the `-shadow` flag that have been deprecated since 2002. Differential Revision: https://reviews.llvm.org/D142245 Signed-off-by: Med Ismail Bennani <medismail.bennani@gmail.com>
Diffstat (limited to 'lldb/bindings/python')
-rw-r--r--lldb/bindings/python/CMakeLists.txt13
1 files changed, 8 insertions, 5 deletions
diff --git a/lldb/bindings/python/CMakeLists.txt b/lldb/bindings/python/CMakeLists.txt
index c631faf52ac3..528f9f47f17a 100644
--- a/lldb/bindings/python/CMakeLists.txt
+++ b/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 @@ add_custom_command(
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